2011-01-14 Sheriff Bot <webkit.review.bot@gmail.com>
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jan 2011 09:21:05 +0000 (09:21 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jan 2011 09:21:05 +0000 (09:21 +0000)
        Unreviewed, rolling out r75774.
        http://trac.webkit.org/changeset/75774
        https://bugs.webkit.org/show_bug.cgi?id=52431

        gtk builds were broken (Requested by loislo2 on #webkit).

        * CMakeLists.txt:
        * WebCore.gypi:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * inspector/CodeGeneratorInspector.pm:
        * inspector/Inspector.idl:
        * inspector/InspectorBrowserDebuggerAgent.cpp: Removed.
        * inspector/InspectorBrowserDebuggerAgent.h: Removed.
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::InspectorController):
        (WebCore::InspectorController::inspectedPageDestroyed):
        (WebCore::InspectorController::didCommitLoad):
        (WebCore::InspectorController::enableDebuggerFromFrontend):
        (WebCore::InspectorController::disableDebugger):
        (WebCore::InspectorController::restoreStickyBreakpoints):
        (WebCore::InspectorController::restoreStickyBreakpoint):
        (WebCore::InspectorController::setEventListenerBreakpoint):
        (WebCore::InspectorController::removeEventListenerBreakpoint):
        (WebCore::InspectorController::hasEventListenerBreakpoint):
        (WebCore::InspectorController::setXHRBreakpoint):
        (WebCore::InspectorController::removeXHRBreakpoint):
        (WebCore::InspectorController::hasXHRBreakpoint):
        * inspector/InspectorController.h:
        * inspector/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::discardBindings):
        (WebCore::InspectorDOMAgent::setDOMBreakpoint):
        (WebCore::InspectorDOMAgent::removeDOMBreakpoint):
        (WebCore::InspectorDOMAgent::shouldBreakOnNodeInsertion):
        (WebCore::InspectorDOMAgent::shouldBreakOnNodeRemoval):
        (WebCore::InspectorDOMAgent::shouldBreakOnAttributeModification):
        (WebCore::InspectorDOMAgent::descriptionForDOMEvent):
        (WebCore::InspectorDOMAgent::didInsertDOMNode):
        (WebCore::InspectorDOMAgent::didRemoveDOMNode):
        (WebCore::InspectorDOMAgent::hasBreakpoint):
        (WebCore::InspectorDOMAgent::updateSubtreeBreakpoints):
        * inspector/InspectorDOMAgent.h:
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::willInsertDOMNodeImpl):
        (WebCore::InspectorInstrumentation::didInsertDOMNodeImpl):
        (WebCore::InspectorInstrumentation::willRemoveDOMNodeImpl):
        (WebCore::InspectorInstrumentation::didRemoveDOMNodeImpl):
        (WebCore::InspectorInstrumentation::willModifyDOMAttrImpl):
        (WebCore::InspectorInstrumentation::willSendXMLHttpRequestImpl):
        (WebCore::InspectorInstrumentation::pauseOnNativeEventIfNeeded):

2011-01-14  Sheriff Bot  <webkit.review.bot@gmail.com>

        Unreviewed, rolling out r75774.
        http://trac.webkit.org/changeset/75774
        https://bugs.webkit.org/show_bug.cgi?id=52431

        gtk builds were broken (Requested by loislo2 on #webkit).

        * Scripts/webkitpy/common/checkout/scm.py:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@75776 268f45cc-cd09-0410-ab3c-d52691b4dbfc

17 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.pro
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/inspector/CodeGeneratorInspector.pm
Source/WebCore/inspector/Inspector.idl
Source/WebCore/inspector/InspectorBrowserDebuggerAgent.cpp [deleted file]
Source/WebCore/inspector/InspectorBrowserDebuggerAgent.h [deleted file]
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorController.h
Source/WebCore/inspector/InspectorDOMAgent.cpp
Source/WebCore/inspector/InspectorDOMAgent.h
Source/WebCore/inspector/InspectorInstrumentation.cpp
Tools/ChangeLog
Tools/Scripts/webkitpy/common/checkout/scm.py

index 385400a..c04e8a3 100644 (file)
@@ -1152,7 +1152,6 @@ SET(WebCore_SOURCES
     inspector/InjectedScript.cpp
     inspector/InjectedScriptHost.cpp
     inspector/InspectorApplicationCacheAgent.cpp
-    inspector/InspectorBrowserDebuggerAgent.cpp
     inspector/InspectorCSSAgent.cpp
     inspector/InspectorClient.cpp
     inspector/InspectorController.cpp
index c84a3cf..e8123b0 100644 (file)
@@ -1,3 +1,57 @@
+2011-01-14  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r75774.
+        http://trac.webkit.org/changeset/75774
+        https://bugs.webkit.org/show_bug.cgi?id=52431
+
+        gtk builds were broken (Requested by loislo2 on #webkit).
+
+        * CMakeLists.txt:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * inspector/CodeGeneratorInspector.pm:
+        * inspector/Inspector.idl:
+        * inspector/InspectorBrowserDebuggerAgent.cpp: Removed.
+        * inspector/InspectorBrowserDebuggerAgent.h: Removed.
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::InspectorController):
+        (WebCore::InspectorController::inspectedPageDestroyed):
+        (WebCore::InspectorController::didCommitLoad):
+        (WebCore::InspectorController::enableDebuggerFromFrontend):
+        (WebCore::InspectorController::disableDebugger):
+        (WebCore::InspectorController::restoreStickyBreakpoints):
+        (WebCore::InspectorController::restoreStickyBreakpoint):
+        (WebCore::InspectorController::setEventListenerBreakpoint):
+        (WebCore::InspectorController::removeEventListenerBreakpoint):
+        (WebCore::InspectorController::hasEventListenerBreakpoint):
+        (WebCore::InspectorController::setXHRBreakpoint):
+        (WebCore::InspectorController::removeXHRBreakpoint):
+        (WebCore::InspectorController::hasXHRBreakpoint):
+        * inspector/InspectorController.h:
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::discardBindings):
+        (WebCore::InspectorDOMAgent::setDOMBreakpoint):
+        (WebCore::InspectorDOMAgent::removeDOMBreakpoint):
+        (WebCore::InspectorDOMAgent::shouldBreakOnNodeInsertion):
+        (WebCore::InspectorDOMAgent::shouldBreakOnNodeRemoval):
+        (WebCore::InspectorDOMAgent::shouldBreakOnAttributeModification):
+        (WebCore::InspectorDOMAgent::descriptionForDOMEvent):
+        (WebCore::InspectorDOMAgent::didInsertDOMNode):
+        (WebCore::InspectorDOMAgent::didRemoveDOMNode):
+        (WebCore::InspectorDOMAgent::hasBreakpoint):
+        (WebCore::InspectorDOMAgent::updateSubtreeBreakpoints):
+        * inspector/InspectorDOMAgent.h:
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::willInsertDOMNodeImpl):
+        (WebCore::InspectorInstrumentation::didInsertDOMNodeImpl):
+        (WebCore::InspectorInstrumentation::willRemoveDOMNodeImpl):
+        (WebCore::InspectorInstrumentation::didRemoveDOMNodeImpl):
+        (WebCore::InspectorInstrumentation::willModifyDOMAttrImpl):
+        (WebCore::InspectorInstrumentation::willSendXMLHttpRequestImpl):
+        (WebCore::InspectorInstrumentation::pauseOnNativeEventIfNeeded):
+
 2011-01-12  Ilya Tikhonovsky  <loislo@chromium.org>
 
         Reviewed by Yury Semikhatsky.
