[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

podivilov at chromium.org podivilov at chromium.org
Wed Dec 22 13:57:14 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit f7697905f637354275f4f0ae8dbeea48caf02aa8
Author: podivilov at chromium.org <podivilov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 30 09:15:22 2010 +0000

    2010-09-29  Pavel Podivilov  <podivilov at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Web Inspector: extract Inspector Instrumentation API as a class.
            https://bugs.webkit.org/show_bug.cgi?id=46614
    
            * CMakeLists.txt:
            * GNUmakefile.am:
            * WebCore.gypi:
            * WebCore.pro:
            * WebCore.vcproj/WebCore.vcproj:
            * WebCore.xcodeproj/project.pbxproj:
            * bindings/js/JSXMLHttpRequestCustom.cpp:
            (WebCore::JSXMLHttpRequest::send):
            * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
            (WebCore::V8XMLHttpRequest::sendCallback):
            * dom/CharacterData.cpp:
            (WebCore::CharacterData::dispatchModifiedEvent):
            * dom/ContainerNode.cpp:
            (WebCore::ContainerNode::insertBefore):
            (WebCore::ContainerNode::parserInsertBefore):
            (WebCore::ContainerNode::replaceChild):
            (WebCore::ContainerNode::appendChild):
            (WebCore::ContainerNode::parserAddChild):
            (WebCore::notifyChildInserted):
            (WebCore::dispatchChildRemovalEvents):
            * dom/Element.cpp:
            (WebCore::Element::setAttribute):
            (WebCore::Element::removeAttribute):
            * inspector/InspectorController.cpp:
            (WebCore::InspectorController::InspectorController):
            (WebCore::InspectorController::~InspectorController):
            (WebCore::InspectorController::connectFrontend):
            (WebCore::InspectorController::disconnectFrontend):
            (WebCore::InspectorController::instrumentWillSendXMLHttpRequest):
            * inspector/InspectorController.h:
            * inspector/InspectorInstrumentation.cpp: Added.
            (WebCore::InspectorInstrumentation::willInsertDOMNodeImpl):
            (WebCore::InspectorInstrumentation::didInsertDOMNodeImpl):
            (WebCore::InspectorInstrumentation::willRemoveDOMNodeImpl):
            (WebCore::InspectorInstrumentation::didRemoveDOMNodeImpl):
            (WebCore::InspectorInstrumentation::willModifyDOMAttrImpl):
            (WebCore::InspectorInstrumentation::didModifyDOMAttrImpl):
            (WebCore::InspectorInstrumentation::characterDataModifiedImpl):
            (WebCore::InspectorInstrumentation::instrumentWillSendXMLHttpRequestImpl):
            * inspector/InspectorInstrumentation.h: Added.
            (WebCore::InspectorInstrumentation::frontendCreated):
            (WebCore::InspectorInstrumentation::frontendDeleted):
            (WebCore::InspectorInstrumentation::hasFrontends):
            (WebCore::InspectorInstrumentation::willInsertDOMNode):
            (WebCore::InspectorInstrumentation::didInsertDOMNode):
            (WebCore::InspectorInstrumentation::willRemoveDOMNode):
            (WebCore::InspectorInstrumentation::willModifyDOMAttr):
            (WebCore::InspectorInstrumentation::didModifyDOMAttr):
            (WebCore::InspectorInstrumentation::characterDataModified):
            (WebCore::InspectorInstrumentation::instrumentWillSendXMLHttpRequest):
            (WebCore::InspectorInstrumentation::inspectorControllerForScriptExecutionContext):
            (WebCore::InspectorInstrumentation::inspectorControllerForDocument):
            (WebCore::InspectorInstrumentation::inspectorControllerForPage):
            * workers/SharedWorker.cpp:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68767 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index 210244e..6e32ddf 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -1106,6 +1106,7 @@ SET(WebCore_SOURCES
     inspector/InspectorDebuggerAgent.cpp
     inspector/InspectorFrontendClientLocal.cpp
     inspector/InspectorFrontendHost.cpp
+    inspector/InspectorInstrumentation.cpp
     inspector/InspectorProfilerAgent.cpp
     inspector/InspectorResource.cpp
     inspector/InspectorValues.cpp
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 05da914..0669ed0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,65 @@
+2010-09-29  Pavel Podivilov  <podivilov at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: extract Inspector Instrumentation API as a class.
+        https://bugs.webkit.org/show_bug.cgi?id=46614
+
+        * CMakeLists.txt:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSXMLHttpRequestCustom.cpp:
+        (WebCore::JSXMLHttpRequest::send):
+        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+        (WebCore::V8XMLHttpRequest::sendCallback):
+        * dom/CharacterData.cpp:
+        (WebCore::CharacterData::dispatchModifiedEvent):
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::insertBefore):
+        (WebCore::ContainerNode::parserInsertBefore):
+        (WebCore::ContainerNode::replaceChild):
+        (WebCore::ContainerNode::appendChild):
+        (WebCore::ContainerNode::parserAddChild):
+        (WebCore::notifyChildInserted):
+        (WebCore::dispatchChildRemovalEvents):
+        * dom/Element.cpp:
+        (WebCore::Element::setAttribute):
+        (WebCore::Element::removeAttribute):
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::InspectorController):
+        (WebCore::InspectorController::~InspectorController):
+        (WebCore::InspectorController::connectFrontend):
+        (WebCore::InspectorController::disconnectFrontend):
+        (WebCore::InspectorController::instrumentWillSendXMLHttpRequest):
+        * inspector/InspectorController.h:
+        * inspector/InspectorInstrumentation.cpp: Added.
+        (WebCore::InspectorInstrumentation::willInsertDOMNodeImpl):
+        (WebCore::InspectorInstrumentation::didInsertDOMNodeImpl):
+        (WebCore::InspectorInstrumentation::willRemoveDOMNodeImpl):
+        (WebCore::InspectorInstrumentation::didRemoveDOMNodeImpl):
+        (WebCore::InspectorInstrumentation::willModifyDOMAttrImpl):
+        (WebCore::InspectorInstrumentation::didModifyDOMAttrImpl):
+        (WebCore::InspectorInstrumentation::characterDataModifiedImpl):
+        (WebCore::InspectorInstrumentation::instrumentWillSendXMLHttpRequestImpl):
+        * inspector/InspectorInstrumentation.h: Added.
+        (WebCore::InspectorInstrumentation::frontendCreated):
+        (WebCore::InspectorInstrumentation::frontendDeleted):
+        (WebCore::InspectorInstrumentation::hasFrontends):
+        (WebCore::InspectorInstrumentation::willInsertDOMNode):
+        (WebCore::InspectorInstrumentation::didInsertDOMNode):
+        (WebCore::InspectorInstrumentation::willRemoveDOMNode):
+        (WebCore::InspectorInstrumentation::willModifyDOMAttr):
+        (WebCore::InspectorInstrumentation::didModifyDOMAttr):
+        (WebCore::InspectorInstrumentation::characterDataModified):
+        (WebCore::InspectorInstrumentation::instrumentWillSendXMLHttpRequest):
+        (WebCore::InspectorInstrumentation::inspectorControllerForScriptExecutionContext):
+        (WebCore::InspectorInstrumentation::inspectorControllerForDocument):
+        (WebCore::InspectorInstrumentation::inspectorControllerForPage):
+        * workers/SharedWorker.cpp:
+
 2010-09-30  Kwang Yul Seo  <skyul at company100.net>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index c80e8ed..c493c23 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -1799,6 +1799,8 @@ webcore_sources += \
 	WebCore/inspector/InspectorFrontendClientLocal.h \
 	WebCore/inspector/InspectorFrontendHost.cpp \
 	WebCore/inspector/InspectorFrontendHost.h \
