chromium/third_party/blink/renderer/core/inspector/inspector_dom_debugger_agent.cc

/*
 * Copyright (C) 2011 Google Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *     * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following disclaimer
 * in the documentation and/or other materials provided with the
 * distribution.
 *     * Neither the name of Google Inc. nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include "third_party/blink/renderer/core/inspector/inspector_dom_debugger_agent.h"

#include "third_party/blink/renderer/bindings/core/v8/js_based_event_listener.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_event_target.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_node.h"
#include "third_party/blink/renderer/core/dom/dom_node_ids.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/events/event.h"
#include "third_party/blink/renderer/core/dom/events/event_target.h"
#include "third_party/blink/renderer/core/dom/node.h"
#include "third_party/blink/renderer/core/frame/csp/content_security_policy.h"
#include "third_party/blink/renderer/core/frame/csp/content_security_policy_violation_type.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/inspector/inspector_dom_agent.h"
#include "third_party/blink/renderer/core/inspector/resolve_node.h"
#include "third_party/blink/renderer/core/inspector/v8_inspector_string.h"
#include "third_party/blink/renderer/core/probe/core_probes.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/inspector_protocol/crdtp/json.h"
SpanFrom;
ConvertCBORToJSON;

namespace {

enum DOMBreakpointType {};

const uint32_t inheritableDOMBreakpointTypesMask =;
const int domBreakpointDerivedTypeShift =;

const char kListenerEventCategoryType[] =;

}  // namespace

namespace blink {
Maybe;
namespace {
// Returns the key that we use to identify the brekpoint in
// event_listener_breakpoints_. |target_name| may be "", in which case
// we'll match any target.
WTF::String EventListenerBreakpointKey(const WTF::String& event_name,
                                       const WTF::String& target_name) {}
}  // namespace

// static
void InspectorDOMDebuggerAgent::CollectEventListeners(
    v8::Isolate* isolate,
    EventTarget* target,
    v8::Local<v8::Value> target_wrapper,
    Node* target_node,
    bool report_for_all_contexts,
    V8EventListenerInfoList* event_information) {}

// static
void InspectorDOMDebuggerAgent::EventListenersInfoForTarget(
    v8::Isolate* isolate,
    v8::Local<v8::Value> value,
    V8EventListenerInfoList* event_information) {}

static bool FilterNodesWithListeners(Node* node) {}

// static
void InspectorDOMDebuggerAgent::EventListenersInfoForTarget(
    v8::Isolate* isolate,
    v8::Local<v8::Value> value,
    int depth,
    bool pierce,
    InspectorDOMAgent::IncludeWhitespaceEnum include_whitespace,
    V8EventListenerInfoList* event_information) {}

InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent(
    v8::Isolate* isolate,
    InspectorDOMAgent* dom_agent,
    v8_inspector::V8InspectorSession* v8_session)
    :{}

InspectorDOMDebuggerAgent::~InspectorDOMDebuggerAgent() = default;

void InspectorDOMDebuggerAgent::Trace(Visitor* visitor) const {}

protocol::Response InspectorDOMDebuggerAgent::disable() {}

void InspectorDOMDebuggerAgent::Restore() {}

protocol::Response InspectorDOMDebuggerAgent::setEventListenerBreakpoint(
    const String& event_name,
    Maybe<String> target_name) {}

protocol::Response InspectorDOMDebuggerAgent::SetBreakpoint(
    const String& event_name,
    const String& target_name) {}

protocol::Response InspectorDOMDebuggerAgent::removeEventListenerBreakpoint(
    const String& event_name,
    Maybe<String> target_name) {}

protocol::Response InspectorDOMDebuggerAgent::RemoveBreakpoint(
    const String& event_name,
    const String& target_name) {}

void InspectorDOMDebuggerAgent::DidInvalidateStyleAttr(Node* node) {}

void InspectorDOMDebuggerAgent::DidInsertDOMNode(Node* node) {}

void InspectorDOMDebuggerAgent::DidRemoveDOMNode(Node* node) {}

static protocol::Response DomTypeForName(const String& type_string, int& type) {}

static String DomTypeName(int type) {}

bool IsValidViolationType(const String& violationString) {}

protocol::Response InspectorDOMDebuggerAgent::setBreakOnCSPViolation(
    std::unique_ptr<protocol::Array<String>> violationTypes) {}

protocol::Response InspectorDOMDebuggerAgent::setDOMBreakpoint(
    int node_id,
    const String& type_string) {}

protocol::Response InspectorDOMDebuggerAgent::removeDOMBreakpoint(
    int node_id,
    const String& type_string) {}

protocol::Response InspectorDOMDebuggerAgent::getEventListeners(
    const String& object_id,
    Maybe<int> depth,
    Maybe<bool> pierce,
    std::unique_ptr<protocol::Array<protocol::DOMDebugger::EventListener>>*
        listeners_array) {}

std::unique_ptr<protocol::Array<protocol::DOMDebugger::EventListener>>
InspectorDOMDebuggerAgent::BuildObjectsForEventListeners(
    const V8EventListenerInfoList& event_information,
    v8::Local<v8::Context> context,
    const v8_inspector::StringView& object_group_id) {}

std::unique_ptr<protocol::DOMDebugger::EventListener>
InspectorDOMDebuggerAgent::BuildObjectForEventListener(
    v8::Local<v8::Context> context,
    const V8EventListenerInfo& info,
    const v8_inspector::StringView& object_group_id) {}

void InspectorDOMDebuggerAgent::WillInsertDOMNode(Node* parent) {}

void InspectorDOMDebuggerAgent::CharacterDataModified(CharacterData* node) {}

void InspectorDOMDebuggerAgent::WillRemoveDOMNode(Node* node) {}

void InspectorDOMDebuggerAgent::WillModifyDOMAttr(Element* element,
                                                  const AtomicString&,
                                                  const AtomicString&) {}

void InspectorDOMDebuggerAgent::BreakProgramOnDOMEvent(Node* target,
                                                       int breakpoint_type,
                                                       bool insertion) {}

bool InspectorDOMDebuggerAgent::HasBreakpoint(Node* node, int type) const {}

uint32_t InspectorDOMDebuggerAgent::FindBreakpointMask(Node* node) const {}

void InspectorDOMDebuggerAgent::UpdateSubtreeBreakpoints(Node* node,
                                                         uint32_t root_mask,
                                                         bool set) {}

void InspectorDOMDebuggerAgent::PauseOnNativeEventIfNeeded(
    std::unique_ptr<protocol::DictionaryValue> event_data,
    bool synchronous) {}

std::unique_ptr<protocol::DictionaryValue>
InspectorDOMDebuggerAgent::PreparePauseOnNativeEventData(
    const String& event_name,
    const String& target_name) {}

void InspectorDOMDebuggerAgent::CancelNativeBreakpoint() {}

void InspectorDOMDebuggerAgent::Will(const probe::UserCallback& probe) {}

void InspectorDOMDebuggerAgent::Did(const probe::UserCallback& probe) {}

protocol::Response InspectorDOMDebuggerAgent::setXHRBreakpoint(
    const String& url) {}

protocol::Response InspectorDOMDebuggerAgent::removeXHRBreakpoint(
    const String& url) {}

// Returns the breakpoint url if a match is found, or WTF::String().
String InspectorDOMDebuggerAgent::MatchXHRBreakpoints(const String& url) const {}

void InspectorDOMDebuggerAgent::WillSendXMLHttpOrFetchNetworkRequest(
    const String& url) {}

void InspectorDOMDebuggerAgent::DidAddBreakpoint() {}

void InspectorDOMDebuggerAgent::DidRemoveBreakpoint() {}

void InspectorDOMDebuggerAgent::SetEnabled(bool enabled) {}

void InspectorDOMDebuggerAgent::DidAddDocument(Document* document) {}

void InspectorDOMDebuggerAgent::DidModifyDOMAttr(Element* element) {}

void InspectorDOMDebuggerAgent::DidCommitLoadForLocalFrame(LocalFrame*) {}

String ViolationTypeToString(const ContentSecurityPolicyViolationType type) {}

void InspectorDOMDebuggerAgent::OnContentSecurityPolicyViolation(
    const ContentSecurityPolicyViolationType violationType) {}

}  // namespace blink