index 5732135..5547863 100644 (file)
             'inspector/InjectedScriptHost.h',
             'inspector/InspectorApplicationCacheAgent.cpp',
             'inspector/InspectorApplicationCacheAgent.h',
-            'inspector/InspectorBrowserDebuggerAgent.cpp',
-            'inspector/InspectorBrowserDebuggerAgent.h',
             'inspector/InspectorClient.cpp',
             'inspector/InspectorClient.h',
             'inspector/InspectorController.cpp',
index 1b24dbf..819d569 100644 (file)
@@ -1043,7 +1043,6 @@ SOURCES += \
     inspector/InjectedScript.cpp \
     inspector/InjectedScriptHost.cpp \
     inspector/InspectorApplicationCacheAgent.cpp \
-    inspector/InspectorBrowserDebuggerAgent.cpp \
     inspector/InspectorCSSAgent.cpp \
     inspector/InspectorClient.cpp \
     inspector/InspectorController.cpp \
@@ -1936,7 +1935,6 @@ HEADERS += \
     inspector/InjectedScript.h \
     inspector/InjectedScriptHost.h \
     inspector/InspectorApplicationCacheAgent.h \
-    inspector/InspectorBrowserDebuggerAgent.h \
     inspector/InspectorController.h \
     inspector/InspectorCSSAgent.h \
     inspector/InspectorDatabaseAgent.h \
index fd983db..4217908 100755 (executable)
                                >
                        </File>
                        <File
-                               RelativePath="..\inspector\InspectorBrowserDebuggerAgent.cpp"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\inspector\InspectorBrowserDebuggerAgent.h"
-                               >
-                       </File>
-                       <File
                                RelativePath="..\inspector\InspectorClient.cpp"
                                >
                        </File>
index 7130a38..bc3d04d 100644 (file)
                4F707A9A11EF679400ACDA69 /* InspectorBackendDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F707A9811EF679400ACDA69 /* InspectorBackendDispatcher.h */; };
                4FA3B90A125CD12200300BAD /* InspectorState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FA3B908125CD12100300BAD /* InspectorState.cpp */; };
                4FA3B90B125CD12200300BAD /* InspectorState.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FA3B909125CD12200300BAD /* InspectorState.h */; };
-               4FC2842412DDF27E00BF42E4 /* InspectorBrowserDebuggerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FC2842212DDF27E00BF42E4 /* InspectorBrowserDebuggerAgent.h */; };
-               4FC2842512DDF27E00BF42E4 /* InspectorBrowserDebuggerAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FC2842312DDF27E00BF42E4 /* InspectorBrowserDebuggerAgent.cpp */; };
                4FD8D0F2119C718B002FA825 /* ScriptGCEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FD8D0F0119C718B002FA825 /* ScriptGCEvent.cpp */; };
                4FD8D0F3119C718B002FA825 /* ScriptGCEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FD8D0F1119C718B002FA825 /* ScriptGCEvent.h */; };
                510184690B08602A004A825F /* CachedPage.h in Headers */ = {isa = PBXBuildFile; fileRef = 510184670B08602A004A825F /* CachedPage.h */; settings = {ATTRIBUTES = (Private, ); }; };
                4F707A9811EF679400ACDA69 /* InspectorBackendDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorBackendDispatcher.h; sourceTree = "<group>"; };
                4FA3B908125CD12100300BAD /* InspectorState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorState.cpp; sourceTree = "<group>"; };
                4FA3B909125CD12200300BAD /* InspectorState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorState.h; sourceTree = "<group>"; };
-               4FC2842212DDF27E00BF42E4 /* InspectorBrowserDebuggerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorBrowserDebuggerAgent.h; sourceTree = "<group>"; };
-               4FC2842312DDF27E00BF42E4 /* InspectorBrowserDebuggerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorBrowserDebuggerAgent.cpp; sourceTree = "<group>"; };
                4FD8D0F0119C718B002FA825 /* ScriptGCEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptGCEvent.cpp; sourceTree = "<group>"; };
                4FD8D0F1119C718B002FA825 /* ScriptGCEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptGCEvent.h; sourceTree = "<group>"; };
                510184670B08602A004A825F /* CachedPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedPage.h; sourceTree = "<group>"; };
                                7A563F9512DF5C9100F4536D /* InjectedScriptSource.js */,
                                B885E8D211E06DD2009FFBF4 /* InspectorApplicationCacheAgent.cpp */,
                                B885E8D311E06DD2009FFBF4 /* InspectorApplicationCacheAgent.h */,
-                               4FC2842212DDF27E00BF42E4 /* InspectorBrowserDebuggerAgent.h */,
-                               4FC2842312DDF27E00BF42E4 /* InspectorBrowserDebuggerAgent.cpp */,
                                7A1F2B51126C61B20006A7E6 /* InspectorClient.cpp */,
                                1C81B9580E97330800266E07 /* InspectorClient.h */,
                                1C81B9570E97330800266E07 /* InspectorController.cpp */,
                                97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
                                2E37DFDB12DBAFB800A6B233 /* DOMURL.h in Headers */,
                                2E37E00612DBC5A400A6B233 /* JSDOMURL.h in Headers */,
-                               4FC2842412DDF27E00BF42E4 /* InspectorBrowserDebuggerAgent.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
                                2E37DFDA12DBAFB800A6B233 /* DOMURL.cpp in Sources */,
                                2E37E00512DBC5A400A6B233 /* JSDOMURL.cpp in Sources */,