+	WebCore/inspector/InspectorInstrumentation.cpp \
+	WebCore/inspector/InspectorInstrumentation.h \
 	WebCore/inspector/InspectorProfilerAgent.cpp \
 	WebCore/inspector/InspectorProfilerAgent.h \
 	WebCore/inspector/InspectorResource.cpp \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 4c960d3..5bbfc9b 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -1897,6 +1897,8 @@
             'inspector/InspectorFrontendClient.h',
             'inspector/InspectorFrontendHost.cpp',
             'inspector/InspectorFrontendHost.h',
+            'inspector/InspectorInstrumentation.cpp',
+            'inspector/InspectorInstrumentation.h',
             'inspector/InspectorProfilerAgent.cpp',
             'inspector/InspectorProfilerAgent.h',
             'inspector/InspectorResource.cpp',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index e595f3b..2bbc165 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -997,6 +997,7 @@ SOURCES += \
     inspector/InspectorDOMStorageResource.cpp \
     inspector/InspectorFrontendClientLocal.cpp \
     inspector/InspectorFrontendHost.cpp \
+    inspector/InspectorInstrumentation.cpp \
     inspector/InspectorProfilerAgent.cpp \
     inspector/InspectorResource.cpp \
     inspector/InspectorStorageAgent.cpp \
@@ -1871,6 +1872,7 @@ HEADERS += \
     inspector/InspectorFrontendClient.h \
     inspector/InspectorFrontendClientLocal.h \
     inspector/InspectorFrontendHost.h \
+    inspector/InspectorInstrumentation.h \
     inspector/InspectorProfilerAgent.h \
     inspector/InspectorResource.h \
     inspector/InspectorStorageAgent.h \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index f81b77a..2c476de 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -52729,6 +52729,14 @@
 				>
 			</File>
 			<File
+				RelativePath="..\inspector\InspectorInstrumentation.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\inspector\InspectorInstrumentation.h"
+				>
+			</File>
+			<File
 				RelativePath="..\inspector\InspectorProfilerAgent.cpp"
 				>
 			</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index d104455..b2cf3b1 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -630,6 +630,8 @@
 		1CF6BE150E9BB4670025E1CD /* ObjCNodeFilterCondition.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CF6BE130E9BB4670025E1CD /* ObjCNodeFilterCondition.h */; };
 		1CFAE3230A6D6A3F0032593D /* libobjc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1CFAE3220A6D6A3F0032593D /* libobjc.dylib */; };
 		200B190911C277D900DCCD3A /* ScriptBreakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 200B190811C277D900DCCD3A /* ScriptBreakpoint.cpp */; };