-                               4FC2842512DDF27E00BF42E4 /* InspectorBrowserDebuggerAgent.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 30cc565..b8aea0e 100644 (file)
@@ -25,11 +25,6 @@ $typeTransform{"Debugger"} = {
     "header" => "InspectorDebuggerAgent.h",
     "domainAccessor" => "m_inspectorController->m_debuggerAgent",
 };
-$typeTransform{"BrowserDebugger"} = {
-    "forward" => "InspectorBrowserDebuggerAgent",
-    "header" => "InspectorBrowserDebuggerAgent.h",
-    "domainAccessor" => "m_inspectorController->m_browserDebuggerAgent",
-};
 $typeTransform{"Database"} = {
     "forward" => "InspectorDatabaseAgent",
     "header" => "InspectorDatabaseAgent.h",
index d3e6296..87b38c2 100644 (file)
@@ -223,9 +223,6 @@ module core {
 
         [domain=Inspector] void enableDebuggerFromFrontend(in boolean always);
         [domain=Inspector] void disableDebugger(in boolean always);
-
-        [domain=Inspector] void setStickyBreakpoints(in Object breakpoints);
-
         [notify, domain=Debugger] void debuggerWasEnabled();
         [notify, domain=Debugger] void debuggerWasDisabled();
 
@@ -240,12 +237,16 @@ module core {
         [domain=Debugger] void setBreakpoint(in String sourceID, in unsigned int lineNumber, in String condition, in boolean enabled, out String breakpointId, out unsigned int actualLineNumber);
         [domain=Debugger] void removeBreakpoint(in String breakpointId);
 
-        [domain=BrowserDebugger] void setDOMBreakpoint(in long nodeId, in long type);
-        [domain=BrowserDebugger] void removeDOMBreakpoint(in long nodeId, in long type);
-        [domain=BrowserDebugger] void setEventListenerBreakpoint(in String eventName);
-        [domain=BrowserDebugger] void removeEventListenerBreakpoint(in String eventName);
-        [domain=BrowserDebugger] void setXHRBreakpoint(in String url);
-        [domain=BrowserDebugger] void removeXHRBreakpoint(in String url);
+        [domain=Inspector] void setStickyBreakpoints(in Object breakpoints); // FIXME: Move to newly introduced BrowserDebugger.
+
+        [domain=DOM] void setDOMBreakpoint(in long nodeId, in long type); // FIXME: Move to newly introduced BrowserDebugger.
+        [domain=DOM] void removeDOMBreakpoint(in long nodeId, in long type); // FIXME: Move to newly introduced BrowserDebugger.
+
+        [domain=Inspector] void setEventListenerBreakpoint(in String eventName); // FIXME: Move to newly introduced BrowserDebugger.
+        [domain=Inspector] void removeEventListenerBreakpoint(in String eventName); // FIXME: Move to newly introduced BrowserDebugger.
+
+        [domain=Inspector] void setXHRBreakpoint(in String url); // FIXME: Move to newly introduced BrowserDebugger.
+        [domain=Inspector] void removeXHRBreakpoint(in String url); // FIXME: Move to newly introduced BrowserDebugger.
 
         [domain=Debugger] void stepOver();
         [domain=Debugger] void stepInto();
diff --git a/Source/WebCore/inspector/InspectorBrowserDebuggerAgent.cpp b/Source/WebCore/inspector/InspectorBrowserDebuggerAgent.cpp
deleted file mode 100644 (file)
index ad01929..0000000
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * 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 "config.h"
-
-#include "InspectorBrowserDebuggerAgent.h"
-
-#if ENABLE(INSPECTOR) && ENABLE(JAVASCRIPT_DEBUGGER)
-
-#include "HTMLElement.h"
-#include "InspectorController.h"
-#include "InspectorDOMAgent.h"
-#include "InspectorDebuggerAgent.h"
-#include "InspectorState.h"
-
-namespace {
-
-enum DOMBreakpointType {
-    SubtreeModified = 0,
-    AttributeModified,
-    NodeRemoved,
-    DOMBreakpointTypesCount
-};
-
-static const char* const domNativeBreakpointType = "DOM";
-static const char* const eventListenerNativeBreakpointType = "EventListener";
-static const char* const xhrNativeBreakpointType = "XHR";
-
-const uint32_t inheritableDOMBreakpointTypesMask = (1 << SubtreeModified);
-const int domBreakpointDerivedTypeShift = 16;
-
-}
-
-namespace WebCore {
-
-InspectorBrowserDebuggerAgent::InspectorBrowserDebuggerAgent(InspectorController* controller)
-    : m_controller(controller)
-    , m_hasXHRBreakpointWithEmptyURL(false)
-{
-}
-
-InspectorBrowserDebuggerAgent::~InspectorBrowserDebuggerAgent()
-{
-}
-
-void InspectorBrowserDebuggerAgent::discardBindings()
-{
-    m_breakpoints.clear();
-}
-
-void InspectorBrowserDebuggerAgent::setEventListenerBreakpoint(const String& eventName)
-{
-    m_eventListenerBreakpoints.add(eventName);
-}
-
-void InspectorBrowserDebuggerAgent::removeEventListenerBreakpoint(const String& eventName)
-{
-    m_eventListenerBreakpoints.remove(eventName);
-}
-
-void InspectorBrowserDebuggerAgent::didInsertDOMNode(Node* node)
-{
-    if (m_breakpoints.size()) {
-        uint32_t mask = m_breakpoints.get(InspectorDOMAgent::innerParentNode(node));
-        uint32_t inheritableTypesMask = (mask | (mask >> domBreakpointDerivedTypeShift)) & inheritableDOMBreakpointTypesMask;
-        if (inheritableTypesMask)
-            updateSubtreeBreakpoints(node, inheritableTypesMask, true);
-    }
-}
-
-void InspectorBrowserDebuggerAgent::didRemoveDOMNode(Node* node)
-{
-    if (m_breakpoints.size()) {
-        // Remove subtree breakpoints.
-        m_breakpoints.remove(node);
-        Vector<Node*> stack(1, InspectorDOMAgent::innerFirstChild(node));
-        do {
-            Node* node = stack.last();
-            stack.removeLast();
-            if (!node)
-                continue;
-            m_breakpoints.remove(node);
-            stack.append(InspectorDOMAgent::innerFirstChild(node));
-            stack.append(InspectorDOMAgent::innerNextSibling(node));
-        } while (!stack.isEmpty());
-    }
-}
-
-void InspectorBrowserDebuggerAgent::setDOMBreakpoint(long nodeId, long type)
-{
-    Node* node = m_controller->m_domAgent->nodeForId(nodeId);
-    if (!node)
-        return;
-
-    uint32_t rootBit = 1 << type;
-    m_breakpoints.set(node, m_breakpoints.get(node) | rootBit);
-    if (rootBit & inheritableDOMBreakpointTypesMask) {
-        for (Node* child = InspectorDOMAgent::innerFirstChild(node); child; child = InspectorDOMAgent::innerNextSibling(child))
-            updateSubtreeBreakpoints(child, rootBit, true);
-    }
-}
-
-void InspectorBrowserDebuggerAgent::removeDOMBreakpoint(long nodeId, long type)
-{
-    Node* node = m_controller->m_domAgent->nodeForId(nodeId);
-    if (!node)
-        return;
-
-    uint32_t rootBit = 1 << type;
-    uint32_t mask = m_breakpoints.get(node) & ~rootBit;
-    if (mask)
-        m_breakpoints.set(node, mask);
-    else
-        m_breakpoints.remove(node);
-
-    if ((rootBit & inheritableDOMBreakpointTypesMask) && !(mask & (rootBit << domBreakpointDerivedTypeShift))) {
-        for (Node* child = InspectorDOMAgent::innerFirstChild(node); child; child = InspectorDOMAgent::innerNextSibling(child))
-            updateSubtreeBreakpoints(child, rootBit, false);
-    }
-}
-
-void InspectorBrowserDebuggerAgent::willInsertDOMNode(Node*, Node* parent)
-{
-    InspectorDebuggerAgent* debuggerAgent = m_controller->m_debuggerAgent.get();
-    if (!debuggerAgent)
-        return;
-
-    if (hasBreakpoint(parent, SubtreeModified)) {
-        RefPtr<InspectorObject> eventData = InspectorObject::create();
-        descriptionForDOMEvent(parent, SubtreeModified, true, eventData.get());
-        eventData->setString("breakpointType", domNativeBreakpointType);
-        debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData.release());
-    }
-}
-
-void InspectorBrowserDebuggerAgent::willRemoveDOMNode(Node* node)
-{
-    InspectorDebuggerAgent* debuggerAgent = m_controller->m_debuggerAgent.get();
-    if (!debuggerAgent)
-        return;
-
-    if (hasBreakpoint(node, NodeRemoved)) {
-        RefPtr<InspectorObject> eventData = InspectorObject::create();
-        descriptionForDOMEvent(node, NodeRemoved, false, eventData.get());
-        eventData->setString("breakpointType", domNativeBreakpointType);
-        debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData.release());
-    } else if (hasBreakpoint(InspectorDOMAgent::innerParentNode(node), SubtreeModified)) {
-        RefPtr<InspectorObject> eventData = InspectorObject::create();
-        descriptionForDOMEvent(node, SubtreeModified, false, eventData.get());
-        eventData->setString("breakpointType", domNativeBreakpointType);
-        debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData.release());
-    }
-}
-
-void InspectorBrowserDebuggerAgent::willModifyDOMAttr(Element* element)
-{
-    InspectorDebuggerAgent* debuggerAgent = m_controller->m_debuggerAgent.get();
-    if (!debuggerAgent)
-        return;
-
-    if (hasBreakpoint(element, AttributeModified)) {
-        RefPtr<InspectorObject> eventData = InspectorObject::create();
-        descriptionForDOMEvent(element, AttributeModified, false, eventData.get());
-        eventData->setString("breakpointType", domNativeBreakpointType);
-        debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData.release());
-    }
-}
-
-void InspectorBrowserDebuggerAgent::descriptionForDOMEvent(Node* target, long breakpointType, bool insertion, InspectorObject* description)
-{
-    ASSERT(hasBreakpoint(target, breakpointType));
-
-    Node* breakpointOwner = target;
-    if ((1 << breakpointType) & inheritableDOMBreakpointTypesMask) {
-        // For inheritable breakpoint types, target node isn't always the same as the node that owns a breakpoint.
-        // Target node may be unknown to frontend, so we need to push it first.
-        long targetNodeId = m_controller->m_domAgent->pushNodePathToFrontend(target);
-        ASSERT(targetNodeId);
-        description->setNumber("targetNodeId", targetNodeId);
-
-        // Find breakpoint owner node.
-        if (!insertion)
-            breakpointOwner = InspectorDOMAgent::innerParentNode(target);
-        ASSERT(breakpointOwner);
-        while (!(m_breakpoints.get(breakpointOwner) & (1 << breakpointType))) {
-            breakpointOwner = InspectorDOMAgent::innerParentNode(breakpointOwner);
-            ASSERT(breakpointOwner);
-        }
-
-        if (breakpointType == SubtreeModified)
-            description->setBoolean("insertion", insertion);
-    }
-
-    long breakpointOwnerNodeId = m_controller->m_domAgent->pushNodePathToFrontend(breakpointOwner);
-    ASSERT(breakpointOwnerNodeId);
-    description->setNumber("nodeId", breakpointOwnerNodeId);
-    description->setNumber("type", breakpointType);
-}
-
-bool InspectorBrowserDebuggerAgent::hasBreakpoint(Node* node, long type)
-{
-    uint32_t rootBit = 1 << type;
-    uint32_t derivedBit = rootBit << domBreakpointDerivedTypeShift;
-    return m_breakpoints.get(node) & (rootBit | derivedBit);
-}
-
-void InspectorBrowserDebuggerAgent::updateSubtreeBreakpoints(Node* node, uint32_t rootMask, bool set)
-{
-    uint32_t oldMask = m_breakpoints.get(node);
-    uint32_t derivedMask = rootMask << domBreakpointDerivedTypeShift;
-    uint32_t newMask = set ? oldMask | derivedMask : oldMask & ~derivedMask;
-    if (newMask)
-        m_breakpoints.set(node, newMask);
-    else
-        m_breakpoints.remove(node);
-
-    uint32_t newRootMask = rootMask & ~newMask;
-    if (!newRootMask)
-        return;
-
-    for (Node* child = InspectorDOMAgent::innerFirstChild(node); child; child = InspectorDOMAgent::innerNextSibling(child))
-        updateSubtreeBreakpoints(child, newRootMask, set);
-}
-
-void InspectorBrowserDebuggerAgent::pauseOnNativeEventIfNeeded(const String& categoryType, const String& eventName, bool synchronous)
-{
-    InspectorDebuggerAgent* debuggerAgent = m_controller->m_debuggerAgent.get();
-    if (!debuggerAgent)
-        return;
-
-    String fullEventName = String::format("%s:%s", categoryType.utf8().data(), eventName.utf8().data());
-    if (!m_eventListenerBreakpoints.contains(fullEventName))
-        return;
-
-    RefPtr<InspectorObject> eventData = InspectorObject::create();
-    eventData->setString("breakpointType", eventListenerNativeBreakpointType);
-    eventData->setString("eventName", fullEventName);
-    if (synchronous)
-        debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData.release());
-    else
-        debuggerAgent->schedulePauseOnNextStatement(NativeBreakpointDebuggerEventType, eventData.release());
-}
-
-void InspectorBrowserDebuggerAgent::setXHRBreakpoint(const String& url)
-{
-    if (url.isEmpty())
-        m_hasXHRBreakpointWithEmptyURL = true;
-    else
-        m_XHRBreakpoints.add(url);
-}
-
-void InspectorBrowserDebuggerAgent::removeXHRBreakpoint(const String& url)
-{
-    if (url.isEmpty())
-        m_hasXHRBreakpointWithEmptyURL = false;
-    else
-        m_XHRBreakpoints.remove(url);
-}
-
-void InspectorBrowserDebuggerAgent::willSendXMLHttpRequest(const String& url)
-{
-    InspectorDebuggerAgent* debuggerAgent = m_controller->m_debuggerAgent.get();
-    if (!debuggerAgent)
-        return;
-
-    String breakpointURL;
-    if (m_hasXHRBreakpointWithEmptyURL)
-        breakpointURL = "";
-    else {
-        for (HashSet<String>::iterator it = m_XHRBreakpoints.begin(); it != m_XHRBreakpoints.end(); ++it) {
-            if (url.contains(*it)) {
-                breakpointURL = *it;
-                break;
-            }
-        }
-    }
-
-    if (!breakpointURL.isNull())
-        return;
-
-    RefPtr<InspectorObject> eventData = InspectorObject::create();
-    eventData->setString("breakpointType", xhrNativeBreakpointType);
-    eventData->setString("breakpointURL", breakpointURL);
-    eventData->setString("url", url);
-    debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData.release());
-}
-
-void InspectorBrowserDebuggerAgent::clearForPageNavigation()
-{
-    m_eventListenerBreakpoints.clear();
-    m_XHRBreakpoints.clear();
-    m_hasXHRBreakpointWithEmptyURL = false;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INSPECTOR) && ENABLE(JAVASCRIPT_DEBUGGER)
diff --git a/Source/WebCore/inspector/InspectorBrowserDebuggerAgent.h b/Source/WebCore/inspector/InspectorBrowserDebuggerAgent.h
deleted file mode 100644 (file)
index d8a5b7f..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef InspectorBrowserDebuggerAgent_h
-#define InspectorBrowserDebuggerAgent_h
-
-#if ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
-
-#include "PlatformString.h"
-
-#include <wtf/HashMap.h>
-#include <wtf/HashSet.h>
-#include <wtf/PassOwnPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/text/StringHash.h>
-
-namespace WebCore {
-
-class Element;
-class InspectorController;
-class InspectorObject;
-class Node;
-
-class InspectorBrowserDebuggerAgent : public Noncopyable {
-public:
-    static PassOwnPtr<InspectorBrowserDebuggerAgent> create(InspectorController* controller)
-    {
-        return adoptPtr(new InspectorBrowserDebuggerAgent(controller));
-    }
-
-    virtual ~InspectorBrowserDebuggerAgent();
-
-    // BrowserDebugger API for InspectorFrontend
-    void setXHRBreakpoint(const String& url);
-    void removeXHRBreakpoint(const String& url);
-    void setEventListenerBreakpoint(const String& eventName);
-    void removeEventListenerBreakpoint(const String& eventName);
-    void setDOMBreakpoint(long nodeId, long type);
-    void removeDOMBreakpoint(long nodeId, long type);
-
-    // InspectorInstrumentation API
-    void willInsertDOMNode(Node*, Node* parent);
-    void didInsertDOMNode(Node*);
-    void willRemoveDOMNode(Node*);
-    void didRemoveDOMNode(Node*);
-    void willModifyDOMAttr(Element*);
-    void willSendXMLHttpRequest(const String& url);
-    void pauseOnNativeEventIfNeeded(const String& categoryType, const String& eventName, bool synchronous);
-
-    void clearForPageNavigation();
-private:
-    InspectorBrowserDebuggerAgent(InspectorController*);
-
-    void descriptionForDOMEvent(Node* target, long breakpointType, bool insertion, InspectorObject* description);
-    void updateSubtreeBreakpoints(Node*, uint32_t rootMask, bool set);
-    bool hasBreakpoint(Node*, long type);
-    void discardBindings();
-
-    InspectorController* m_controller;
-    HashMap<Node*, uint32_t> m_breakpoints;
-    HashSet<String> m_eventListenerBreakpoints;
-    HashSet<String> m_XHRBreakpoints;
-    bool m_hasXHRBreakpointWithEmptyURL;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(JAVASCRIPT_DEBUGGER) && ENABLE(INSPECTOR)
-
-#endif // !defined(InspectorBrowserDebuggerAgent_h)
index 836d63d..20da731 100644 (file)
@@ -58,7 +58,6 @@
 #include "InjectedScript.h"
 #include "InjectedScriptHost.h"
 #include "InspectorBackendDispatcher.h"
-#include "InspectorBrowserDebuggerAgent.h"
 #include "InspectorCSSAgent.h"
 #include "InspectorClient.h"
 #include "InspectorDOMAgent.h"
@@ -148,6 +147,7 @@ InspectorController::InspectorController(Page* page, InspectorClient* client)
     , m_injectedScriptHost(InjectedScriptHost::create(this))
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     , m_attachDebuggerWhenShown(false)
+    , m_hasXHRBreakpointWithEmptyURL(false)
     , m_profilerAgent(InspectorProfilerAgent::create(this))
 #endif
 {
@@ -177,7 +177,6 @@ void InspectorController::inspectedPageDestroyed()
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     m_debuggerAgent.clear();
-    m_browserDebuggerAgent.clear();
 #endif
     ASSERT(m_inspectedPage);
     m_inspectedPage = 0;
@@ -726,8 +725,6 @@ void InspectorController::didCommitLoad(DocumentLoader* loader)
 #if ENABLE(JAVASCRIPT_DEBUGGER)
         if (m_debuggerAgent) {
             m_debuggerAgent->clearForPageNavigation();
-            if (m_browserDebuggerAgent)
-                m_browserDebuggerAgent->clearForPageNavigation();
             restoreStickyBreakpoints();
         }
 #endif
@@ -1182,7 +1179,6 @@ void InspectorController::enableDebuggerFromFrontend(bool always)
     ASSERT(m_inspectedPage);
 
     m_debuggerAgent = InspectorDebuggerAgent::create(this, m_frontend.get());
-    m_browserDebuggerAgent = InspectorBrowserDebuggerAgent::create(this);
     restoreStickyBreakpoints();
 
     m_frontend->debuggerWasEnabled();
@@ -1215,7 +1211,6 @@ void InspectorController::disableDebugger(bool always)
     ASSERT(m_inspectedPage);
 
     m_debuggerAgent.clear();
-    m_browserDebuggerAgent.clear();
 
     m_attachDebuggerWhenShown = false;
 
@@ -1236,6 +1231,10 @@ void InspectorController::setStickyBreakpoints(PassRefPtr<InspectorObject> break
 
 void InspectorController::restoreStickyBreakpoints()
 {
+    m_eventListenerBreakpoints.clear();
+    m_XHRBreakpoints.clear();
+    m_hasXHRBreakpointWithEmptyURL = false;
+
     RefPtr<InspectorObject> allBreakpoints = m_state->getObject(InspectorState::stickyBreakpoints);
     KURL url = m_inspectedPage->mainFrame()->loader()->url();
     url.removeFragmentIdentifier();
@@ -1264,14 +1263,13 @@ void InspectorController::restoreStickyBreakpoint(PassRefPtr<InspectorObject> br
     if (!condition)
         return;
 
-    if (type == eventListenerBreakpointType && m_browserDebuggerAgent) {
+    if (type == eventListenerBreakpointType) {
         if (!enabled)
             return;
         String eventName;
-        if (!condition->getString("eventName", &eventName))
-            return;
-        m_browserDebuggerAgent->setEventListenerBreakpoint(eventName);
-    } else if (type == javaScriptBreakpointType && m_debuggerAgent) {
+        if (condition->getString("eventName", &eventName))
+            setEventListenerBreakpoint(eventName);
+    } else if (type == javaScriptBreakpointType) {
         String url;
         if (!condition->getString("url", &url))
             return;
@@ -1281,16 +1279,63 @@ void InspectorController::restoreStickyBreakpoint(PassRefPtr<InspectorObject> br
         String javaScriptCondition;
         if (!condition->getString("condition", &javaScriptCondition))
             return;
-        m_debuggerAgent->setStickyBreakpoint(url, static_cast<unsigned>(lineNumber), javaScriptCondition, enabled);
-    } else if (type == xhrBreakpointType && m_browserDebuggerAgent) {
+        if (m_debuggerAgent)
+            m_debuggerAgent->setStickyBreakpoint(url, static_cast<unsigned>(lineNumber), javaScriptCondition, enabled);
+    } else if (type == xhrBreakpointType) {
         if (!enabled)
             return;
         String url;
-        if (!condition->getString("url", &url))
-            return;
-        m_browserDebuggerAgent->setXHRBreakpoint(url);
+        if (condition->getString("url", &url))
+            setXHRBreakpoint(url);
+    }
+}
+
+void InspectorController::setEventListenerBreakpoint(const String& eventName)
+{
+    m_eventListenerBreakpoints.add(eventName);
+}
+
+void InspectorController::removeEventListenerBreakpoint(const String& eventName)
+{
+    m_eventListenerBreakpoints.remove(eventName);
+}
+
+bool InspectorController::hasEventListenerBreakpoint(const String& eventName)
+{
+    return m_eventListenerBreakpoints.contains(eventName);
+}
+
+void InspectorController::setXHRBreakpoint(const String& url)
+{
+    if (url.isEmpty())
+        m_hasXHRBreakpointWithEmptyURL = true;
+    else
+        m_XHRBreakpoints.add(url);
+}
+
+void InspectorController::removeXHRBreakpoint(const String& url)
+{
+    if (url.isEmpty())
+        m_hasXHRBreakpointWithEmptyURL = false;
+    else
+        m_XHRBreakpoints.remove(url);
+}
+
+bool InspectorController::hasXHRBreakpoint(const String& url, String* breakpointURL)
+{
+    if (m_hasXHRBreakpointWithEmptyURL) {
+        *breakpointURL = "";
+        return true;
     }
+    for (HashSet<String>::iterator it = m_XHRBreakpoints.begin(); it != m_XHRBreakpoints.end(); ++it) {
+        if (url.contains(*it)) {
+            *breakpointURL = *it;
+            return true;
+        }
+    }
+    return false;
 }
+
 #endif
 
 void InspectorController::dispatchOnInjectedScript(long injectedScriptId, const String& methodName, const String& arguments, RefPtr<InspectorValue>* result, bool* hadException)
index 3baf575..fef2a6d 100644 (file)
@@ -57,7 +57,6 @@ class InjectedScript;
 class InjectedScriptHost;
 class InspectorArray;
 class InspectorBackendDispatcher;
-class InspectorBrowserDebuggerAgent;
 class InspectorClient;
 class InspectorCSSAgent;
 class InspectorDOMAgent;
@@ -235,6 +234,12 @@ public:
     void resume();
 
     void setStickyBreakpoints(PassRefPtr<InspectorObject> breakpoints);
+    void setEventListenerBreakpoint(const String& eventName);
+    void removeEventListenerBreakpoint(const String& eventName);
+    bool hasEventListenerBreakpoint(const String& eventName);
+    void setXHRBreakpoint(const String& url);
+    void removeXHRBreakpoint(const String& url);
+    bool hasXHRBreakpoint(const String& url, String* breakpointURL);
 #endif
 
     void setInjectedScriptSource(const String& source);
@@ -261,7 +266,6 @@ public:
 private:
     friend class InspectorBackend;
     friend class InspectorBackendDispatcher;
-    friend class InspectorBrowserDebuggerAgent;
     friend class InspectorInstrumentation;
     friend class InjectedScriptHost;
 
@@ -368,7 +372,10 @@ private:
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     bool m_attachDebuggerWhenShown;
     OwnPtr<InspectorDebuggerAgent> m_debuggerAgent;
-    OwnPtr<InspectorBrowserDebuggerAgent> m_browserDebuggerAgent;
+
+    HashSet<String> m_eventListenerBreakpoints;
+    HashSet<String> m_XHRBreakpoints;
+    bool m_hasXHRBreakpointWithEmptyURL;
 
     OwnPtr<InspectorProfilerAgent> m_profilerAgent;
 #endif
index 19ae30d..5d8f408 100644 (file)
@@ -204,6 +204,16 @@ public:
     virtual ~MatchPlainTextJob() { }
 };
 
+enum DOMBreakpointType {
+    SubtreeModified = 0,
+    AttributeModified,
+    NodeRemoved,
+    DOMBreakpointTypesCount
+};
+
+const uint32_t inheritableDOMBreakpointTypesMask = (1 << SubtreeModified);
+const int domBreakpointDerivedTypeShift = 16;
+
 }
 
 InspectorDOMAgent::InspectorDOMAgent(InspectorFrontend* frontend)
@@ -394,6 +404,7 @@ void InspectorDOMAgent::discardBindings()
     releaseDanglingNodes();
     m_childrenRequested.clear();
     m_inspectedNodes.clear();
+    m_breakpoints.clear();
 }
 
 Node* InspectorDOMAgent::nodeForId(long id)
@@ -758,6 +769,101 @@ void InspectorDOMAgent::searchCanceled()
     m_searchResults.clear();
 }
 
+void InspectorDOMAgent::setDOMBreakpoint(long nodeId, long type)
+{
+    Node* node = nodeForId(nodeId);
+    if (!node)
+        return;
+
+    uint32_t rootBit = 1 << type;
+    m_breakpoints.set(node, m_breakpoints.get(node) | rootBit);
+    if (rootBit & inheritableDOMBreakpointTypesMask) {
+        for (Node* child = innerFirstChild(node); child; child = innerNextSibling(child))
+            updateSubtreeBreakpoints(child, rootBit, true);
+    }
+}
+
+void InspectorDOMAgent::removeDOMBreakpoint(long nodeId, long type)
+{
+    Node* node = nodeForId(nodeId);
+    if (!node)
+        return;
+
+    uint32_t rootBit = 1 << type;
+    uint32_t mask = m_breakpoints.get(node) & ~rootBit;
+    if (mask)
+        m_breakpoints.set(node, mask);
+    else
+        m_breakpoints.remove(node);
+
+    if ((rootBit & inheritableDOMBreakpointTypesMask) && !(mask & (rootBit << domBreakpointDerivedTypeShift))) {
+        for (Node* child = innerFirstChild(node); child; child = innerNextSibling(child))
+            updateSubtreeBreakpoints(child, rootBit, false);
+    }
+}
+
+bool InspectorDOMAgent::shouldBreakOnNodeInsertion(Node*, Node* parent, PassRefPtr<InspectorObject> details)
+{
+    if (hasBreakpoint(parent, SubtreeModified)) {
+        descriptionForDOMEvent(parent, SubtreeModified, true, details);
+        return true;
+    }
+    return false;
+}
+
+bool InspectorDOMAgent::shouldBreakOnNodeRemoval(Node* node, PassRefPtr<InspectorObject> details)
+{
+    if (hasBreakpoint(node, NodeRemoved)) {
+        descriptionForDOMEvent(node, NodeRemoved, false, details);
+        return true;
+    }
+    if (hasBreakpoint(innerParentNode(node), SubtreeModified)) {
+        descriptionForDOMEvent(node, SubtreeModified, false, details);
+        return true;
+    }
+    return false;
+}
+
+bool InspectorDOMAgent::shouldBreakOnAttributeModification(Element* element, PassRefPtr<InspectorObject> details)
+{
+    if (hasBreakpoint(element, AttributeModified)) {
+        descriptionForDOMEvent(element, AttributeModified, false, details);
+        return true;
+    }
+    return false;
+}
+
+void InspectorDOMAgent::descriptionForDOMEvent(Node* target, long breakpointType, bool insertion, PassRefPtr<InspectorObject> description)
+{
+    ASSERT(hasBreakpoint(target, breakpointType));
+
+    Node* breakpointOwner = target;
+    if ((1 << breakpointType) & inheritableDOMBreakpointTypesMask) {
+        // For inheritable breakpoint types, target node isn't always the same as the node that owns a breakpoint.
+        // Target node may be unknown to frontend, so we need to push it first.
+        long targetNodeId = pushNodePathToFrontend(target);
+        ASSERT(targetNodeId);
+        description->setNumber("targetNodeId", targetNodeId);
+
+        // Find breakpoint owner node.
+        if (!insertion)
+            breakpointOwner = innerParentNode(target);
+        ASSERT(breakpointOwner);
+        while (!(m_breakpoints.get(breakpointOwner) & (1 << breakpointType))) {
+            breakpointOwner = innerParentNode(breakpointOwner);
+            ASSERT(breakpointOwner);
+        }
+
+        if (breakpointType == SubtreeModified)
+            description->setBoolean("insertion", insertion);
+    }
+
+    long breakpointOwnerNodeId = m_documentNodeToIdMap.get(breakpointOwner);
+    ASSERT(breakpointOwnerNodeId);
+    description->setNumber("nodeId", breakpointOwnerNodeId);
+    description->setNumber("type", breakpointType);
+}
+
 String InspectorDOMAgent::documentURLString(Document* document) const
 {
     if (!document || document->url().isNull())
@@ -964,6 +1070,13 @@ void InspectorDOMAgent::didInsertDOMNode(Node* node)
     if (isWhitespace(node))
         return;
 
+    if (m_breakpoints.size()) {
+        uint32_t mask = m_breakpoints.get(innerParentNode(node));
+        uint32_t inheritableTypesMask = (mask | (mask >> domBreakpointDerivedTypeShift)) & inheritableDOMBreakpointTypesMask;
+        if (inheritableTypesMask)
+            updateSubtreeBreakpoints(node, inheritableTypesMask, true);
+    }
+
     // We could be attaching existing subtree. Forget the bindings.
     unbind(node, &m_documentNodeToIdMap);
 
@@ -990,6 +1103,21 @@ void InspectorDOMAgent::didRemoveDOMNode(Node* node)
     if (isWhitespace(node))
         return;
 
+    if (m_breakpoints.size()) {
+        // Remove subtree breakpoints.
+        m_breakpoints.remove(node);
+        Vector<Node*> stack(1, innerFirstChild(node));
+        do {
+            Node* node = stack.last();
+            stack.removeLast();
+            if (!node)
+                continue;
+            m_breakpoints.remove(node);
+            stack.append(innerFirstChild(node));
+            stack.append(innerNextSibling(node));
+        } while (!stack.isEmpty());
+    }
+
     ContainerNode* parent = node->parentNode();
     long parentId = m_documentNodeToIdMap.get(parent);
     // If parent is not mapped yet -> ignore the event.
@@ -1029,6 +1157,31 @@ void InspectorDOMAgent::characterDataModified(CharacterData* characterData)
     m_frontend->characterDataModified(id, characterData->data());
 }
 
+bool InspectorDOMAgent::hasBreakpoint(Node* node, long type)
+{
+    uint32_t rootBit = 1 << type;
+    uint32_t derivedBit = rootBit << domBreakpointDerivedTypeShift;
+    return m_breakpoints.get(node) & (rootBit | derivedBit);
+}
+
+void InspectorDOMAgent::updateSubtreeBreakpoints(Node* node, uint32_t rootMask, bool set)
+{
+    uint32_t oldMask = m_breakpoints.get(node);
+    uint32_t derivedMask = rootMask << domBreakpointDerivedTypeShift;
+    uint32_t newMask = set ? oldMask | derivedMask : oldMask & ~derivedMask;
+    if (newMask)
+        m_breakpoints.set(node, newMask);
+    else
+        m_breakpoints.remove(node);
+
+    uint32_t newRootMask = rootMask & ~newMask;
+    if (!newRootMask)
+        return;
+
+    for (Node* child = innerFirstChild(node); child; child = innerNextSibling(child))
+        updateSubtreeBreakpoints(child, newRootMask, set);
+}
+
 Node* InspectorDOMAgent::nodeForPath(const String& path)
 {
     // The path is of form "1,HTML,2,BODY,1,DIV"
index 9ea690c..36627f5 100644 (file)
@@ -144,14 +144,8 @@ namespace WebCore {
 
         String documentURLString(Document* document) const;
 
-        // We represent embedded doms as a part of the same hierarchy. Hence we treat children of frame owners differently.
-        // We also skip whitespace text nodes conditionally. Following methods encapsulate these specifics.
-        static Node* innerFirstChild(Node*);
-        static Node* innerNextSibling(Node*);
-        static Node* innerPreviousSibling(Node*);
-        static unsigned innerChildNodeCount(Node*);
-        static Node* innerParentNode(Node*);
-        static bool isWhitespace(Node*);
+        void setDOMBreakpoint(long nodeId, long type);
+        void removeDOMBreakpoint(long nodeId, long type);
 
     private:
         void startListeningFrameDocument(Node* frameOwnerNode);
@@ -176,6 +170,15 @@ namespace WebCore {
         PassRefPtr<InspectorArray> buildArrayForContainerChildren(Node* container, int depth, NodeToIdMap* nodesMap);
         PassRefPtr<InspectorObject> buildObjectForEventListener(const RegisteredEventListener& registeredEventListener, const AtomicString& eventType, Node* node);
 
+        // We represent embedded doms as a part of the same hierarchy. Hence we treat children of frame owners differently.
+        // We also skip whitespace text nodes conditionally. Following methods encapsulate these specifics.
+        Node* innerFirstChild(Node* node);
+        Node* innerNextSibling(Node* node);
+        Node* innerPreviousSibling(Node* node);
+        unsigned innerChildNodeCount(Node* node);
+        Node* innerParentNode(Node* node);
+        bool isWhitespace(Node* node);
+
         Document* mainFrameDocument() const;
 
         void onMatchJobsTimer(Timer<InspectorDOMAgent>*);
@@ -200,6 +203,7 @@ namespace WebCore {
         Timer<InspectorDOMAgent> m_matchJobsTimer;
         HashSet<RefPtr<Node> > m_searchResults;
         Vector<long> m_inspectedNodes;
+        HashMap<Node*, uint32_t> m_breakpoints;
     };
 
 #endif
index 1f199ec..9395dd5 100644 (file)
@@ -38,7 +38,6 @@
 #include "Event.h"
 #include "EventContext.h"
 #include "InspectorApplicationCacheAgent.h"
-#include "InspectorBrowserDebuggerAgent.h"
 #include "InspectorController.h"
 #include "InspectorDOMAgent.h"
 #include "InspectorDebuggerAgent.h"
 
 namespace WebCore {
 
+static const char* const domNativeBreakpointType = "DOM";
+static const char* const eventListenerNativeBreakpointType = "EventListener";
+static const char* const xhrNativeBreakpointType = "XHR";
+
 static const char* const listenerEventCategoryType = "listener";
 static const char* const instrumentationEventCategoryType = "instrumentation";
 
@@ -78,8 +81,17 @@ static bool eventHasListeners(const AtomicString& eventType, DOMWindow* window,
 void InspectorInstrumentation::willInsertDOMNodeImpl(InspectorController* inspectorController, Node* node, Node* parent)
 {
 #if ENABLE(JAVASCRIPT_DEBUGGER)
-    if (InspectorBrowserDebuggerAgent* browserDebuggerAgent = inspectorController->m_browserDebuggerAgent.get())
-        browserDebuggerAgent->willInsertDOMNode(node, parent);
+    InspectorDebuggerAgent* debuggerAgent = inspectorController->m_debuggerAgent.get();
+    if (!debuggerAgent)
+        return;
+    InspectorDOMAgent* domAgent = inspectorController->m_domAgent.get();
+    if (!domAgent)
+        return;
+    RefPtr<InspectorObject> eventData = InspectorObject::create();
+    if (domAgent->shouldBreakOnNodeInsertion(node, parent, eventData)) {
+        eventData->setString("breakpointType", domNativeBreakpointType);
+        debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData);
+    }
 #endif
 }
 
@@ -87,26 +99,27 @@ void InspectorInstrumentation::didInsertDOMNodeImpl(InspectorController* inspect
 {
     if (InspectorDOMAgent* domAgent = inspectorController->m_domAgent.get())
         domAgent->didInsertDOMNode(node);
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-    if (InspectorBrowserDebuggerAgent* browserDebuggerAgent = inspectorController->m_browserDebuggerAgent.get())
-        browserDebuggerAgent->didInsertDOMNode(node);
-#endif
 }
 
 void InspectorInstrumentation::willRemoveDOMNodeImpl(InspectorController* inspectorController, Node* node)
 {
 #if ENABLE(JAVASCRIPT_DEBUGGER)
-    if (InspectorBrowserDebuggerAgent* browserDebuggerAgent = inspectorController->m_browserDebuggerAgent.get())
-        browserDebuggerAgent->willRemoveDOMNode(node);
+    InspectorDebuggerAgent* debuggerAgent = inspectorController->m_debuggerAgent.get();
+    if (!debuggerAgent)
+        return;
+    InspectorDOMAgent* domAgent = inspectorController->m_domAgent.get();
+    if (!domAgent)
+        return;
+    RefPtr<InspectorObject> eventData = InspectorObject::create();
+    if (domAgent->shouldBreakOnNodeRemoval(node, eventData)) {
+        eventData->setString("breakpointType", domNativeBreakpointType);
+        debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData);
+    }
 #endif
 }
 
 void InspectorInstrumentation::didRemoveDOMNodeImpl(InspectorController* inspectorController, Node* node)
 {
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-    if (InspectorBrowserDebuggerAgent* browserDebuggerAgent = inspectorController->m_browserDebuggerAgent.get())
-        browserDebuggerAgent->didRemoveDOMNode(node);
-#endif
     if (InspectorDOMAgent* domAgent = inspectorController->m_domAgent.get())
         domAgent->didRemoveDOMNode(node);
 }
@@ -114,8 +127,17 @@ void InspectorInstrumentation::didRemoveDOMNodeImpl(InspectorController* inspect
 void InspectorInstrumentation::willModifyDOMAttrImpl(InspectorController* inspectorController, Element* element)
 {
 #if ENABLE(JAVASCRIPT_DEBUGGER)
-    if (InspectorBrowserDebuggerAgent* browserDebuggerAgent = inspectorController->m_browserDebuggerAgent.get())
-        browserDebuggerAgent->willModifyDOMAttr(element);
+    InspectorDebuggerAgent* debuggerAgent = inspectorController->m_debuggerAgent.get();
+    if (!debuggerAgent)
+        return;
+    InspectorDOMAgent* domAgent = inspectorController->m_domAgent.get();
+    if (!domAgent)
+        return;
+    RefPtr<InspectorObject> eventData = InspectorObject::create();
+    if (domAgent->shouldBreakOnAttributeModification(element, eventData)) {
+        eventData->setString("breakpointType", domNativeBreakpointType);
+        debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData);
+    }
 #endif
 }
 
@@ -134,8 +156,19 @@ void InspectorInstrumentation::characterDataModifiedImpl(InspectorController* in
 void InspectorInstrumentation::willSendXMLHttpRequestImpl(InspectorController* inspectorController, const String& url)
 {
 #if ENABLE(JAVASCRIPT_DEBUGGER)
-    if (InspectorBrowserDebuggerAgent* browserDebuggerAgent = inspectorController->m_browserDebuggerAgent.get())
-        browserDebuggerAgent->willSendXMLHttpRequest(url);
+    InspectorDebuggerAgent* debuggerAgent = inspectorController->m_debuggerAgent.get();
+    if (!debuggerAgent)
+        return;
+
+    String breakpointURL;
+    if (!inspectorController->hasXHRBreakpoint(url, &breakpointURL))
+        return;
+
+    RefPtr<InspectorObject> eventData = InspectorObject::create();
+    eventData->setString("breakpointType", xhrNativeBreakpointType);
+    eventData->setString("breakpointURL", breakpointURL);
+    eventData->setString("url", url);
+    debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData);
 #endif
 }
 
@@ -513,8 +546,19 @@ bool InspectorInstrumentation::hasFrontend(InspectorController* inspectorControl
 void InspectorInstrumentation::pauseOnNativeEventIfNeeded(InspectorController* inspectorController, const String& categoryType, const String& eventName, bool synchronous)
 {
 #if ENABLE(JAVASCRIPT_DEBUGGER)
-    if (InspectorBrowserDebuggerAgent* browserDebuggerAgent = inspectorController->m_browserDebuggerAgent.get())
-        browserDebuggerAgent->pauseOnNativeEventIfNeeded(categoryType, eventName, synchronous);
+    InspectorDebuggerAgent* debuggerAgent = inspectorController->m_debuggerAgent.get();
+    if (!debuggerAgent)
+        return;
+    String fullEventName = String::format("%s:%s", categoryType.utf8().data(), eventName.utf8().data());
+    if (!inspectorController->hasEventListenerBreakpoint(fullEventName))
+        return;
+    RefPtr<InspectorObject> eventData = InspectorObject::create();
+    eventData->setString("breakpointType", eventListenerNativeBreakpointType);
+    eventData->setString("eventName", fullEventName);
+    if (synchronous)
+        debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData);
+    else
+        debuggerAgent->schedulePauseOnNextStatement(NativeBreakpointDebuggerEventType, eventData);
 #endif
 }
 
index abf0a7b..64df9a0 100644 (file)
@@ -1,3 +1,13 @@
+2011-01-14  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r75774.
+        http://trac.webkit.org/changeset/75774
+        https://bugs.webkit.org/show_bug.cgi?id=52431
+
+        gtk builds were broken (Requested by loislo2 on #webkit).
+
+        * Scripts/webkitpy/common/checkout/scm.py:
+
 2011-01-14  David Levin  <levin@chromium.org>
 
         Reviewed by Shinichiro Hamaji.
index c871f8c..d5d29f5 100644 (file)
@@ -749,8 +749,6 @@ class Git(SCM):
         """Returns a byte array (str()) representing the patch file.
         Patch files are effectively binary since they may contain
         files of multiple different encodings."""
-        if changed_files == None:
-            changed_files = []
         return self.run(['git', 'diff', '--binary', "--no-ext-diff", "--full-index", "-M", self.merge_base(git_commit), "--"] + changed_files, decode_output=False, cwd=self.checkout_root)
 
     def _run_git_svn_find_rev(self, arg):