+		20D629261253690B00081543 /* InspectorInstrumentation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 20D629241253690B00081543 /* InspectorInstrumentation.cpp */; };
+		20D629271253690B00081543 /* InspectorInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 20D629251253690B00081543 /* InspectorInstrumentation.h */; };
 		228C284510D82500009D0D0E /* ScriptWrappable.h in Headers */ = {isa = PBXBuildFile; fileRef = 228C284410D82500009D0D0E /* ScriptWrappable.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		24F54EAC101FE914000AE741 /* ApplicationCacheHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 24F54EAA101FE914000AE741 /* ApplicationCacheHost.cpp */; };
 		24F54EAD101FE914000AE741 /* ApplicationCacheHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 24F54EAB101FE914000AE741 /* ApplicationCacheHost.h */; settings = {ATTRIBUTES = (); }; };
@@ -6562,6 +6564,8 @@
 		1CF6BE130E9BB4670025E1CD /* ObjCNodeFilterCondition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjCNodeFilterCondition.h; sourceTree = "<group>"; };
 		1CFAE3220A6D6A3F0032593D /* libobjc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libobjc.dylib; path = /usr/lib/libobjc.dylib; sourceTree = "<absolute>"; };
 		200B190811C277D900DCCD3A /* ScriptBreakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptBreakpoint.cpp; sourceTree = "<group>"; };
+		20D629241253690B00081543 /* InspectorInstrumentation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorInstrumentation.cpp; sourceTree = "<group>"; };
+		20D629251253690B00081543 /* InspectorInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorInstrumentation.h; sourceTree = "<group>"; };
 		228C284410D82500009D0D0E /* ScriptWrappable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptWrappable.h; sourceTree = "<group>"; };
 		2442BBF81194C9D300D49469 /* HashChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashChangeEvent.h; sourceTree = "<group>"; };
 		24F54EAA101FE914000AE741 /* ApplicationCacheHost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApplicationCacheHost.cpp; sourceTree = "<group>"; };
@@ -12005,6 +12009,8 @@
 				7A0E770B10C00A8800A0276E /* InspectorFrontendHost.cpp */,
 				7A0E770C10C00A8800A0276E /* InspectorFrontendHost.h */,
 				7A0E770D10C00A8800A0276E /* InspectorFrontendHost.idl */,
+				20D629241253690B00081543 /* InspectorInstrumentation.cpp */,
+				20D629251253690B00081543 /* InspectorInstrumentation.h */,
 				9F0D6B2C121BFEBA006C0288 /* InspectorProfilerAgent.cpp */,
 				9F0D6B2D121BFEBA006C0288 /* InspectorProfilerAgent.h */,
 				41F062000F5F0B6600A07EAC /* InspectorResource.cpp */,
@@ -20798,6 +20804,7 @@
 				93F199ED08245E59001E9ABC /* XSLTProcessor.h in Headers */,
 				E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
 				97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
+				20D629271253690B00081543 /* InspectorInstrumentation.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -23311,6 +23318,7 @@
 				93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
 				E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
 				97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
+				20D629261253690B00081543 /* InspectorInstrumentation.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp b/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
index 2da3771..c47b9f3 100644
--- a/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
+++ b/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
@@ -37,6 +37,7 @@
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "HTMLDocument.h"
+#include "InspectorInstrumentation.h"
 #include "JSBlob.h"
 #include "JSDOMFormData.h"
 #include "JSDOMWindowCustom.h"
@@ -93,6 +94,8 @@ JSValue JSXMLHttpRequest::open(ExecState* exec)
 
 JSValue JSXMLHttpRequest::send(ExecState* exec)
 {
+    InspectorInstrumentation::instrumentWillSendXMLHttpRequest(impl()->scriptExecutionContext(), impl()->url());
+
     ExceptionCode ec = 0;
     if (!exec->argumentCount())
         impl()->send(ec);
diff --git a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
index 2355d2a..1add292 100644
--- a/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
@@ -32,7 +32,7 @@
 #include "V8XMLHttpRequest.h"
 
 #include "Frame.h"
-#include "InspectorController.h"
+#include "InspectorInstrumentation.h"
 #include "V8Binding.h"
 #include "V8Blob.h"
 #include "V8DOMFormData.h"
@@ -114,7 +114,7 @@ v8::Handle<v8::Value> V8XMLHttpRequest::sendCallback(const v8::Arguments& args)
     INC_STATS("DOM.XMLHttpRequest.send()");
     XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(args.Holder());
 
-    InspectorController::instrumentWillSendXMLHttpRequest(xmlHttpRequest->scriptExecutionContext(), xmlHttpRequest->url());
+    InspectorInstrumentation::instrumentWillSendXMLHttpRequest(xmlHttpRequest->scriptExecutionContext(), xmlHttpRequest->url());
 
     ExceptionCode ec = 0;
     if (args.Length() < 1)
diff --git a/WebCore/dom/CharacterData.cpp b/WebCore/dom/CharacterData.cpp
index bc9ec56..0cb2847 100644
--- a/WebCore/dom/CharacterData.cpp
+++ b/WebCore/dom/CharacterData.cpp
@@ -24,7 +24,7 @@
 
 #include "EventNames.h"
 #include "ExceptionCode.h"
-#include "InspectorController.h"
+#include "InspectorInstrumentation.h"
 #include "MutationEvent.h"
 #include "RenderText.h"
 
@@ -199,7 +199,7 @@ void CharacterData::dispatchModifiedEvent(StringImpl* prevValue)
         dispatchEvent(MutationEvent::create(eventNames().DOMCharacterDataModifiedEvent, true, 0, prevValue, m_data));
     dispatchSubtreeModifiedEvent();
 #if ENABLE(INSPECTOR)
-    InspectorController::characterDataModified(this);
+    InspectorInstrumentation::characterDataModified(document(), this);
 #endif
 }
 
diff --git a/WebCore/dom/ContainerNode.cpp b/WebCore/dom/ContainerNode.cpp
index e18f6fe..89ea7b5 100644
--- a/WebCore/dom/ContainerNode.cpp
+++ b/WebCore/dom/ContainerNode.cpp
@@ -33,7 +33,7 @@
 #include "Frame.h"
 #include "FrameView.h"
 #include "InlineTextBox.h"
-#include "InspectorController.h"
+#include "InspectorInstrumentation.h"
 #include "MutationEvent.h"
 #include "Page.h"
 #include "RenderBox.h"
@@ -155,7 +155,7 @@ bool ContainerNode::insertBefore(PassRefPtr<Node> newChild, Node* refChild, Exce
             break;
 
 #if ENABLE(INSPECTOR)
-        InspectorController::willInsertDOMNode(child, this);
+        InspectorInstrumentation::willInsertDOMNode(document(), child, this);
 #endif
 
         insertBeforeCommon(next.get(), child);
@@ -226,7 +226,7 @@ void ContainerNode::parserInsertBefore(PassRefPtr<Node> newChild, Node* nextChil
         Node* child = it->get();
 
 #if ENABLE(INSPECTOR)
-        InspectorController::willInsertDOMNode(child, this);
+        InspectorInstrumentation::willInsertDOMNode(document(), child, this);
 #endif
 
         insertBeforeCommon(next.get(), child);
@@ -303,7 +303,7 @@ bool ContainerNode::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, Exce
         ASSERT(!child->previousSibling());
 
 #if ENABLE(INSPECTOR)
-        InspectorController::willInsertDOMNode(child.get(), this);
+        InspectorInstrumentation::willInsertDOMNode(document(), child.get(), this);
 #endif
 
         // Add child after "prev".
@@ -584,7 +584,7 @@ bool ContainerNode::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec, bo
         }
 
 #if ENABLE(INSPECTOR)
-        InspectorController::willInsertDOMNode(child, this);
+        InspectorInstrumentation::willInsertDOMNode(document(), child, this);
 #endif
 
         // Append child to the end of the list
@@ -626,7 +626,7 @@ void ContainerNode::parserAddChild(PassRefPtr<Node> newChild)
     ASSERT(!newChild->parent()); // Use appendChild if you need to handle reparenting (and want DOM mutation events).
 
 #if ENABLE(INSPECTOR)
-    InspectorController::willInsertDOMNode(newChild.get(), this);
+    InspectorInstrumentation::willInsertDOMNode(document(), newChild.get(), this);
 #endif
 
     forbidEventDispatch();
@@ -1001,7 +1001,7 @@ static void notifyChildInserted(Node* child)
     ASSERT(!eventDispatchForbidden());
 
 #if ENABLE(INSPECTOR)
-    InspectorController::didInsertDOMNode(child);
+    InspectorInstrumentation::didInsertDOMNode(child->document(), child);
 #endif
 
     RefPtr<Node> c = child;
@@ -1037,7 +1037,7 @@ static void dispatchChildRemovalEvents(Node* child)
     ASSERT(!eventDispatchForbidden());
 
 #if ENABLE(INSPECTOR)
-    InspectorController::willRemoveDOMNode(child);
+    InspectorInstrumentation::willRemoveDOMNode(child->document(), child);
 #endif
 
     RefPtr<Node> c = child;
diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp
index c408790..ff030ba 100644
--- a/WebCore/dom/Element.cpp
+++ b/WebCore/dom/Element.cpp
@@ -44,7 +44,7 @@
 #include "FrameView.h"
 #include "HTMLElement.h"
 #include "HTMLNames.h"
-#include "InspectorController.h"
+#include "InspectorInstrumentation.h"
 #include "NodeList.h"
 #include "NodeRenderStyle.h"
 #include "Page.h"
@@ -558,7 +558,7 @@ void Element::setAttribute(const AtomicString& name, const AtomicString& value,
 
 #if ENABLE(INSPECTOR)
     if (!isSynchronizingStyleAttribute())
-        InspectorController::willModifyDOMAttr(this);
+        InspectorInstrumentation::willModifyDOMAttr(document(), this);
 #endif
 
     const AtomicString& localName = shouldIgnoreAttributeCase(this) ? name.lower() : name;
@@ -588,7 +588,7 @@ void Element::setAttribute(const AtomicString& name, const AtomicString& value,
 
 #if ENABLE(INSPECTOR)
     if (!isSynchronizingStyleAttribute())
-        InspectorController::didModifyDOMAttr(this);
+        InspectorInstrumentation::didModifyDOMAttr(document(), this);
 #endif
 }
 
@@ -596,7 +596,7 @@ void Element::setAttribute(const QualifiedName& name, const AtomicString& value,
 {
 #if ENABLE(INSPECTOR)
     if (!isSynchronizingStyleAttribute())
-        InspectorController::willModifyDOMAttr(this);
+        InspectorInstrumentation::willModifyDOMAttr(document(), this);
 #endif
 
     document()->incDOMTreeVersion();
@@ -621,7 +621,7 @@ void Element::setAttribute(const QualifiedName& name, const AtomicString& value,
 
 #if ENABLE(INSPECTOR)
     if (!isSynchronizingStyleAttribute())
-        InspectorController::didModifyDOMAttr(this);
+        InspectorInstrumentation::didModifyDOMAttr(document(), this);
 #endif
 }
 
@@ -1257,7 +1257,7 @@ void Element::setAttributeNS(const AtomicString& namespaceURI, const AtomicStrin
 
 void Element::removeAttribute(const String& name, ExceptionCode& ec)
 {
-    InspectorController::willModifyDOMAttr(this);
+    InspectorInstrumentation::willModifyDOMAttr(document(), this);
 
     String localName = shouldIgnoreAttributeCase(this) ? name.lower() : name;
 
@@ -1267,7 +1267,7 @@ void Element::removeAttribute(const String& name, ExceptionCode& ec)
             ec = 0;
     }
     
-    InspectorController::didModifyDOMAttr(this);
+    InspectorInstrumentation::didModifyDOMAttr(document(), this);
 }
 
 void Element::removeAttributeNS(const String& namespaceURI, const String& localName, ExceptionCode& ec)
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index f2ee2c1..5cc7744 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -66,6 +66,7 @@
 #include "InspectorDebuggerAgent.h"
 #include "InspectorFrontend.h"
 #include "InspectorFrontendClient.h"
+#include "InspectorInstrumentation.h"
 #include "InspectorProfilerAgent.h"
 #include "InspectorResource.h"
 #include "InspectorStorageAgent.h"
@@ -137,8 +138,6 @@ const char* const InspectorController::ScriptsPanel = "scripts";
 const char* const InspectorController::ProfilesPanel = "profiles";
 
 
-static int connectedFrontendCount = 0;
-
 const String& InspectorController::inspectorStartsAttachedSettingName()
 {
     DEFINE_STATIC_LOCAL(String, settingName, ("inspectorStartsAttached"));
@@ -151,8 +150,6 @@ static const float maximumAttachedHeightRatio = 0.75f;
 static const unsigned maximumConsoleMessages = 1000;
 static const unsigned expireConsoleMessagesStep = 100;
 
-unsigned InspectorController::s_inspectorControllerCount = 0;
-
 InspectorController::InspectorController(Page* page, InspectorClient* client)
     : m_inspectedPage(page)
     , m_client(client)
@@ -178,7 +175,6 @@ InspectorController::InspectorController(Page* page, InspectorClient* client)
 {
     ASSERT_ARG(page, page);
     ASSERT_ARG(client, client);
-    ++s_inspectorControllerCount;
 }
 
 InspectorController::~InspectorController()
@@ -190,9 +186,6 @@ InspectorController::~InspectorController()
 
     deleteAllValues(m_frameResources);
 
-    ASSERT(s_inspectorControllerCount);
-    --s_inspectorControllerCount;
-
     releaseFrontendLifetimeAgents();
 
     m_inspectorBackend->disconnectController();
@@ -537,9 +530,9 @@ void InspectorController::connectFrontend()
     m_applicationCacheAgent = new InspectorApplicationCacheAgent(this, m_frontend.get());
 #endif
 
-    if (!connectedFrontendCount)
+    if (!InspectorInstrumentation::hasFrontends())
         ScriptController::setCaptureCallStackForUncaughtExceptions(true);
-    connectedFrontendCount++;
+    InspectorInstrumentation::frontendCreated();
 }
 
 void InspectorController::reuseFrontend()
@@ -597,8 +590,8 @@ void InspectorController::disconnectFrontend()
         return;
     m_frontend.clear();
 
-    connectedFrontendCount--;
-    if (!connectedFrontendCount)
+    InspectorInstrumentation::frontendDeleted();
+    if (!InspectorInstrumentation::hasFrontends())
         ScriptController::setCaptureCallStackForUncaughtExceptions(false);
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
@@ -2103,64 +2096,7 @@ void InspectorController::reloadPage()
     m_inspectedPage->mainFrame()->redirectScheduler()->scheduleRefresh(true);
 }
 
-void InspectorController::willInsertDOMNodeImpl(Node* node, Node* parent)
-{
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-    if (!m_debuggerAgent || !m_domAgent)
-        return;
-    PassRefPtr<InspectorValue> eventData;
-    if (m_domAgent->shouldBreakOnNodeInsertion(node, parent, &eventData))
-        m_debuggerAgent->breakProgram(DOMBreakpointDebuggerEventType, eventData);
-#endif
-}
-
-void InspectorController::didInsertDOMNodeImpl(Node* node)
-{
-    if (m_domAgent)
-        m_domAgent->didInsertDOMNode(node);
-}
-
-void InspectorController::willRemoveDOMNodeImpl(Node* node)
-{
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-    if (!m_debuggerAgent || !m_domAgent)
-        return;
-    PassRefPtr<InspectorValue> eventData;
-    if (m_domAgent->shouldBreakOnNodeRemoval(node, &eventData))
-        m_debuggerAgent->breakProgram(DOMBreakpointDebuggerEventType, eventData);
-#endif
-}
-
-void InspectorController::didRemoveDOMNodeImpl(Node* node)
-{
-    if (m_domAgent)
-        m_domAgent->didRemoveDOMNode(node);
-}
-
-void InspectorController::willModifyDOMAttrImpl(Element* element)
-{
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-    if (!m_debuggerAgent || !m_domAgent)
-        return;
-    PassRefPtr<InspectorValue> eventData;
-    if (m_domAgent->shouldBreakOnAttributeModification(element, &eventData))
-        m_debuggerAgent->breakProgram(DOMBreakpointDebuggerEventType, eventData);
-#endif
-}
-
-void InspectorController::didModifyDOMAttrImpl(Element* element)
-{
-    if (m_domAgent)
-        m_domAgent->didModifyDOMAttr(element);
-}
-
-void InspectorController::characterDataModifiedImpl(CharacterData* characterData)
-{
-    if (m_domAgent)
-        m_domAgent->characterDataModified(characterData);
-}
-
-void InspectorController::instrumentWillSendXMLHttpRequestImpl(const KURL& url)
+void InspectorController::instrumentWillSendXMLHttpRequest(const KURL& url)
 {
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     if (m_debuggerAgent) {
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index c6f516d..5616e02 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -32,7 +32,6 @@
 #include "CharacterData.h"
 #include "Console.h"
 #include "Cookie.h"
-#include "Element.h"
 #include "Page.h"
 #include "PlatformString.h"
 #include "ScriptState.h"
@@ -51,7 +50,6 @@ class ConsoleMessage;
 class Database;
 class Document;
 class DocumentLoader;
-class Element;
 class FloatRect;
 class GraphicsContext;
 class HitTestResult;
@@ -198,15 +196,6 @@ public:
     void mainResourceFiredLoadEvent(DocumentLoader*, const KURL&);
     void mainResourceFiredDOMContentEvent(DocumentLoader*, const KURL&);
 
-    static void willInsertDOMNode(Node* node, Node* parent);
-    static void didInsertDOMNode(Node*);
-    static void willRemoveDOMNode(Node*);
-    static void willModifyDOMAttr(Element*);
-    static void didModifyDOMAttr(Element*);
-    static void characterDataModified(CharacterData*);
-
-    static void instrumentWillSendXMLHttpRequest(ScriptExecutionContext*, const KURL&);
-
 #if ENABLE(WORKERS)
     enum WorkerAction { WorkerCreated, WorkerDestroyed };
 
@@ -291,6 +280,7 @@ private:
 
     friend class InspectorBackend;
     friend class InspectorBackendDispatcher;
+    friend class InspectorInstrumentation;
     friend class InjectedScriptHost;
 
     void populateScriptObjects();
@@ -339,19 +329,7 @@ private:
 
     void didEvaluateForTestInFrontend(long callId, const String& jsonResult);
 
-    static InspectorController* inspectorControllerForScriptExecutionContext(ScriptExecutionContext* context);
-    static InspectorController* inspectorControllerForNode(Node*);
-    static InspectorController* inspectorControllerForDocument(Document* document);
-
-    void willInsertDOMNodeImpl(Node* node, Node* parent);
-    void didInsertDOMNodeImpl(Node*);
-    void willRemoveDOMNodeImpl(Node*);
-    void didRemoveDOMNodeImpl(Node*);
-    void willModifyDOMAttrImpl(Element*);
-    void didModifyDOMAttrImpl(Element*);
-    void characterDataModifiedImpl(CharacterData*);
-
-    void instrumentWillSendXMLHttpRequestImpl(const KURL&);
+    void instrumentWillSendXMLHttpRequest(const KURL&);
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     friend class InspectorDebuggerAgent;
@@ -360,8 +338,6 @@ private:
     void saveBreakpoints(PassRefPtr<InspectorObject> breakpoints);
 #endif
 
-    static unsigned s_inspectorControllerCount;
-
     Page* m_inspectedPage;
     InspectorClient* m_client;
     OwnPtr<InspectorFrontendClient> m_inspectorFrontendClient;
@@ -428,96 +404,6 @@ private:
 #endif
 };
 
-inline void InspectorController::willInsertDOMNode(Node* node, Node* parent)
-{
-#if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForNode(parent))
-        inspectorController->willInsertDOMNodeImpl(node, parent);
-#endif
-}
-
-inline void InspectorController::didInsertDOMNode(Node* node)
-{
-#if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForNode(node))
-        inspectorController->didInsertDOMNodeImpl(node);
-#endif
-}
-
-inline void InspectorController::willRemoveDOMNode(Node* node)
-{
-#if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForNode(node)) {
-        inspectorController->willRemoveDOMNodeImpl(node);
-        inspectorController->didRemoveDOMNodeImpl(node);
-    }
-#endif
-}
-
-inline void InspectorController::willModifyDOMAttr(Element* element)
-{
-#if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForNode(element))
-        inspectorController->willModifyDOMAttrImpl(element);
-#endif
-}
-
-inline void InspectorController::didModifyDOMAttr(Element* element)
-{
-#if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForNode(element))
-        inspectorController->didModifyDOMAttrImpl(element);
-#endif
-}
-
-inline void InspectorController::characterDataModified(CharacterData* characterData)
-{
-#if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForNode(characterData))
-        inspectorController->characterDataModifiedImpl(characterData);
-#endif
-}
-
-inline void InspectorController::instrumentWillSendXMLHttpRequest(ScriptExecutionContext* context, const KURL& url)
-{
-#if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForScriptExecutionContext(context))
-        inspectorController->instrumentWillSendXMLHttpRequestImpl(url);
-#endif
-}
-
-inline InspectorController* InspectorController::inspectorControllerForScriptExecutionContext(ScriptExecutionContext* context)
-{
-    if (!s_inspectorControllerCount || !context || !context->isDocument())
-        return 0;
-    return inspectorControllerForDocument(static_cast<Document*>(context));
-}
-
-inline InspectorController* InspectorController::inspectorControllerForNode(Node* node)
-{
-    if (!s_inspectorControllerCount)
-        return 0;
-    return inspectorControllerForDocument(node->document());
-}
-
-inline InspectorController* InspectorController::inspectorControllerForDocument(Document* document)
-{
-    ASSERT(document);
-    Page* page = document->page();
-    if (!page)
-        return 0;
-#if ENABLE(INSPECTOR)
-    InspectorController* inspectorController = page->inspectorController();
-    if (!inspectorController)
-        return 0;
-    if (!inspectorController->hasFrontend())
-        return 0;
-    return inspectorController;
-#else
-    return 0;
-#endif
-}
-
 } // namespace WebCore
 
 #endif // !defined(InspectorController_h)
diff --git a/WebCore/inspector/InspectorInstrumentation.cpp b/WebCore/inspector/InspectorInstrumentation.cpp
new file mode 100644
index 0000000..fbbcce4
--- /dev/null
+++ b/WebCore/inspector/InspectorInstrumentation.cpp
@@ -0,0 +1,136 @@
+/*
+* Copyright (C) 2010 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 "InspectorInstrumentation.h"
+
+#if ENABLE(INSPECTOR)
+
+#include "InspectorController.h"
+#include "InspectorDOMAgent.h"
+#include "InspectorDebuggerAgent.h"
+
+namespace WebCore {
+
+int InspectorInstrumentation::s_frontendCounter = 0;
+
+void InspectorInstrumentation::willInsertDOMNodeImpl(InspectorController* inspectorController, Node* node, Node* parent)
+{
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    if (!inspectorController->hasFrontend())
+        return;
+    InspectorDebuggerAgent* debuggerAgent = inspectorController->m_debuggerAgent.get();
+    if (!debuggerAgent)
+        return;
+    InspectorDOMAgent* domAgent = inspectorController->m_domAgent.get();
+    if (!domAgent)
+        return;
+    PassRefPtr<InspectorValue> eventData;
+    if (domAgent->shouldBreakOnNodeInsertion(node, parent, &eventData))
+        debuggerAgent->breakProgram(DOMBreakpointDebuggerEventType, eventData);
+#endif
+}
+
+void InspectorInstrumentation::didInsertDOMNodeImpl(InspectorController* inspectorController, Node* node)
+{
+    if (!inspectorController->hasFrontend())
+        return;
+    if (InspectorDOMAgent* domAgent = inspectorController->m_domAgent.get())
+        domAgent->didInsertDOMNode(node);
+}
+
+void InspectorInstrumentation::willRemoveDOMNodeImpl(InspectorController* inspectorController, Node* node)
+{
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    if (!inspectorController->hasFrontend())
+        return;
+    InspectorDebuggerAgent* debuggerAgent = inspectorController->m_debuggerAgent.get();
+    if (!debuggerAgent)
+        return;
+    InspectorDOMAgent* domAgent = inspectorController->m_domAgent.get();
+    if (!domAgent)
+        return;
+    PassRefPtr<InspectorValue> eventData;
+    if (domAgent->shouldBreakOnNodeRemoval(node, &eventData))
+        debuggerAgent->breakProgram(DOMBreakpointDebuggerEventType, eventData);
+#endif
+}
+
+void InspectorInstrumentation::didRemoveDOMNodeImpl(InspectorController* inspectorController, Node* node)
+{
+    if (!inspectorController->hasFrontend())
+        return;
+    if (InspectorDOMAgent* domAgent = inspectorController->m_domAgent.get())
+        domAgent->didRemoveDOMNode(node);
+}
+
+void InspectorInstrumentation::willModifyDOMAttrImpl(InspectorController* inspectorController, Element* element)
+{
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    if (!inspectorController->hasFrontend())
+        return;
+    InspectorDebuggerAgent* debuggerAgent = inspectorController->m_debuggerAgent.get();
+    if (!debuggerAgent)
+        return;
+    InspectorDOMAgent* domAgent = inspectorController->m_domAgent.get();
+    if (!domAgent)
+        return;
+    PassRefPtr<InspectorValue> eventData;
+    if (domAgent->shouldBreakOnAttributeModification(element, &eventData))
+        debuggerAgent->breakProgram(DOMBreakpointDebuggerEventType, eventData);
+#endif
+}
+
+void InspectorInstrumentation::didModifyDOMAttrImpl(InspectorController* inspectorController, Element* element)
+{
+    if (!inspectorController->hasFrontend())
+        return;
+    if (InspectorDOMAgent* domAgent = inspectorController->m_domAgent.get())
+        domAgent->didModifyDOMAttr(element);
+}
+
+void InspectorInstrumentation::characterDataModifiedImpl(InspectorController* inspectorController, CharacterData* characterData)
+{
+    if (!inspectorController->hasFrontend())
+        return;
+    if (InspectorDOMAgent* domAgent = inspectorController->m_domAgent.get())
+        domAgent->characterDataModified(characterData);
+}
+
+void InspectorInstrumentation::instrumentWillSendXMLHttpRequestImpl(InspectorController* inspectorController, const KURL& url)
+{
+    if (!inspectorController->hasFrontend())
+        return;
+    inspectorController->instrumentWillSendXMLHttpRequest(url);
+}
+
+} // namespace WebCore
+
+#endif // !ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InspectorInstrumentation.h b/WebCore/inspector/InspectorInstrumentation.h
new file mode 100644
index 0000000..4d804cd
--- /dev/null
+++ b/WebCore/inspector/InspectorInstrumentation.h
@@ -0,0 +1,164 @@
+/*
+* Copyright (C) 2010 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 InspectorInstrumentation_h
+#define InspectorInstrumentation_h
+
+#include "Document.h"
+#include "Page.h"
+#include "ScriptExecutionContext.h"
+
+namespace WebCore {
+
+class CharacterData;
+class Element;
+class InspectorController;
+class KURL;
+class Node;
+
+class InspectorInstrumentation {
+public:
+    static void willInsertDOMNode(Document*, Node*, Node* parent);
+    static void didInsertDOMNode(Document*, Node*);
+    static void willRemoveDOMNode(Document*, Node*);
+    static void willModifyDOMAttr(Document*, Element*);
+    static void didModifyDOMAttr(Document*, Element*);
+    static void characterDataModified(Document*, CharacterData*);
+
+    static void instrumentWillSendXMLHttpRequest(ScriptExecutionContext*, const KURL&);
+
+#if ENABLE(INSPECTOR)
+    static void frontendCreated() { s_frontendCounter += 1; }
+    static void frontendDeleted() { s_frontendCounter -= 1; }
+    static bool hasFrontends() { return s_frontendCounter; }
+#endif
+
+private:
+#if ENABLE(INSPECTOR)
+    static void willInsertDOMNodeImpl(InspectorController*, Node* node, Node* parent);
+    static void didInsertDOMNodeImpl(InspectorController*, Node*);
+    static void willRemoveDOMNodeImpl(InspectorController*, Node*);
+    static void didRemoveDOMNodeImpl(InspectorController*, Node*);
+    static void willModifyDOMAttrImpl(InspectorController*, Element*);
+    static void didModifyDOMAttrImpl(InspectorController*, Element*);
+    static void characterDataModifiedImpl(InspectorController*, CharacterData*);
+
+    static void instrumentWillSendXMLHttpRequestImpl(InspectorController*, const KURL&);
+
+    static InspectorController* inspectorControllerForScriptExecutionContext(ScriptExecutionContext*);
+    static InspectorController* inspectorControllerForDocument(Document*);
+    static InspectorController* inspectorControllerForPage(Page*);
+
+    static int s_frontendCounter;
+#endif
+};
+
+inline void InspectorInstrumentation::willInsertDOMNode(Document* document, Node* node, Node* parent)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForDocument(document))
+        willInsertDOMNodeImpl(inspectorController, node, parent);
+#endif
+}
+
+inline void InspectorInstrumentation::didInsertDOMNode(Document* document, Node* node)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForDocument(document))
+        didInsertDOMNodeImpl(inspectorController, node);
+#endif
+}
+
+inline void InspectorInstrumentation::willRemoveDOMNode(Document* document, Node* node)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForDocument(document)) {
+        willRemoveDOMNodeImpl(inspectorController, node);
+        didRemoveDOMNodeImpl(inspectorController, node);
+    }
+#endif
+}
+
+inline void InspectorInstrumentation::willModifyDOMAttr(Document* document, Element* element)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForDocument(document))
+        willModifyDOMAttrImpl(inspectorController, element);
+#endif
+}
+
+inline void InspectorInstrumentation::didModifyDOMAttr(Document* document, Element* element)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForDocument(document))
+        didModifyDOMAttrImpl(inspectorController, element);
+#endif
+}
+
+inline void InspectorInstrumentation::characterDataModified(Document* document, CharacterData* characterData)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForDocument(document))
+        characterDataModifiedImpl(inspectorController, characterData);
+#endif
+}
+
+inline void InspectorInstrumentation::instrumentWillSendXMLHttpRequest(ScriptExecutionContext* context, const KURL& url)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForScriptExecutionContext(context))
+        instrumentWillSendXMLHttpRequestImpl(inspectorController, url);
+#endif
+}
+
+#if ENABLE(INSPECTOR)
+inline InspectorController* InspectorInstrumentation::inspectorControllerForScriptExecutionContext(ScriptExecutionContext* context)
+{
+    if (hasFrontends() && context && context->isDocument())
+        return inspectorControllerForPage(static_cast<Document*>(context)->page());
+    return 0;
+}
+
+inline InspectorController* InspectorInstrumentation::inspectorControllerForDocument(Document* document)
+{
+    if (hasFrontends())
+        return inspectorControllerForPage(document->page());
+    return 0;
+}
+
+inline InspectorController* InspectorInstrumentation::inspectorControllerForPage(Page* page)
+{
+    return page ? page->inspectorController() : 0;
+}
+#endif
+
+} // namespace WebCore
+
+#endif // !defined(InspectorInstrumentation_h)
diff --git a/WebCore/workers/SharedWorker.cpp b/WebCore/workers/SharedWorker.cpp
index b25b28e..997f9cd 100644
--- a/WebCore/workers/SharedWorker.cpp
+++ b/WebCore/workers/SharedWorker.cpp
@@ -39,6 +39,7 @@
 #include "KURL.h"
 #include "MessageChannel.h"
 #include "MessagePort.h"
+#include "ScriptExecutionContext.h"
 #include "SharedWorkerRepository.h"
 
 namespace WebCore {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list