[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

pfeldman at chromium.org pfeldman at chromium.org
Sun Feb 20 23:05:50 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 88146724ee0cec23c208a23526bf90f4da2b3b4d
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 17 10:44:50 2011 +0000

    2011-01-16  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            Web Inspector: make WebCore use InspectorInstrumentation
            for instrumentation calls.
            https://bugs.webkit.org/show_bug.cgi?id=52532
    
            This change makes WebCore classes issue instrumentation signals
            by means of InspectorInstrumentation interface. It covered migration
            for Document, FrameLoader, Database, DOMStorage, etc. It fixed
            instrumentation handling for Console as well. This all is a part
            of story described in the bug 52510.
    
            * dom/Document.cpp:
            (WebCore::Document::finishedParsing):
            * dom/Document.h:
            * dom/ScriptExecutionContext.h:
            * inspector/InspectorBrowserDebuggerAgent.cpp:
            (WebCore::InspectorBrowserDebuggerAgent::InspectorBrowserDebuggerAgent):
            (WebCore::InspectorBrowserDebuggerAgent::setDOMBreakpoint):
            (WebCore::InspectorBrowserDebuggerAgent::removeDOMBreakpoint):
            (WebCore::InspectorBrowserDebuggerAgent::willInsertDOMNode):
            (WebCore::InspectorBrowserDebuggerAgent::willRemoveDOMNode):
            (WebCore::InspectorBrowserDebuggerAgent::willModifyDOMAttr):
            (WebCore::InspectorBrowserDebuggerAgent::descriptionForDOMEvent):
            (WebCore::InspectorBrowserDebuggerAgent::pauseOnNativeEventIfNeeded):
            (WebCore::InspectorBrowserDebuggerAgent::willSendXMLHttpRequest):
            * inspector/InspectorBrowserDebuggerAgent.h:
            (WebCore::InspectorBrowserDebuggerAgent::create):
            * inspector/InspectorConsoleAgent.cpp:
            (WebCore::InspectorConsoleAgent::stopTiming):
            (WebCore::InspectorConsoleAgent::count):
            * inspector/InspectorConsoleAgent.h:
            * inspector/InspectorController.cpp:
            (WebCore::InspectorController::InspectorController):
            (WebCore::InspectorController::~InspectorController):
            (WebCore::InspectorController::handleMousePress):
            (WebCore::InspectorController::didClearWindowObjectInWorld):
            (WebCore::PostWorkerNotificationToFrontendTask::performTask):
            * inspector/InspectorController.h:
            * inspector/InspectorDOMAgent.h:
            * inspector/InspectorDOMStorageAgent.h:
            * inspector/InspectorDatabaseAgent.cpp:
            * inspector/InspectorDatabaseAgent.h:
            * inspector/InspectorFrontendHost.cpp:
            * inspector/InspectorFrontendHost.h:
            * inspector/InspectorInstrumentation.cpp:
            (WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
            (WebCore::InspectorInstrumentation::inspectedPageDestroyedImpl):
            (WebCore::InspectorInstrumentation::mouseDidMoveOverElementImpl):
            (WebCore::InspectorInstrumentation::handleMousePressImpl):
            (WebCore::InspectorInstrumentation::mainResourceFiredLoadEventImpl):
            (WebCore::InspectorInstrumentation::mainResourceFiredDOMContentEventImpl):
            (WebCore::InspectorInstrumentation::frameDetachedFromParentImpl):
            (WebCore::InspectorInstrumentation::didCommitLoadImpl):
            (WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
            (WebCore::InspectorInstrumentation::consoleCountImpl):
            (WebCore::InspectorInstrumentation::startConsoleTimingImpl):
            (WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
            (WebCore::InspectorInstrumentation::consoleMarkTimelineImpl):
            (WebCore::InspectorInstrumentation::addStartProfilingMessageToConsoleImpl):
            (WebCore::InspectorInstrumentation::didOpenDatabaseImpl):
            (WebCore::InspectorInstrumentation::didUseDOMStorageImpl):
            (WebCore::InspectorInstrumentation::didCreateWorkerImpl):
            (WebCore::InspectorInstrumentation::didDestroyWorkerImpl):
            (WebCore::InspectorInstrumentation::didCreateWebSocketImpl):
            (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequestImpl):
            (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponseImpl):
            (WebCore::InspectorInstrumentation::didCloseWebSocketImpl):
            (WebCore::InspectorInstrumentation::networkStateChangedImpl):
            (WebCore::InspectorInstrumentation::updateApplicationCacheStatusImpl):
            * inspector/InspectorInstrumentation.h:
            (WebCore::InspectorInstrumentation::inspectorControllerCreated):
            (WebCore::InspectorInstrumentation::inspectorControllerDeleted):
            (WebCore::InspectorInstrumentation::didClearWindowObjectInWorld):
            (WebCore::InspectorInstrumentation::inspectedPageDestroyed):
            (WebCore::InspectorInstrumentation::willInsertDOMNode):
            (WebCore::InspectorInstrumentation::didInsertDOMNode):
            (WebCore::InspectorInstrumentation::willRemoveDOMNode):
            (WebCore::InspectorInstrumentation::willModifyDOMAttr):
            (WebCore::InspectorInstrumentation::didModifyDOMAttr):
            (WebCore::InspectorInstrumentation::mouseDidMoveOverElement):
            (WebCore::InspectorInstrumentation::handleMousePress):
            (WebCore::InspectorInstrumentation::characterDataModified):
            (WebCore::InspectorInstrumentation::willSendXMLHttpRequest):
            (WebCore::InspectorInstrumentation::didScheduleResourceRequest):
            (WebCore::InspectorInstrumentation::didInstallTimer):
            (WebCore::InspectorInstrumentation::didRemoveTimer):
            (WebCore::InspectorInstrumentation::willCallFunction):
            (WebCore::InspectorInstrumentation::willChangeXHRReadyState):
            (WebCore::InspectorInstrumentation::willDispatchEvent):
            (WebCore::InspectorInstrumentation::willDispatchEventOnWindow):
            (WebCore::InspectorInstrumentation::willEvaluateScript):
            (WebCore::InspectorInstrumentation::willFireTimer):
            (WebCore::InspectorInstrumentation::willLayout):
            (WebCore::InspectorInstrumentation::willLoadXHR):
            (WebCore::InspectorInstrumentation::willPaint):
            (WebCore::InspectorInstrumentation::willRecalculateStyle):
            (WebCore::InspectorInstrumentation::identifierForInitialRequest):
            (WebCore::InspectorInstrumentation::willSendRequest):
            (WebCore::InspectorInstrumentation::markResourceAsCached):
            (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCache):
            (WebCore::InspectorInstrumentation::willReceiveResourceData):
            (WebCore::InspectorInstrumentation::willReceiveResourceResponse):
            (WebCore::InspectorInstrumentation::didReceiveContentLength):
            (WebCore::InspectorInstrumentation::didFinishLoading):
            (WebCore::InspectorInstrumentation::didFailLoading):
            (WebCore::InspectorInstrumentation::resourceRetrievedByXMLHttpRequest):
            (WebCore::InspectorInstrumentation::scriptImported):
            (WebCore::InspectorInstrumentation::mainResourceFiredLoadEvent):
            (WebCore::InspectorInstrumentation::mainResourceFiredDOMContentEvent):
            (WebCore::InspectorInstrumentation::frameDetachedFromParent):
            (WebCore::InspectorInstrumentation::didCommitLoad):
            (WebCore::InspectorInstrumentation::willWriteHTML):
            (WebCore::InspectorInstrumentation::didOpenDatabase):
            (WebCore::InspectorInstrumentation::didUseDOMStorage):
            (WebCore::InspectorInstrumentation::didCreateWorker):
            (WebCore::InspectorInstrumentation::didDestroyWorker):
            (WebCore::InspectorInstrumentation::didCreateWebSocket):
            (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequest):
            (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponse):
            (WebCore::InspectorInstrumentation::didCloseWebSocket):
            (WebCore::InspectorInstrumentation::networkStateChanged):
            (WebCore::InspectorInstrumentation::updateApplicationCacheStatus):
            (WebCore::InspectorInstrumentation::addMessageToConsole):
            (WebCore::InspectorInstrumentation::consoleCount):
            (WebCore::InspectorInstrumentation::startConsoleTiming):
            (WebCore::InspectorInstrumentation::stopConsoleTiming):
            (WebCore::InspectorInstrumentation::consoleMarkTimeline):
            (WebCore::InspectorInstrumentation::addStartProfilingMessageToConsole):
            (WebCore::InspectorInstrumentation::inspectorControllerForContext):
            (WebCore::InspectorInstrumentation::inspectorControllerForFrame):
            (WebCore::InspectorInstrumentation::inspectorControllerForPage):
            (WebCore::InspectorInstrumentation::inspectorControllerWithFrontendForContext):
            (WebCore::InspectorInstrumentation::inspectorControllerWithFrontendForDocument):
            (WebCore::InspectorInstrumentation::inspectorControllerWithFrontendForFrame):
            (WebCore::InspectorInstrumentation::inspectorControllerWithFrontendForPage):
            * inspector/InspectorState.cpp:
            * loader/FrameLoader.cpp:
            (WebCore::FrameLoader::detachFromParent):
            (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
            (WebCore::FrameLoader::dispatchDidCommitLoad):
            * page/Chrome.cpp:
            (WebCore::Chrome::mouseDidMoveOverElement):
            * page/Console.cpp:
            (WebCore::Console::addMessage):
            (WebCore::Console::count):
            (WebCore::Console::markTimeline):
            (WebCore::Console::profile):
            (WebCore::Console::time):
            (WebCore::Console::timeEnd):
            (WebCore::Console::group):
            (WebCore::Console::groupCollapsed):
            (WebCore::Console::groupEnd):
            * page/DOMWindow.cpp:
            (WebCore::DOMWindow::sessionStorage):
            (WebCore::DOMWindow::localStorage):
            (WebCore::DOMWindow::dispatchLoadEvent):
            * page/EventHandler.cpp:
            (WebCore::EventHandler::handleMousePressEvent):
            * page/Page.cpp:
            (WebCore::Page::~Page):
            * storage/Database.cpp:
            (WebCore::Database::openDatabase):
            * workers/AbstractWorker.cpp:
            (WebCore::AbstractWorker::onDestroyWorker):
            * workers/SharedWorker.cpp:
            (WebCore::SharedWorker::create):
            * workers/Worker.cpp:
            (WebCore::Worker::create):
            * workers/WorkerMessagingProxy.cpp:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75932 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 0e52b87..b11f784 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,176 @@
+2011-01-16  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: make WebCore use InspectorInstrumentation
+        for instrumentation calls.
+        https://bugs.webkit.org/show_bug.cgi?id=52532
+
+        This change makes WebCore classes issue instrumentation signals
+        by means of InspectorInstrumentation interface. It covered migration
+        for Document, FrameLoader, Database, DOMStorage, etc. It fixed
+        instrumentation handling for Console as well. This all is a part
+        of story described in the bug 52510.
+
+        * dom/Document.cpp:
+        (WebCore::Document::finishedParsing):
+        * dom/Document.h:
+        * dom/ScriptExecutionContext.h:
+        * inspector/InspectorBrowserDebuggerAgent.cpp:
+        (WebCore::InspectorBrowserDebuggerAgent::InspectorBrowserDebuggerAgent):
+        (WebCore::InspectorBrowserDebuggerAgent::setDOMBreakpoint):
+        (WebCore::InspectorBrowserDebuggerAgent::removeDOMBreakpoint):
+        (WebCore::InspectorBrowserDebuggerAgent::willInsertDOMNode):
+        (WebCore::InspectorBrowserDebuggerAgent::willRemoveDOMNode):
+        (WebCore::InspectorBrowserDebuggerAgent::willModifyDOMAttr):
+        (WebCore::InspectorBrowserDebuggerAgent::descriptionForDOMEvent):
+        (WebCore::InspectorBrowserDebuggerAgent::pauseOnNativeEventIfNeeded):
+        (WebCore::InspectorBrowserDebuggerAgent::willSendXMLHttpRequest):
+        * inspector/InspectorBrowserDebuggerAgent.h:
+        (WebCore::InspectorBrowserDebuggerAgent::create):
+        * inspector/InspectorConsoleAgent.cpp:
+        (WebCore::InspectorConsoleAgent::stopTiming):
+        (WebCore::InspectorConsoleAgent::count):
+        * inspector/InspectorConsoleAgent.h:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::InspectorController):
+        (WebCore::InspectorController::~InspectorController):
+        (WebCore::InspectorController::handleMousePress):
+        (WebCore::InspectorController::didClearWindowObjectInWorld):
+        (WebCore::PostWorkerNotificationToFrontendTask::performTask):
+        * inspector/InspectorController.h:
+        * inspector/InspectorDOMAgent.h:
+        * inspector/InspectorDOMStorageAgent.h:
+        * inspector/InspectorDatabaseAgent.cpp:
+        * inspector/InspectorDatabaseAgent.h:
+        * inspector/InspectorFrontendHost.cpp:
+        * inspector/InspectorFrontendHost.h:
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
+        (WebCore::InspectorInstrumentation::inspectedPageDestroyedImpl):
+        (WebCore::InspectorInstrumentation::mouseDidMoveOverElementImpl):
+        (WebCore::InspectorInstrumentation::handleMousePressImpl):
+        (WebCore::InspectorInstrumentation::mainResourceFiredLoadEventImpl):
+        (WebCore::InspectorInstrumentation::mainResourceFiredDOMContentEventImpl):
+        (WebCore::InspectorInstrumentation::frameDetachedFromParentImpl):
+        (WebCore::InspectorInstrumentation::didCommitLoadImpl):
+        (WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
+        (WebCore::InspectorInstrumentation::consoleCountImpl):
+        (WebCore::InspectorInstrumentation::startConsoleTimingImpl):
+        (WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
+        (WebCore::InspectorInstrumentation::consoleMarkTimelineImpl):
+        (WebCore::InspectorInstrumentation::addStartProfilingMessageToConsoleImpl):
+        (WebCore::InspectorInstrumentation::didOpenDatabaseImpl):
+        (WebCore::InspectorInstrumentation::didUseDOMStorageImpl):
+        (WebCore::InspectorInstrumentation::didCreateWorkerImpl):
+        (WebCore::InspectorInstrumentation::didDestroyWorkerImpl):
+        (WebCore::InspectorInstrumentation::didCreateWebSocketImpl):
+        (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequestImpl):
+        (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponseImpl):
+        (WebCore::InspectorInstrumentation::didCloseWebSocketImpl):
+        (WebCore::InspectorInstrumentation::networkStateChangedImpl):
+        (WebCore::InspectorInstrumentation::updateApplicationCacheStatusImpl):
+        * inspector/InspectorInstrumentation.h:
+        (WebCore::InspectorInstrumentation::inspectorControllerCreated):
+        (WebCore::InspectorInstrumentation::inspectorControllerDeleted):
+        (WebCore::InspectorInstrumentation::didClearWindowObjectInWorld):
+        (WebCore::InspectorInstrumentation::inspectedPageDestroyed):
+        (WebCore::InspectorInstrumentation::willInsertDOMNode):
+        (WebCore::InspectorInstrumentation::didInsertDOMNode):
+        (WebCore::InspectorInstrumentation::willRemoveDOMNode):
+        (WebCore::InspectorInstrumentation::willModifyDOMAttr):
+        (WebCore::InspectorInstrumentation::didModifyDOMAttr):
+        (WebCore::InspectorInstrumentation::mouseDidMoveOverElement):
+        (WebCore::InspectorInstrumentation::handleMousePress):
+        (WebCore::InspectorInstrumentation::characterDataModified):
+        (WebCore::InspectorInstrumentation::willSendXMLHttpRequest):
+        (WebCore::InspectorInstrumentation::didScheduleResourceRequest):
+        (WebCore::InspectorInstrumentation::didInstallTimer):
+        (WebCore::InspectorInstrumentation::didRemoveTimer):
+        (WebCore::InspectorInstrumentation::willCallFunction):
+        (WebCore::InspectorInstrumentation::willChangeXHRReadyState):
+        (WebCore::InspectorInstrumentation::willDispatchEvent):
+        (WebCore::InspectorInstrumentation::willDispatchEventOnWindow):
+        (WebCore::InspectorInstrumentation::willEvaluateScript):
+        (WebCore::InspectorInstrumentation::willFireTimer):
+        (WebCore::InspectorInstrumentation::willLayout):
+        (WebCore::InspectorInstrumentation::willLoadXHR):
+        (WebCore::InspectorInstrumentation::willPaint):
+        (WebCore::InspectorInstrumentation::willRecalculateStyle):
+        (WebCore::InspectorInstrumentation::identifierForInitialRequest):
+        (WebCore::InspectorInstrumentation::willSendRequest):
+        (WebCore::InspectorInstrumentation::markResourceAsCached):
+        (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCache):
+        (WebCore::InspectorInstrumentation::willReceiveResourceData):
+        (WebCore::InspectorInstrumentation::willReceiveResourceResponse):
+        (WebCore::InspectorInstrumentation::didReceiveContentLength):
+        (WebCore::InspectorInstrumentation::didFinishLoading):
+        (WebCore::InspectorInstrumentation::didFailLoading):
+        (WebCore::InspectorInstrumentation::resourceRetrievedByXMLHttpRequest):
+        (WebCore::InspectorInstrumentation::scriptImported):
+        (WebCore::InspectorInstrumentation::mainResourceFiredLoadEvent):
+        (WebCore::InspectorInstrumentation::mainResourceFiredDOMContentEvent):
+        (WebCore::InspectorInstrumentation::frameDetachedFromParent):
+        (WebCore::InspectorInstrumentation::didCommitLoad):
+        (WebCore::InspectorInstrumentation::willWriteHTML):
+        (WebCore::InspectorInstrumentation::didOpenDatabase):
+        (WebCore::InspectorInstrumentation::didUseDOMStorage):
+        (WebCore::InspectorInstrumentation::didCreateWorker):
+        (WebCore::InspectorInstrumentation::didDestroyWorker):
+        (WebCore::InspectorInstrumentation::didCreateWebSocket):
+        (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequest):
+        (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponse):
+        (WebCore::InspectorInstrumentation::didCloseWebSocket):
+        (WebCore::InspectorInstrumentation::networkStateChanged):
+        (WebCore::InspectorInstrumentation::updateApplicationCacheStatus):
+        (WebCore::InspectorInstrumentation::addMessageToConsole):
+        (WebCore::InspectorInstrumentation::consoleCount):
+        (WebCore::InspectorInstrumentation::startConsoleTiming):
+        (WebCore::InspectorInstrumentation::stopConsoleTiming):
+        (WebCore::InspectorInstrumentation::consoleMarkTimeline):
+        (WebCore::InspectorInstrumentation::addStartProfilingMessageToConsole):
+        (WebCore::InspectorInstrumentation::inspectorControllerForContext):
+        (WebCore::InspectorInstrumentation::inspectorControllerForFrame):
+        (WebCore::InspectorInstrumentation::inspectorControllerForPage):
+        (WebCore::InspectorInstrumentation::inspectorControllerWithFrontendForContext):
+        (WebCore::InspectorInstrumentation::inspectorControllerWithFrontendForDocument):
+        (WebCore::InspectorInstrumentation::inspectorControllerWithFrontendForFrame):
+        (WebCore::InspectorInstrumentation::inspectorControllerWithFrontendForPage):
+        * inspector/InspectorState.cpp:
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::detachFromParent):
+        (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
+        (WebCore::FrameLoader::dispatchDidCommitLoad):
+        * page/Chrome.cpp:
+        (WebCore::Chrome::mouseDidMoveOverElement):
+        * page/Console.cpp:
+        (WebCore::Console::addMessage):
+        (WebCore::Console::count):
+        (WebCore::Console::markTimeline):
+        (WebCore::Console::profile):
+        (WebCore::Console::time):
+        (WebCore::Console::timeEnd):
+        (WebCore::Console::group):
+        (WebCore::Console::groupCollapsed):
+        (WebCore::Console::groupEnd):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::sessionStorage):
+        (WebCore::DOMWindow::localStorage):
+        (WebCore::DOMWindow::dispatchLoadEvent):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleMousePressEvent):
+        * page/Page.cpp:
+        (WebCore::Page::~Page):
+        * storage/Database.cpp:
+        (WebCore::Database::openDatabase):
+        * workers/AbstractWorker.cpp:
+        (WebCore::AbstractWorker::onDestroyWorker):
+        * workers/SharedWorker.cpp:
+        (WebCore::SharedWorker::create):
+        * workers/Worker.cpp:
+        (WebCore::Worker::create):
+        * workers/WorkerMessagingProxy.cpp:
+
 2011-01-17  Gyuyoung Kim  <gyuyoung.kim at samsung.com>
 
         Unreviewed, rolling out r75923.
diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp
index ed7909c..3b84716 100644
--- a/Source/WebCore/dom/Document.cpp
+++ b/Source/WebCore/dom/Document.cpp
@@ -92,7 +92,6 @@
 #include "HitTestRequest.h"
 #include "HitTestResult.h"
 #include "ImageLoader.h"
-#include "InspectorController.h"
 #include "InspectorInstrumentation.h"
 #include "KeyboardEvent.h"
 #include "Logging.h"
@@ -4258,13 +4257,7 @@ void Document::finishedParsing()
 
         f->loader()->finishedParsing();
 
-#if ENABLE(INSPECTOR)
-        if (!page())
-            return;
-
-        if (InspectorController* controller = page()->inspectorController())
-            controller->mainResourceFiredDOMContentEvent(f->loader()->documentLoader(), url());
-#endif
+        InspectorInstrumentation::mainResourceFiredDOMContentEvent(f, url());
     }
 }
 
@@ -4815,13 +4808,6 @@ bool Document::isXHTMLMPDocument() const
 }
 #endif
 
-#if ENABLE(INSPECTOR)
-InspectorController* Document::inspectorController() const
-{
-    return page() ? page()->inspectorController() : 0;
-}
-#endif
-
 #if ENABLE(FULLSCREEN_API)
 void Document::webkitRequestFullScreenForElement(Element* element, unsigned short flags)
 {
diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h
index 2863175..b38d3dd 100644
--- a/Source/WebCore/dom/Document.h
+++ b/Source/WebCore/dom/Document.h
@@ -91,7 +91,6 @@ class HTMLInputElement;
 class HTMLMapElement;
 class HitTestRequest;
 class HitTestResult;
-class InspectorController;
 class IntPoint;
 class DOMWrapperWorld;
 class JSNode;
@@ -502,9 +501,6 @@ public:
     Frame* frame() const { return m_frame; } // can be NULL
     Page* page() const; // can be NULL
     Settings* settings() const; // can be NULL
-#if ENABLE(INSPECTOR)
-    virtual InspectorController* inspectorController() const; // can be NULL
-#endif
 
     PassRefPtr<Range> createRange();
 
diff --git a/Source/WebCore/dom/ScriptExecutionContext.h b/Source/WebCore/dom/ScriptExecutionContext.h
index 12eb776..e473a4b 100644
--- a/Source/WebCore/dom/ScriptExecutionContext.h
+++ b/Source/WebCore/dom/ScriptExecutionContext.h
@@ -57,9 +57,6 @@ namespace WebCore {
 #endif
     class MessagePort;
     class SecurityOrigin;
-#if ENABLE(INSPECTOR)
-    class InspectorController;
-#endif
 
     class ScriptExecutionContext {
     public:
@@ -87,9 +84,6 @@ namespace WebCore {
         virtual String userAgent(const KURL&) const = 0;
 
         SecurityOrigin* securityOrigin() const { return m_securityOrigin.get(); }
-#if ENABLE(INSPECTOR)
-        virtual InspectorController* inspectorController() const { return 0; }
-#endif
 
         virtual void reportException(const String& errorMessage, int lineNumber, const String& sourceURL) = 0;
         virtual void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL) = 0;
diff --git a/Source/WebCore/inspector/InspectorBrowserDebuggerAgent.cpp b/Source/WebCore/inspector/InspectorBrowserDebuggerAgent.cpp
index e16f4ef..a33bacc 100644
--- a/Source/WebCore/inspector/InspectorBrowserDebuggerAgent.cpp
+++ b/Source/WebCore/inspector/InspectorBrowserDebuggerAgent.cpp
@@ -61,8 +61,8 @@ const int domBreakpointDerivedTypeShift = 16;
 
 namespace WebCore {
 
-InspectorBrowserDebuggerAgent::InspectorBrowserDebuggerAgent(InspectorController* controller)
-    : m_controller(controller)
+InspectorBrowserDebuggerAgent::InspectorBrowserDebuggerAgent(InspectorController* inspectorController)
+    : m_inspectorController(inspectorController)
     , m_hasXHRBreakpointWithEmptyURL(false)
 {
 }
@@ -116,7 +116,7 @@ void InspectorBrowserDebuggerAgent::didRemoveDOMNode(Node* node)
 
 void InspectorBrowserDebuggerAgent::setDOMBreakpoint(long nodeId, long type)
 {
-    Node* node = m_controller->m_domAgent->nodeForId(nodeId);
+    Node* node = m_inspectorController->m_domAgent->nodeForId(nodeId);
     if (!node)
         return;
 
@@ -130,7 +130,7 @@ void InspectorBrowserDebuggerAgent::setDOMBreakpoint(long nodeId, long type)
 
 void InspectorBrowserDebuggerAgent::removeDOMBreakpoint(long nodeId, long type)
 {
-    Node* node = m_controller->m_domAgent->nodeForId(nodeId);
+    Node* node = m_inspectorController->m_domAgent->nodeForId(nodeId);
     if (!node)
         return;
 
@@ -149,7 +149,7 @@ void InspectorBrowserDebuggerAgent::removeDOMBreakpoint(long nodeId, long type)
 
 void InspectorBrowserDebuggerAgent::willInsertDOMNode(Node*, Node* parent)
 {
-    InspectorDebuggerAgent* debuggerAgent = m_controller->m_debuggerAgent.get();
+    InspectorDebuggerAgent* debuggerAgent = m_inspectorController->m_debuggerAgent.get();
     if (!debuggerAgent)
         return;
 
@@ -163,7 +163,7 @@ void InspectorBrowserDebuggerAgent::willInsertDOMNode(Node*, Node* parent)
 
 void InspectorBrowserDebuggerAgent::willRemoveDOMNode(Node* node)
 {
-    InspectorDebuggerAgent* debuggerAgent = m_controller->m_debuggerAgent.get();
+    InspectorDebuggerAgent* debuggerAgent = m_inspectorController->m_debuggerAgent.get();
     if (!debuggerAgent)
         return;
 
@@ -182,7 +182,7 @@ void InspectorBrowserDebuggerAgent::willRemoveDOMNode(Node* node)
 
 void InspectorBrowserDebuggerAgent::willModifyDOMAttr(Element* element)
 {
-    InspectorDebuggerAgent* debuggerAgent = m_controller->m_debuggerAgent.get();
+    InspectorDebuggerAgent* debuggerAgent = m_inspectorController->m_debuggerAgent.get();
     if (!debuggerAgent)
         return;
 
@@ -202,7 +202,7 @@ void InspectorBrowserDebuggerAgent::descriptionForDOMEvent(Node* target, long br
     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);
+        long targetNodeId = m_inspectorController->m_domAgent->pushNodePathToFrontend(target);
         ASSERT(targetNodeId);
         description->setNumber("targetNodeId", targetNodeId);
 
@@ -219,7 +219,7 @@ void InspectorBrowserDebuggerAgent::descriptionForDOMEvent(Node* target, long br
             description->setBoolean("insertion", insertion);
     }
 
-    long breakpointOwnerNodeId = m_controller->m_domAgent->pushNodePathToFrontend(breakpointOwner);
+    long breakpointOwnerNodeId = m_inspectorController->m_domAgent->pushNodePathToFrontend(breakpointOwner);
     ASSERT(breakpointOwnerNodeId);
     description->setNumber("nodeId", breakpointOwnerNodeId);
     description->setNumber("type", breakpointType);
@@ -252,7 +252,7 @@ void InspectorBrowserDebuggerAgent::updateSubtreeBreakpoints(Node* node, uint32_
 
 void InspectorBrowserDebuggerAgent::pauseOnNativeEventIfNeeded(const String& categoryType, const String& eventName, bool synchronous)
 {
-    InspectorDebuggerAgent* debuggerAgent = m_controller->m_debuggerAgent.get();
+    InspectorDebuggerAgent* debuggerAgent = m_inspectorController->m_debuggerAgent.get();
     if (!debuggerAgent)
         return;
 
@@ -287,7 +287,7 @@ void InspectorBrowserDebuggerAgent::removeXHRBreakpoint(const String& url)
 
 void InspectorBrowserDebuggerAgent::willSendXMLHttpRequest(const String& url)
 {
-    InspectorDebuggerAgent* debuggerAgent = m_controller->m_debuggerAgent.get();
+    InspectorDebuggerAgent* debuggerAgent = m_inspectorController->m_debuggerAgent.get();
     if (!debuggerAgent)
         return;
 
diff --git a/Source/WebCore/inspector/InspectorBrowserDebuggerAgent.h b/Source/WebCore/inspector/InspectorBrowserDebuggerAgent.h
index d8a5b7f..537bda1 100644
--- a/Source/WebCore/inspector/InspectorBrowserDebuggerAgent.h
+++ b/Source/WebCore/inspector/InspectorBrowserDebuggerAgent.h
@@ -50,9 +50,9 @@ class Node;
 
 class InspectorBrowserDebuggerAgent : public Noncopyable {
 public:
-    static PassOwnPtr<InspectorBrowserDebuggerAgent> create(InspectorController* controller)
+    static PassOwnPtr<InspectorBrowserDebuggerAgent> create(InspectorController* inspectorController)
     {
-        return adoptPtr(new InspectorBrowserDebuggerAgent(controller));
+        return adoptPtr(new InspectorBrowserDebuggerAgent(inspectorController));
     }
 
     virtual ~InspectorBrowserDebuggerAgent();
@@ -83,7 +83,7 @@ private:
     bool hasBreakpoint(Node*, long type);
     void discardBindings();
 
-    InspectorController* m_controller;
+    InspectorController* m_inspectorController;
     HashMap<Node*, uint32_t> m_breakpoints;
     HashSet<String> m_eventListenerBreakpoints;
     HashSet<String> m_XHRBreakpoints;
diff --git a/Source/WebCore/inspector/InspectorConsoleAgent.cpp b/Source/WebCore/inspector/InspectorConsoleAgent.cpp
index d5ad491..a543cb2 100644
--- a/Source/WebCore/inspector/InspectorConsoleAgent.cpp
+++ b/Source/WebCore/inspector/InspectorConsoleAgent.cpp
@@ -37,6 +37,7 @@
 #include "ResourceError.h"
 #include "ResourceResponse.h"
 #include "ScriptArguments.h"
+#include "ScriptCallFrame.h"
 #include "ScriptCallStack.h"
 #include <wtf/CurrentTime.h>
 #include <wtf/OwnPtr.h>
@@ -116,7 +117,7 @@ void InspectorConsoleAgent::startTiming(const String& title)
     m_times.add(title, currentTime() * 1000);
 }
 
-void InspectorConsoleAgent::stopTiming(const String& title, unsigned lineNumber, const String& sourceName)
+void InspectorConsoleAgent::stopTiming(const String& title, PassRefPtr<ScriptCallStack> callStack)
 {
     // Follow Firebug's behavior of requiring a title that is not null or
     // undefined for timing functions
@@ -132,12 +133,19 @@ void InspectorConsoleAgent::stopTiming(const String& title, unsigned lineNumber,
 
     double elapsed = currentTime() * 1000 - startTime;
     String message = title + String::format(": %.0fms", elapsed);
-    addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message, lineNumber, sourceName);
+    const ScriptCallFrame& lastCaller = callStack->at(0);
+    addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message, lastCaller.lineNumber(), lastCaller.sourceURL());
 }
 
-void InspectorConsoleAgent::count(const String& title, unsigned lineNumber, const String& sourceID)
+void InspectorConsoleAgent::count(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> callStack)
 {
-    String identifier = makeString(title, '@', sourceID, ':', String::number(lineNumber));
+    const ScriptCallFrame& lastCaller = callStack->at(0);
+    // Follow Firebug's behavior of counting with null and undefined title in
+    // the same bucket as no argument
+    String title;
+    arguments->getFirstArgumentAsString(title);
+    String identifier = makeString(title, '@', lastCaller.sourceURL(), ':', String::number(lastCaller.lineNumber()));
+
     HashMap<String, unsigned>::iterator it = m_counts.find(identifier);
     int count;
     if (it == m_counts.end())
@@ -150,7 +158,7 @@ void InspectorConsoleAgent::count(const String& title, unsigned lineNumber, cons
     m_counts.add(identifier, count);
 
     String message = makeString(title, ": ", String::number(count));
-    addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message, lineNumber, sourceID);
+    addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message, lastCaller.lineNumber(), lastCaller.sourceURL());
 }
 
 void InspectorConsoleAgent::resourceRetrievedByXMLHttpRequest(const String& url, const String& sendURL, unsigned sendLineNumber)
diff --git a/Source/WebCore/inspector/InspectorConsoleAgent.h b/Source/WebCore/inspector/InspectorConsoleAgent.h
index b60d745..97fcb3f 100644
--- a/Source/WebCore/inspector/InspectorConsoleAgent.h
+++ b/Source/WebCore/inspector/InspectorConsoleAgent.h
@@ -60,8 +60,8 @@ public:
     void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceID);
 
     void startTiming(const String& title);
-    void stopTiming(const String& title, unsigned lineNumber, const String& sourceName);
-    void count(const String& title, unsigned lineNumber, const String& sourceID);
+    void stopTiming(const String& title, PassRefPtr<ScriptCallStack>);
+    void count(PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
 
     void resourceRetrievedByXMLHttpRequest(const String& url, const String& sendURL, unsigned sendLineNumber);
     void didReceiveResponse(unsigned long identifier, const ResourceResponse&);
diff --git a/Source/WebCore/inspector/InspectorController.cpp b/Source/WebCore/inspector/InspectorController.cpp
index 85a948d..4cf6b4b 100644
--- a/Source/WebCore/inspector/InspectorController.cpp
+++ b/Source/WebCore/inspector/InspectorController.cpp
@@ -38,6 +38,7 @@
 #include "Cookie.h"
 #include "CookieJar.h"
 #include "DOMWindow.h"
+#include "DOMWrapperWorld.h"
 #include "Document.h"
 #include "DocumentLoader.h"
 #include "Element.h"
@@ -172,6 +173,7 @@ void InspectorController::inspectedPageDestroyed()
     m_debuggerAgent.clear();
     m_browserDebuggerAgent.clear();
 #endif
+
     ASSERT(m_inspectedPage);
     m_inspectedPage = 0;
 
@@ -303,12 +305,6 @@ void InspectorController::hideHighlight()
     m_client->hideHighlight();
 }
 
-void InspectorController::markTimeline(const String& message)
-{
-    if (timelineAgent())
-        timelineAgent()->didMarkTimeline(message);
-}
-
 void InspectorController::mouseDidMoveOverElement(const HitTestResult& result, unsigned)
 {
     if (!enabled() || !searchingForNodeInPage())
@@ -321,18 +317,17 @@ void InspectorController::mouseDidMoveOverElement(const HitTestResult& result, u
         highlight(node);
 }
 
-void InspectorController::handleMousePress()
+bool InspectorController::handleMousePress()
 {
-    if (!enabled())
-        return;
-
-    ASSERT(searchingForNodeInPage());
-    if (!m_highlightedNode)
-        return;
+    if (!enabled() || !searchingForNodeInPage())
+        return false;
 
-    RefPtr<Node> node = m_highlightedNode;
-    setSearchingForNode(false);
-    inspect(node.get());
+    if (m_highlightedNode) {
+        RefPtr<Node> node = m_highlightedNode;
+        setSearchingForNode(false);
+        inspect(node.get());
+    }
+    return true;
 }
 
 void InspectorController::setInspectorFrontendClient(PassOwnPtr<InspectorFrontendClient> client)
@@ -341,8 +336,11 @@ void InspectorController::setInspectorFrontendClient(PassOwnPtr<InspectorFronten
     m_inspectorFrontendClient = client;
 }
 
-void InspectorController::inspectedWindowScriptObjectCleared(Frame* frame)
+void InspectorController::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld* world)
 {
+    if (world != mainThreadNormalWorld())
+        return;
+
     // If the page is supposed to serve as InspectorFrontend notify inspetor frontend
     // client that it's cleared so that the client can expose inspector bindings.
     if (m_inspectorFrontendClient && frame == m_inspectedPage->mainFrame())
@@ -678,15 +676,6 @@ void InspectorController::didCommitLoad(DocumentLoader* loader)
     }
 }
 
-void InspectorController::frameDetachedFromParent(Frame* rootFrame)
-{
-    if (!enabled())
-        return;
-
-    if (m_resourceAgent)
-        m_resourceAgent->frameDetachedFromParent(rootFrame);
-}
-
 void InspectorController::mainResourceFiredDOMContentEvent(DocumentLoader* loader, const KURL& url)
 {
     if (!enabled() || !isMainResourceLoader(loader, url))
@@ -787,8 +776,10 @@ private:
 
     virtual void performTask(ScriptExecutionContext* scriptContext)
     {
-        if (InspectorController* inspector = scriptContext->inspectorController())
-            inspector->postWorkerNotificationToFrontend(*m_worker, m_action);
+        if (scriptContext->isDocument()) {
+            if (InspectorController* inspector = static_cast<Document*>(scriptContext)->page()->inspectorController())
+                inspector->postWorkerNotificationToFrontend(*m_worker, m_action);
+        }
     }
 
 private:
diff --git a/Source/WebCore/inspector/InspectorController.h b/Source/WebCore/inspector/InspectorController.h
index 12ad0bf..39d7f90 100644
--- a/Source/WebCore/inspector/InspectorController.h
+++ b/Source/WebCore/inspector/InspectorController.h
@@ -46,6 +46,7 @@ namespace WebCore {
 class CachedResource;
 class CharacterData;
 class Database;
+class DOMWrapperWorld;
 class Document;
 class DocumentLoader;
 class FloatRect;
@@ -148,15 +149,14 @@ public:
 
     bool searchingForNodeInPage() const;
     void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
-    void handleMousePress();
+    bool handleMousePress();
 
     void setInspectorFrontendClient(PassOwnPtr<InspectorFrontendClient> client);
     bool hasInspectorFrontendClient() const { return m_inspectorFrontendClient; }
 
-    void inspectedWindowScriptObjectCleared(Frame*);
+    void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
 
     void didCommitLoad(DocumentLoader*);
-    void frameDetachedFromParent(Frame*);
 
     void setExtraHeaders(PassRefPtr<InspectorObject>);
 
@@ -203,8 +203,6 @@ public:
     void openInInspectedWindow(const String& url);
     void drawElementTitle(GraphicsContext&, const IntRect& boundingBox, const FloatRect& overlayRect, WebCore::Settings*) const;
 
-    void markTimeline(const String& message);
-
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     void addProfile(PassRefPtr<ScriptProfile>, unsigned lineNumber, const String& sourceURL);
     bool isRecordingUserInitiatedProfile() const;
diff --git a/Source/WebCore/inspector/InspectorDOMAgent.h b/Source/WebCore/inspector/InspectorDOMAgent.h
index 9ea690c..97175fe 100644
--- a/Source/WebCore/inspector/InspectorDOMAgent.h
+++ b/Source/WebCore/inspector/InspectorDOMAgent.h
@@ -124,7 +124,7 @@ namespace WebCore {
         bool shouldBreakOnNodeRemoval(Node* node, PassRefPtr<InspectorObject> details);
         bool shouldBreakOnAttributeModification(Element* element, PassRefPtr<InspectorObject> details);
 
-        // Methods called from the InspectorController.
+        // Methods called from the InspectorInstrumentation.
         void setDocument(Document* document);
         void releaseDanglingNodes();
 
diff --git a/Source/WebCore/inspector/InspectorDOMStorageAgent.h b/Source/WebCore/inspector/InspectorDOMStorageAgent.h
index bdfd7cb..f1d4d5c 100644
--- a/Source/WebCore/inspector/InspectorDOMStorageAgent.h
+++ b/Source/WebCore/inspector/InspectorDOMStorageAgent.h
@@ -36,7 +36,6 @@
 namespace WebCore {
 
 class InspectorArray;
-class InspectorController;
 class InspectorDOMStorageResource;
 class InspectorFrontend;
 class Storage;
diff --git a/Source/WebCore/inspector/InspectorDatabaseAgent.cpp b/Source/WebCore/inspector/InspectorDatabaseAgent.cpp
index 88db3ae..36bcab8 100644
--- a/Source/WebCore/inspector/InspectorDatabaseAgent.cpp
+++ b/Source/WebCore/inspector/InspectorDatabaseAgent.cpp
@@ -34,9 +34,9 @@
 
 #include "Database.h"
 #include "ExceptionCode.h"
-#include "InspectorFrontend.h"
 #include "InspectorController.h"
 #include "InspectorDatabaseResource.h"
+#include "InspectorFrontend.h"
 #include "InspectorValues.h"
 #include "SQLError.h"
 #include "SQLStatementCallback.h"
diff --git a/Source/WebCore/inspector/InspectorDatabaseAgent.h b/Source/WebCore/inspector/InspectorDatabaseAgent.h
index c73d3c8..a9e9a5d 100644
--- a/Source/WebCore/inspector/InspectorDatabaseAgent.h
+++ b/Source/WebCore/inspector/InspectorDatabaseAgent.h
@@ -37,7 +37,6 @@ namespace WebCore {
 
 class Database;
 class InspectorArray;
-class InspectorController;
 class InspectorDatabaseResource;
 class InspectorFrontend;
 
diff --git a/Source/WebCore/inspector/InspectorFrontendHost.cpp b/Source/WebCore/inspector/InspectorFrontendHost.cpp
index 4b7e13f..342af0f 100644
--- a/Source/WebCore/inspector/InspectorFrontendHost.cpp
+++ b/Source/WebCore/inspector/InspectorFrontendHost.cpp
@@ -41,6 +41,7 @@
 #include "FrameLoader.h"
 #include "HitTestResult.h"
 #include "HTMLFrameOwnerElement.h"
+#include "InspectorController.h"
 #include "InspectorFrontendClient.h"
 #include "Page.h"
 #include "Pasteboard.h"
diff --git a/Source/WebCore/inspector/InspectorFrontendHost.h b/Source/WebCore/inspector/InspectorFrontendHost.h
index d333893..03c55a9 100644
--- a/Source/WebCore/inspector/InspectorFrontendHost.h
+++ b/Source/WebCore/inspector/InspectorFrontendHost.h
@@ -32,7 +32,6 @@
 #include "Console.h"
 #include "ContextMenu.h"
 #include "ContextMenuProvider.h"
-#include "InspectorController.h"
 #include "PlatformString.h"
 
 #include <wtf/RefCounted.h>
@@ -46,6 +45,7 @@ class FrontendMenuProvider;
 class InspectorClient;
 class InspectorFrontendClient;
 class Node;
+class Page;
 
 class InspectorFrontendHost : public RefCounted<InspectorFrontendHost>
 {
diff --git a/Source/WebCore/inspector/InspectorInstrumentation.cpp b/Source/WebCore/inspector/InspectorInstrumentation.cpp
index 67fa77e..aa941df 100644
--- a/Source/WebCore/inspector/InspectorInstrumentation.cpp
+++ b/Source/WebCore/inspector/InspectorInstrumentation.cpp
@@ -34,6 +34,7 @@
 #if ENABLE(INSPECTOR)
 
 #include "DOMWindow.h"
+#include "Database.h"
 #include "DocumentLoader.h"
 #include "Event.h"
 #include "EventContext.h"
@@ -79,6 +80,16 @@ static bool eventHasListeners(const AtomicString& eventType, DOMWindow* window,
     return false;
 }
 
+void InspectorInstrumentation::didClearWindowObjectInWorldImpl(InspectorController* inspectorController, Frame* frame, DOMWrapperWorld* world)
+{
+    inspectorController->didClearWindowObjectInWorld(frame, world);
+}
+
+void InspectorInstrumentation::inspectedPageDestroyedImpl(InspectorController* inspectorController)
+{
+    inspectorController->inspectedPageDestroyed();
+}
+
 void InspectorInstrumentation::willInsertDOMNodeImpl(InspectorController* inspectorController, Node* node, Node* parent)
 {
 #if ENABLE(JAVASCRIPT_DEBUGGER)
@@ -129,6 +140,16 @@ void InspectorInstrumentation::didModifyDOMAttrImpl(InspectorController* inspect
         domAgent->didModifyDOMAttr(element);
 }
 
+void InspectorInstrumentation::mouseDidMoveOverElementImpl(InspectorController* inspectorController, const HitTestResult& result, unsigned modifierFlags)
+{
+    inspectorController->mouseDidMoveOverElement(result, modifierFlags);
+}
+
+bool InspectorInstrumentation::handleMousePressImpl(InspectorController* inspectorController)
+{
+    return inspectorController->handleMousePress();
+}
+
 void InspectorInstrumentation::characterDataModifiedImpl(InspectorController* inspectorController, CharacterData* characterData)
 {
     if (InspectorDOMAgent* domAgent = inspectorController->m_domAgent.get())
@@ -163,7 +184,6 @@ void InspectorInstrumentation::didRemoveTimerImpl(InspectorController* inspector
         timelineAgent->didRemoveTimer(timerId);
 }
 
-
 InspectorInstrumentationCookie InspectorInstrumentation::willCallFunctionImpl(InspectorController* inspectorController, const String& scriptName, int scriptLine)
 {
     int timelineAgentId = 0;
@@ -454,6 +474,27 @@ void InspectorInstrumentation::scriptImportedImpl(InspectorController* ic, unsig
         resourceAgent->setInitialContent(identifier, sourceString, "Script");
 }
 
+void InspectorInstrumentation::mainResourceFiredLoadEventImpl(InspectorController* inspectorController, Frame* frame, const KURL& url)
+{
+    inspectorController->mainResourceFiredLoadEvent(frame->loader()->documentLoader(), url);
+}
+
+void InspectorInstrumentation::mainResourceFiredDOMContentEventImpl(InspectorController* inspectorController, Frame* frame, const KURL& url)
+{
+    inspectorController->mainResourceFiredDOMContentEvent(frame->loader()->documentLoader(), url);
+}
+
+void InspectorInstrumentation::frameDetachedFromParentImpl(InspectorController* inspectorController, Frame* frame)
+{
+    if (InspectorResourceAgent* resourceAgent = retrieveResourceAgent(inspectorController))
+        resourceAgent->frameDetachedFromParent(frame);
+}
+
+void InspectorInstrumentation::didCommitLoadImpl(InspectorController* inspectorController, DocumentLoader* loader)
+{
+    inspectorController->didCommitLoad(loader);
+}
+
 InspectorInstrumentationCookie InspectorInstrumentation::willWriteHTMLImpl(InspectorController* inspectorController, unsigned int length, unsigned int startLine)
 {
     int timelineAgentId = 0;
@@ -471,82 +512,107 @@ void InspectorInstrumentation::didWriteHTMLImpl(const InspectorInstrumentationCo
         timelineAgent->didWriteHTML(endLine);
 }
 
-#if ENABLE(WEB_SOCKETS)
-void InspectorInstrumentation::didCreateWebSocketImpl(InspectorController* inspectorController, unsigned long identifier, const KURL& requestURL, const KURL& documentURL)
+void InspectorInstrumentation::addMessageToConsoleImpl(InspectorController* inspectorController, MessageSource source, MessageType type, MessageLevel level, const String& message, ScriptArguments* arguments, ScriptCallStack* callStack)
 {
-    inspectorController->didCreateWebSocket(identifier, requestURL, documentURL);
+    inspectorController->consoleAgent()->addMessageToConsole(source, type, level, message, arguments, callStack);
 }
 
-void InspectorInstrumentation::willSendWebSocketHandshakeRequestImpl(InspectorController* inspectorController, unsigned long identifier, const WebSocketHandshakeRequest& request)
+void InspectorInstrumentation::addMessageToConsoleImpl(InspectorController* inspectorController, MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID)
 {
-    inspectorController->willSendWebSocketHandshakeRequest(identifier, request);
+    inspectorController->consoleAgent()->addMessageToConsole(source, type, level, message, lineNumber, sourceID);
 }
 
-void InspectorInstrumentation::didReceiveWebSocketHandshakeResponseImpl(InspectorController* inspectorController, unsigned long identifier, const WebSocketHandshakeResponse& response)
+void InspectorInstrumentation::consoleCountImpl(InspectorController* inspectorController, ScriptArguments* arguments, ScriptCallStack* stack)
 {
-    inspectorController->didReceiveWebSocketHandshakeResponse(identifier, response);
+    inspectorController->consoleAgent()->count(arguments, stack);
 }
 
-void InspectorInstrumentation::didCloseWebSocketImpl(InspectorController* inspectorController, unsigned long identifier)
+void InspectorInstrumentation::startConsoleTimingImpl(InspectorController* inspectorController, const String& title)
 {
-    inspectorController->didCloseWebSocket(identifier);
+    inspectorController->consoleAgent()->startTiming(title);
+}
+
+void InspectorInstrumentation::stopConsoleTimingImpl(InspectorController* inspectorController, const String& title, ScriptCallStack* stack)
+{
+    inspectorController->consoleAgent()->stopTiming(title, stack);
+}
+
+void InspectorInstrumentation::consoleMarkTimelineImpl(InspectorController* inspectorController, ScriptArguments* arguments)
+{
+    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController)) {
+        String message;
+        arguments->getFirstArgumentAsString(message);
+        timelineAgent->didMarkTimeline(message);
+    }
+}
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+void InspectorInstrumentation::addStartProfilingMessageToConsoleImpl(InspectorController* inspectorController, const String& title, unsigned lineNumber, const String& sourceURL)
+{
+    if (InspectorProfilerAgent* profilerAgent = inspectorController->m_profilerAgent.get())
+        profilerAgent->addStartProfilingMessageToConsole(title, lineNumber, sourceURL);
 }
 #endif
 
-#if ENABLE(OFFLINE_WEB_APPLICATIONS)
-void InspectorInstrumentation::networkStateChangedImpl(InspectorController* ic)
+#if ENABLE(DATABASE)
+void InspectorInstrumentation::didOpenDatabaseImpl(InspectorController* inspectorController, Database* database, const String& domain, const String& name, const String& version)
 {
-    if (InspectorApplicationCacheAgent* applicationCacheAgent = ic->applicationCacheAgent())
-        applicationCacheAgent->networkStateChanged();
+    inspectorController->didOpenDatabase(database, domain, name, version);
 }
+#endif
 
-void InspectorInstrumentation::updateApplicationCacheStatusImpl(InspectorController* ic, Frame* frame)
+#if ENABLE(DOM_STORAGE)
+void InspectorInstrumentation::didUseDOMStorageImpl(InspectorController* inspectorController, StorageArea* storageArea, bool isLocalStorage, Frame* frame)
 {
-    if (InspectorApplicationCacheAgent* applicationCacheAgent = ic->applicationCacheAgent())
-        applicationCacheAgent->updateApplicationCacheStatus(frame);
+    inspectorController->didUseDOMStorage(storageArea, isLocalStorage, frame);
 }
 #endif
 
-void InspectorInstrumentation::addMessageToConsole(Page* page, MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> callStack)
+#if ENABLE(WORKERS)
+void InspectorInstrumentation::didCreateWorkerImpl(InspectorController* inspectorController, intptr_t id, const String& url, bool isSharedWorker)
 {
-    if (!page)
-        return;
-    page->inspectorController()->consoleAgent()->addMessageToConsole(source, type, level, message, arguments, callStack);
+    inspectorController->didCreateWorker(id, url, isSharedWorker);
 }
 
-void InspectorInstrumentation::addMessageToConsole(Page* page, MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID)
+void InspectorInstrumentation::didDestroyWorkerImpl(InspectorController* inspectorController, intptr_t id)
 {
-    if (!page)
-        return;
-    page->inspectorController()->consoleAgent()->addMessageToConsole(source, type, level, message, lineNumber, sourceID);
+    inspectorController->didDestroyWorker(id);
 }
+#endif
 
-void InspectorInstrumentation::count(Page* page, const String& title, unsigned lineNumber, const String& sourceID)
+#if ENABLE(WEB_SOCKETS)
+void InspectorInstrumentation::didCreateWebSocketImpl(InspectorController* inspectorController, unsigned long identifier, const KURL& requestURL, const KURL& documentURL)
 {
-    if (!page)
-        return;
-    page->inspectorController()->consoleAgent()->count(title, lineNumber, sourceID);
+    inspectorController->didCreateWebSocket(identifier, requestURL, documentURL);
 }
 
-void InspectorInstrumentation::startTiming(Page* page, const String& title)
+void InspectorInstrumentation::willSendWebSocketHandshakeRequestImpl(InspectorController* inspectorController, unsigned long identifier, const WebSocketHandshakeRequest& request)
 {
-    if (!page)
-        return;
-    page->inspectorController()->consoleAgent()->startTiming(title);
+    inspectorController->willSendWebSocketHandshakeRequest(identifier, request);
 }
 
-void InspectorInstrumentation::stopTiming(Page* page, const String& title, unsigned lineNumber, const String& sourceName)
+void InspectorInstrumentation::didReceiveWebSocketHandshakeResponseImpl(InspectorController* inspectorController, unsigned long identifier, const WebSocketHandshakeResponse& response)
 {
-    if (!page)
-        return;
-    page->inspectorController()->consoleAgent()->stopTiming(title, lineNumber, sourceName);
+    inspectorController->didReceiveWebSocketHandshakeResponse(identifier, response);
 }
 
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-void InspectorInstrumentation::addStartProfilingMessageToConsole(InspectorController* ic, const String& title, unsigned lineNumber, const String& sourceURL)
+void InspectorInstrumentation::didCloseWebSocketImpl(InspectorController* inspectorController, unsigned long identifier)
 {
-    if (InspectorProfilerAgent* profilerAgent = ic->m_profilerAgent.get())
-        profilerAgent->addStartProfilingMessageToConsole(title, lineNumber, sourceURL);
+    inspectorController->didCloseWebSocket(identifier);
+}
+#endif
+
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+void InspectorInstrumentation::networkStateChangedImpl(InspectorController* ic)
+{
+    if (InspectorApplicationCacheAgent* applicationCacheAgent = ic->applicationCacheAgent())
+        applicationCacheAgent->networkStateChanged();
+}
+
+void InspectorInstrumentation::updateApplicationCacheStatusImpl(InspectorController* ic, Frame* frame)
+{
+    if (InspectorApplicationCacheAgent* applicationCacheAgent = ic->applicationCacheAgent())
+        applicationCacheAgent->updateApplicationCacheStatus(frame);
 }
 #endif
 
diff --git a/Source/WebCore/inspector/InspectorInstrumentation.h b/Source/WebCore/inspector/InspectorInstrumentation.h
index 7f744f4..d4bbe49 100644
--- a/Source/WebCore/inspector/InspectorInstrumentation.h
+++ b/Source/WebCore/inspector/InspectorInstrumentation.h
@@ -31,17 +31,23 @@
 #ifndef InspectorInstrumentation_h
 #define InspectorInstrumentation_h
 
+#include "Console.h"
 #include "Frame.h"
 #include "Page.h"
 #include "ScriptExecutionContext.h"
 
+#include <wtf/PassRefPtr.h>
+
 namespace WebCore {
 
 class CharacterData;
+class DOMWrapperWorld;
+class Database;
 class Document;
 class Element;
 class EventContext;
 class DocumentLoader;
+class HitTestResult;
 class InspectorController;
 class InspectorResourceAgent;
 class InspectorTimelineAgent;
@@ -52,6 +58,7 @@ class ResourceResponse;
 class ScriptArguments;
 class ScriptCallStack;
 class ScriptExecutionContext;
+class StorageArea;
 class XMLHttpRequest;
 
 #if ENABLE(WEB_SOCKETS)
@@ -63,6 +70,9 @@ typedef pair<InspectorController*, int> InspectorInstrumentationCookie;
 
 class InspectorInstrumentation {
 public:
+    static void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
+    static void inspectedPageDestroyed(Page*);
+
     static void willInsertDOMNode(Document*, Node*, Node* parent);
     static void didInsertDOMNode(Document*, Node*);
     static void willRemoveDOMNode(Document*, Node*);
@@ -70,6 +80,9 @@ public:
     static void didModifyDOMAttr(Document*, Element*);
     static void characterDataModified(Document*, CharacterData*);
 
+    static void mouseDidMoveOverElement(Page*, const HitTestResult&, unsigned modifierFlags);
+    static bool handleMousePress(Page*);
+
     static void willSendXMLHttpRequest(ScriptExecutionContext*, const String& url);
     static void didScheduleResourceRequest(Document*, const String& url);
     static void didInstallTimer(ScriptExecutionContext*, int timerId, int timeout, bool singleShot);
@@ -109,27 +122,48 @@ public:
     static void didFailLoading(Frame*, unsigned long identifier, const ResourceError&);
     static void resourceRetrievedByXMLHttpRequest(ScriptExecutionContext*, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber);
     static void scriptImported(ScriptExecutionContext*, unsigned long identifier, const String& sourceString);
+    static void mainResourceFiredLoadEvent(Frame*, const KURL&);
+    static void mainResourceFiredDOMContentEvent(Frame*, const KURL&);
+    static void frameDetachedFromParent(Frame*);
+    static void didCommitLoad(Frame*, DocumentLoader*);
+
     static InspectorInstrumentationCookie willWriteHTML(Document*, unsigned int length, unsigned int startLine);
     static void didWriteHTML(const InspectorInstrumentationCookie&, unsigned int endLine);
 
+    static void addMessageToConsole(Page*, MessageSource, MessageType, MessageLevel, const String& message, ScriptArguments*, ScriptCallStack*);
+    static void addMessageToConsole(Page*, MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String&);
+    static void consoleCount(Page*, ScriptArguments*, ScriptCallStack*);
+    static void startConsoleTiming(Page*, const String& title);
+    static void stopConsoleTiming(Page*, const String& title, ScriptCallStack*);
+    static void consoleMarkTimeline(Page*, ScriptArguments*);
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    static void addStartProfilingMessageToConsole(Page*, const String& title, unsigned lineNumber, const String& sourceURL);
+#endif
+
+#if ENABLE(DATABASE)
+    static void didOpenDatabase(ScriptExecutionContext*, Database*, const String& domain, const String& name, const String& version);
+#endif
+
+#if ENABLE(DOM_STORAGE)
+    static void didUseDOMStorage(Page*, StorageArea*, bool isLocalStorage, Frame*);
+#endif
+
+#if ENABLE(WORKERS)
+    static void didCreateWorker(ScriptExecutionContext*, intptr_t id, const String& url, bool isSharedWorker);
+    static void didDestroyWorker(ScriptExecutionContext*, intptr_t id);
+#endif
+
 #if ENABLE(WEB_SOCKETS)
     static void didCreateWebSocket(ScriptExecutionContext*, unsigned long identifier, const KURL& requestURL, const KURL& documentURL);
     static void willSendWebSocketHandshakeRequest(ScriptExecutionContext*, unsigned long identifier, const WebSocketHandshakeRequest&);
     static void didReceiveWebSocketHandshakeResponse(ScriptExecutionContext*, unsigned long identifier, const WebSocketHandshakeResponse&);
     static void didCloseWebSocket(ScriptExecutionContext*, unsigned long identifier);
 #endif
+
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
     static void networkStateChanged(Page*);
     static void updateApplicationCacheStatus(Frame*);
-
-    static void addMessageToConsole(Page*, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
-    static void addMessageToConsole(Page*, MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String&);
-
-    static void count(Page*, const String& title, unsigned lineNumber, const String& sourceID);
-    static void startTiming(Page*, const String& title);
-    static void stopTiming(Page*, const String& title, unsigned lineNumber, const String& sourceName);
-
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-    static void addStartProfilingMessageToConsole(InspectorController*, const String& title, unsigned lineNumber, const String& sourceURL);
 #endif
 
 #if ENABLE(INSPECTOR)
@@ -142,6 +176,9 @@ public:
 
 private:
 #if ENABLE(INSPECTOR)
+    static void didClearWindowObjectInWorldImpl(InspectorController*, Frame*, DOMWrapperWorld*);
+    static void inspectedPageDestroyedImpl(InspectorController*);
+
     static void willInsertDOMNodeImpl(InspectorController*, Node* node, Node* parent);
     static void didInsertDOMNodeImpl(InspectorController*, Node*);
     static void willRemoveDOMNodeImpl(InspectorController*, Node*);
@@ -150,6 +187,9 @@ private:
     static void didModifyDOMAttrImpl(InspectorController*, Element*);
     static void characterDataModifiedImpl(InspectorController*, CharacterData*);
 
+    static void mouseDidMoveOverElementImpl(InspectorController*, const HitTestResult&, unsigned modifierFlags);
+    static bool handleMousePressImpl(InspectorController*);
+
     static void willSendXMLHttpRequestImpl(InspectorController*, const String& url);
     static void didScheduleResourceRequestImpl(InspectorController*, const String& url);
     static void didInstallTimerImpl(InspectorController*, int timerId, int timeout, bool singleShot);
@@ -188,9 +228,38 @@ private:
     static void didFailLoadingImpl(InspectorController*, unsigned long identifier, const ResourceError&);
     static void resourceRetrievedByXMLHttpRequestImpl(InspectorController*, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber);
     static void scriptImportedImpl(InspectorController*, unsigned long identifier, const String& sourceString);
+    static void mainResourceFiredLoadEventImpl(InspectorController*, Frame*, const KURL&);
+    static void mainResourceFiredDOMContentEventImpl(InspectorController*, Frame*, const KURL&);
+    static void frameDetachedFromParentImpl(InspectorController*, Frame*);
+    static void didCommitLoadImpl(InspectorController*, DocumentLoader*);
+
     static InspectorInstrumentationCookie willWriteHTMLImpl(InspectorController*, unsigned int length, unsigned int startLine);
     static void didWriteHTMLImpl(const InspectorInstrumentationCookie&, unsigned int endLine);
 
+    static void addMessageToConsoleImpl(InspectorController*, MessageSource, MessageType, MessageLevel, const String& message, ScriptArguments*, ScriptCallStack*);
+    static void addMessageToConsoleImpl(InspectorController*, MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceID);
+    static void consoleCountImpl(InspectorController*, ScriptArguments*, ScriptCallStack*);
+    static void startConsoleTimingImpl(InspectorController*, const String& title);
+    static void stopConsoleTimingImpl(InspectorController*, const String& title, ScriptCallStack*);
+    static void consoleMarkTimelineImpl(InspectorController*, ScriptArguments*);
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    static void addStartProfilingMessageToConsoleImpl(InspectorController*, const String& title, unsigned lineNumber, const String& sourceURL);
+#endif
+
+#if ENABLE(DATABASE)
+    static void didOpenDatabaseImpl(InspectorController*, Database*, const String& domain, const String& name, const String& version);
+#endif
+
+#if ENABLE(DOM_STORAGE)
+    static void didUseDOMStorageImpl(InspectorController*, StorageArea*, bool isLocalStorage, Frame*);
+#endif
+
+#if ENABLE(WORKERS)
+    static void didCreateWorkerImpl(InspectorController*, intptr_t id, const String& url, bool isSharedWorker);
+    static void didDestroyWorkerImpl(InspectorController*, intptr_t id);
+#endif
+
 #if ENABLE(WEB_SOCKETS)
     static void didCreateWebSocketImpl(InspectorController*, unsigned long identifier, const KURL& requestURL, const KURL& documentURL);
     static void willSendWebSocketHandshakeRequestImpl(InspectorController*, unsigned long identifier, const WebSocketHandshakeRequest&);
@@ -203,10 +272,13 @@ private:
     static void updateApplicationCacheStatusImpl(InspectorController*, Frame*);
 #endif
 
-    static InspectorController* inspectorControllerForContext(ScriptExecutionContext*);
-    static InspectorController* inspectorControllerForDocument(Document*);
     static InspectorController* inspectorControllerForFrame(Frame*);
+    static InspectorController* inspectorControllerForContext(ScriptExecutionContext*);
     static InspectorController* inspectorControllerForPage(Page*);
+    static InspectorController* inspectorControllerWithFrontendForContext(ScriptExecutionContext*);
+    static InspectorController* inspectorControllerWithFrontendForDocument(Document*);
+    static InspectorController* inspectorControllerWithFrontendForFrame(Frame*);
+    static InspectorController* inspectorControllerWithFrontendForPage(Page*);
 
     static bool hasFrontend(InspectorController*);
     static void pauseOnNativeEventIfNeeded(InspectorController*, const String& categoryType, const String& eventName, bool synchronous);
@@ -219,10 +291,26 @@ private:
 #endif
 };
 
+inline void InspectorInstrumentation::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld* world)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
+        didClearWindowObjectInWorldImpl(inspectorController, frame, world);
+#endif
+}
+
+inline void InspectorInstrumentation::inspectedPageDestroyed(Page* page)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForPage(page))
+        inspectedPageDestroyedImpl(inspectorController);
+#endif
+}
+
 inline void InspectorInstrumentation::willInsertDOMNode(Document* document, Node* node, Node* parent)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForDocument(document))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForDocument(document))
         willInsertDOMNodeImpl(inspectorController, node, parent);
 #endif
 }
@@ -230,7 +318,7 @@ inline void InspectorInstrumentation::willInsertDOMNode(Document* document, Node
 inline void InspectorInstrumentation::didInsertDOMNode(Document* document, Node* node)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForDocument(document))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForDocument(document))
         didInsertDOMNodeImpl(inspectorController, node);
 #endif
 }
@@ -238,7 +326,7 @@ inline void InspectorInstrumentation::didInsertDOMNode(Document* document, Node*
 inline void InspectorInstrumentation::willRemoveDOMNode(Document* document, Node* node)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForDocument(document)) {
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForDocument(document)) {
         willRemoveDOMNodeImpl(inspectorController, node);
         didRemoveDOMNodeImpl(inspectorController, node);
     }
@@ -248,7 +336,7 @@ inline void InspectorInstrumentation::willRemoveDOMNode(Document* document, Node
 inline void InspectorInstrumentation::willModifyDOMAttr(Document* document, Element* element)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForDocument(document))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForDocument(document))
         willModifyDOMAttrImpl(inspectorController, element);
 #endif
 }
@@ -256,15 +344,32 @@ inline void InspectorInstrumentation::willModifyDOMAttr(Document* document, Elem
 inline void InspectorInstrumentation::didModifyDOMAttr(Document* document, Element* element)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForDocument(document))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForDocument(document))
         didModifyDOMAttrImpl(inspectorController, element);
 #endif
 }
 
+inline void InspectorInstrumentation::mouseDidMoveOverElement(Page* page, const HitTestResult& result, unsigned modifierFlags)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForPage(page))
+        mouseDidMoveOverElementImpl(inspectorController, result, modifierFlags);
+#endif
+}
+
+inline bool InspectorInstrumentation::handleMousePress(Page* page)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForPage(page))
+        return handleMousePressImpl(inspectorController);
+#endif
+    return false;
+}
+
 inline void InspectorInstrumentation::characterDataModified(Document* document, CharacterData* characterData)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForDocument(document))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForDocument(document))
         characterDataModifiedImpl(inspectorController, characterData);
 #endif
 }
@@ -272,7 +377,7 @@ inline void InspectorInstrumentation::characterDataModified(Document* document,
 inline void InspectorInstrumentation::willSendXMLHttpRequest(ScriptExecutionContext* context, const String& url)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForContext(context))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForContext(context))
         willSendXMLHttpRequestImpl(inspectorController, url);
 #endif
 }
@@ -280,7 +385,7 @@ inline void InspectorInstrumentation::willSendXMLHttpRequest(ScriptExecutionCont
 inline void InspectorInstrumentation::didScheduleResourceRequest(Document* document, const String& url)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForDocument(document))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForDocument(document))
         didScheduleResourceRequestImpl(inspectorController, url);
 #endif
 }
@@ -288,7 +393,7 @@ inline void InspectorInstrumentation::didScheduleResourceRequest(Document* docum
 inline void InspectorInstrumentation::didInstallTimer(ScriptExecutionContext* context, int timerId, int timeout, bool singleShot)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForContext(context))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForContext(context))
         didInstallTimerImpl(inspectorController, timerId, timeout, singleShot);
 #endif
 }
@@ -296,7 +401,7 @@ inline void InspectorInstrumentation::didInstallTimer(ScriptExecutionContext* co
 inline void InspectorInstrumentation::didRemoveTimer(ScriptExecutionContext* context, int timerId)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForContext(context))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForContext(context))
         didRemoveTimerImpl(inspectorController, timerId);
 #endif
 }
@@ -305,7 +410,7 @@ inline void InspectorInstrumentation::didRemoveTimer(ScriptExecutionContext* con
 inline InspectorInstrumentationCookie InspectorInstrumentation::willCallFunction(Frame* frame, const String& scriptName, int scriptLine)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForFrame(frame))
         return willCallFunctionImpl(inspectorController, scriptName, scriptLine);
 #endif
     return InspectorInstrumentationCookie();
@@ -322,7 +427,7 @@ inline void InspectorInstrumentation::didCallFunction(const InspectorInstrumenta
 inline InspectorInstrumentationCookie InspectorInstrumentation::willChangeXHRReadyState(ScriptExecutionContext* context, XMLHttpRequest* request)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForContext(context))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForContext(context))
         return willChangeXHRReadyStateImpl(inspectorController, request);
 #endif
     return InspectorInstrumentationCookie();
@@ -339,7 +444,7 @@ inline void InspectorInstrumentation::didChangeXHRReadyState(const InspectorInst
 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEvent(Document* document, const Event& event, DOMWindow* window, Node* node, const Vector<EventContext>& ancestors)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForDocument(document))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForDocument(document))
         return willDispatchEventImpl(inspectorController, event, window, node, ancestors);
 #endif
     return InspectorInstrumentationCookie();
@@ -356,7 +461,7 @@ inline void InspectorInstrumentation::didDispatchEvent(const InspectorInstrument
 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEventOnWindow(Frame* frame, const Event& event, DOMWindow* window)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForFrame(frame))
         return willDispatchEventOnWindowImpl(inspectorController, event, window);
 #endif
     return InspectorInstrumentationCookie();
@@ -373,7 +478,7 @@ inline void InspectorInstrumentation::didDispatchEventOnWindow(const InspectorIn
 inline InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScript(Frame* frame, const String& url, int lineNumber)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForFrame(frame))
         return willEvaluateScriptImpl(inspectorController, url, lineNumber);
 #endif
     return InspectorInstrumentationCookie();
@@ -390,7 +495,7 @@ inline void InspectorInstrumentation::didEvaluateScript(const InspectorInstrumen
 inline InspectorInstrumentationCookie InspectorInstrumentation::willFireTimer(ScriptExecutionContext* context, int timerId)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForContext(context))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForContext(context))
         return willFireTimerImpl(inspectorController, timerId);
 #endif
     return InspectorInstrumentationCookie();
@@ -407,7 +512,7 @@ inline void InspectorInstrumentation::didFireTimer(const InspectorInstrumentatio
 inline InspectorInstrumentationCookie InspectorInstrumentation::willLayout(Frame* frame)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForFrame(frame))
         return willLayoutImpl(inspectorController);
 #endif
     return InspectorInstrumentationCookie();
@@ -424,7 +529,7 @@ inline void InspectorInstrumentation::didLayout(const InspectorInstrumentationCo
 inline InspectorInstrumentationCookie InspectorInstrumentation::willLoadXHR(ScriptExecutionContext* context, XMLHttpRequest* request)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForContext(context))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForContext(context))
         return willLoadXHRImpl(inspectorController, request);
 #endif
     return InspectorInstrumentationCookie();
@@ -441,7 +546,7 @@ inline void InspectorInstrumentation::didLoadXHR(const InspectorInstrumentationC
 inline InspectorInstrumentationCookie InspectorInstrumentation::willPaint(Frame* frame, const IntRect& rect)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForFrame(frame))
         return willPaintImpl(inspectorController, rect);
 #endif
     return InspectorInstrumentationCookie();
@@ -458,7 +563,7 @@ inline void InspectorInstrumentation::didPaint(const InspectorInstrumentationCoo
 inline InspectorInstrumentationCookie InspectorInstrumentation::willRecalculateStyle(Document* document)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForDocument(document))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForDocument(document))
         return willRecalculateStyleImpl(inspectorController);
 #endif
     return InspectorInstrumentationCookie();
@@ -478,7 +583,7 @@ inline void InspectorInstrumentation::identifierForInitialRequest(Frame* frame,
     // This notification should be procecessed even in cases there is no frontend.
     if (!frame)
         return;
-    if (InspectorController* ic = frame->page()->inspectorController())
+    if (InspectorController* ic = inspectorControllerForPage(frame->page()))
         identifierForInitialRequestImpl(ic, identifier, loader, request);
 #endif
 }
@@ -486,7 +591,7 @@ inline void InspectorInstrumentation::identifierForInitialRequest(Frame* frame,
 inline void InspectorInstrumentation::willSendRequest(Frame* frame, unsigned long identifier, ResourceRequest& request, const ResourceResponse& redirectResponse)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* ic = inspectorControllerForFrame(frame))
+    if (InspectorController* ic = inspectorControllerWithFrontendForFrame(frame))
         willSendRequestImpl(ic, identifier, request, redirectResponse);
 #endif
 }
@@ -494,21 +599,21 @@ inline void InspectorInstrumentation::willSendRequest(Frame* frame, unsigned lon
 inline void InspectorInstrumentation::markResourceAsCached(Page* page, unsigned long identifier)
 {
 #if ENABLE(INSPECTOR)
-    markResourceAsCachedImpl(page->inspectorController(), identifier); 
+    markResourceAsCachedImpl(inspectorControllerForPage(page), identifier); 
 #endif
 }
 
 inline void InspectorInstrumentation::didLoadResourceFromMemoryCache(Page* page, DocumentLoader* loader, const CachedResource* resource)
 {
 #if ENABLE(INSPECTOR)
-    didLoadResourceFromMemoryCacheImpl(page->inspectorController(), loader, resource);
+    didLoadResourceFromMemoryCacheImpl(inspectorControllerForPage(page), loader, resource);
 #endif
 }
 
 inline InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceData(Frame* frame, unsigned long identifier)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForFrame(frame))
         return willReceiveResourceDataImpl(inspectorController, identifier);
 #endif
     return InspectorInstrumentationCookie();
@@ -525,7 +630,7 @@ inline void InspectorInstrumentation::didReceiveResourceData(const InspectorInst
 inline InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceResponse(Frame* frame, unsigned long identifier, const ResourceResponse& response)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForFrame(frame))
         return willReceiveResourceResponseImpl(inspectorController, identifier, response);
 #endif
     return InspectorInstrumentationCookie();
@@ -542,7 +647,7 @@ inline void InspectorInstrumentation::didReceiveResourceResponse(const Inspector
 inline void InspectorInstrumentation::didReceiveContentLength(Frame* frame, unsigned long identifier, int lengthReceived)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForFrame(frame))
         didReceiveContentLengthImpl(inspectorController, identifier, lengthReceived);
 #endif
 }
@@ -550,7 +655,7 @@ inline void InspectorInstrumentation::didReceiveContentLength(Frame* frame, unsi
 inline void InspectorInstrumentation::didFinishLoading(Frame* frame, unsigned long identifier, double finishTime)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForFrame(frame))
         didFinishLoadingImpl(inspectorController, identifier, finishTime);
 #endif
 }
@@ -558,7 +663,7 @@ inline void InspectorInstrumentation::didFinishLoading(Frame* frame, unsigned lo
 inline void InspectorInstrumentation::didFailLoading(Frame* frame, unsigned long identifier, const ResourceError& error)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForFrame(frame))
         didFailLoadingImpl(inspectorController, identifier, error);
 #endif
 }
@@ -566,7 +671,7 @@ inline void InspectorInstrumentation::didFailLoading(Frame* frame, unsigned long
 inline void InspectorInstrumentation::resourceRetrievedByXMLHttpRequest(ScriptExecutionContext* context, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = context->inspectorController())
+    if (InspectorController* inspectorController = inspectorControllerForContext(context))
         resourceRetrievedByXMLHttpRequestImpl(inspectorController, identifier, sourceString, url, sendURL, sendLineNumber);
 #endif
 }
@@ -574,15 +679,47 @@ inline void InspectorInstrumentation::resourceRetrievedByXMLHttpRequest(ScriptEx
 inline void InspectorInstrumentation::scriptImported(ScriptExecutionContext* context, unsigned long identifier, const String& sourceString)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = context->inspectorController())
+    if (InspectorController* inspectorController = inspectorControllerForContext(context))
         scriptImportedImpl(inspectorController, identifier, sourceString);
 #endif
 }
 
+inline void InspectorInstrumentation::mainResourceFiredLoadEvent(Frame* frame, const KURL& url)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForFrame(frame))
+        mainResourceFiredLoadEventImpl(inspectorController, frame, url);
+#endif
+}
+
+inline void InspectorInstrumentation::mainResourceFiredDOMContentEvent(Frame* frame, const KURL& url)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForFrame(frame))
+        mainResourceFiredDOMContentEventImpl(inspectorController, frame, url);
+#endif
+}
+
+inline void InspectorInstrumentation::frameDetachedFromParent(Frame* frame)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForFrame(frame))
+        frameDetachedFromParentImpl(inspectorController, frame);
+#endif
+}
+
+inline void InspectorInstrumentation::didCommitLoad(Frame* frame, DocumentLoader* loader)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
+        didCommitLoadImpl(inspectorController, loader);
+#endif
+}
+
 inline InspectorInstrumentationCookie InspectorInstrumentation::willWriteHTML(Document* document, unsigned int length, unsigned int startLine)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForDocument(document))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForDocument(document))
         return willWriteHTMLImpl(inspectorController, length, startLine);
 #endif
     return InspectorInstrumentationCookie();
@@ -596,11 +733,50 @@ inline void InspectorInstrumentation::didWriteHTML(const InspectorInstrumentatio
 #endif
 }
 
+#if ENABLE(DATABASE)
+inline void InspectorInstrumentation::didOpenDatabase(ScriptExecutionContext* context, Database* database, const String& domain, const String& name, const String& version)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForContext(context))
+        didOpenDatabaseImpl(inspectorController, database, domain, name, version);
+#endif
+}
+#endif
+
+#if ENABLE(DOM_STORAGE)
+inline void InspectorInstrumentation::didUseDOMStorage(Page* page, StorageArea* storageArea, bool isLocalStorage, Frame* frame)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForPage(page))
+        didUseDOMStorageImpl(inspectorController, storageArea, isLocalStorage, frame);
+#endif
+}
+#endif
+
+#if ENABLE(WORKERS)
+inline void InspectorInstrumentation::didCreateWorker(ScriptExecutionContext* context, intptr_t id, const String& url, bool isSharedWorker)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForContext(context))
+        didCreateWorkerImpl(inspectorController, id, url, isSharedWorker);
+#endif
+}
+
+inline void InspectorInstrumentation::didDestroyWorker(ScriptExecutionContext* context, intptr_t id)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForContext(context))
+        didDestroyWorkerImpl(inspectorController, id);
+#endif
+}
+#endif
+
+
 #if ENABLE(WEB_SOCKETS)
 inline void InspectorInstrumentation::didCreateWebSocket(ScriptExecutionContext* context, unsigned long identifier, const KURL& requestURL, const KURL& documentURL)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForContext(context))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForContext(context))
         didCreateWebSocketImpl(inspectorController, identifier, requestURL, documentURL);
 #endif
 }
@@ -608,7 +784,7 @@ inline void InspectorInstrumentation::didCreateWebSocket(ScriptExecutionContext*
 inline void InspectorInstrumentation::willSendWebSocketHandshakeRequest(ScriptExecutionContext* context, unsigned long identifier, const WebSocketHandshakeRequest& request)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForContext(context))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForContext(context))
         willSendWebSocketHandshakeRequestImpl(inspectorController, identifier, request);
 #endif
 }
@@ -616,7 +792,7 @@ inline void InspectorInstrumentation::willSendWebSocketHandshakeRequest(ScriptEx
 inline void InspectorInstrumentation::didReceiveWebSocketHandshakeResponse(ScriptExecutionContext* context, unsigned long identifier, const WebSocketHandshakeResponse& response)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForContext(context))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForContext(context))
         didReceiveWebSocketHandshakeResponseImpl(inspectorController, identifier, response);
 #endif
 }
@@ -624,54 +800,135 @@ inline void InspectorInstrumentation::didReceiveWebSocketHandshakeResponse(Scrip
 inline void InspectorInstrumentation::didCloseWebSocket(ScriptExecutionContext* context, unsigned long identifier)
 {
 #if ENABLE(INSPECTOR)
-    if (InspectorController* inspectorController = inspectorControllerForContext(context))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForContext(context))
         didCloseWebSocketImpl(inspectorController, identifier);
 #endif
 }
 #endif
 
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
 inline void InspectorInstrumentation::networkStateChanged(Page* page)
 {
 #if ENABLE(INSPECTOR) && ENABLE(OFFLINE_WEB_APPLICATIONS)
-    if (InspectorController* inspectorController = inspectorControllerForPage(page))
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForPage(page))
         networkStateChangedImpl(inspectorController);
 #endif
 }
 
 inline void InspectorInstrumentation::updateApplicationCacheStatus(Frame* frame)
 {
-#if ENABLE(INSPECTOR) && ENABLE(OFFLINE_WEB_APPLICATIONS)
-    if (InspectorController* inspectorController = inspectorControllerForFrame(frame))
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForFrame(frame))
         updateApplicationCacheStatusImpl(inspectorController, frame);
 #endif
 }
+#endif
+
+inline void InspectorInstrumentation::addMessageToConsole(Page* page, MessageSource source, MessageType type, MessageLevel level, const String& message, ScriptArguments* arguments, ScriptCallStack* callStack)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForPage(page))
+        addMessageToConsoleImpl(inspectorController, source, type, level, message, arguments, callStack);
+#endif
+}
+
+inline void InspectorInstrumentation::addMessageToConsole(Page* page, MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForPage(page))
+        addMessageToConsoleImpl(inspectorController, source, type, level, message, lineNumber, sourceID);
+#endif
+}
+
+inline void InspectorInstrumentation::consoleCount(Page* page, ScriptArguments* arguments, ScriptCallStack* stack)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForPage(page))
+        consoleCountImpl(inspectorController, arguments, stack);
+#endif
+}
+
+inline void InspectorInstrumentation::startConsoleTiming(Page* page, const String& title)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForPage(page))
+        startConsoleTimingImpl(inspectorController, title);
+#endif
+}
+
+inline void InspectorInstrumentation::stopConsoleTiming(Page* page, const String& title, ScriptCallStack* stack)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForPage(page))
+        stopConsoleTimingImpl(inspectorController, title, stack);
+#endif
+}
+
+inline void InspectorInstrumentation::consoleMarkTimeline(Page* page, ScriptArguments* arguments)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerWithFrontendForPage(page))
+        consoleMarkTimelineImpl(inspectorController, arguments);
+#endif
+}
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+inline void InspectorInstrumentation::addStartProfilingMessageToConsole(Page* page, const String& title, unsigned lineNumber, const String& sourceURL)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForPage(page))
+        addStartProfilingMessageToConsoleImpl(inspectorController, title, lineNumber, sourceURL);
+#endif
+}
+#endif
 
 #if ENABLE(INSPECTOR)
 inline InspectorController* InspectorInstrumentation::inspectorControllerForContext(ScriptExecutionContext* context)
 {
-    if (hasFrontends() && context && context->isDocument())
+    if (context && context->isDocument())
         return inspectorControllerForPage(static_cast<Document*>(context)->page());
     return 0;
 }
 
-inline InspectorController* InspectorInstrumentation::inspectorControllerForDocument(Document* document)
+inline InspectorController* InspectorInstrumentation::inspectorControllerForFrame(Frame* frame)
+{
+    if (frame)
+        return inspectorControllerForPage(frame->page());
+    return 0;
+}
+
+inline InspectorController* InspectorInstrumentation::inspectorControllerForPage(Page* page)
+{
+    if (!page)
+        return 0;
+    return page->inspectorController();
+}
+
+inline InspectorController* InspectorInstrumentation::inspectorControllerWithFrontendForContext(ScriptExecutionContext* context)
+{
+    if (hasFrontends() && context && context->isDocument())
+        return inspectorControllerWithFrontendForPage(static_cast<Document*>(context)->page());
+    return 0;
+}
+
+inline InspectorController* InspectorInstrumentation::inspectorControllerWithFrontendForDocument(Document* document)
 {
     if (hasFrontends() && document)
-        return inspectorControllerForPage(document->page());
+        return inspectorControllerWithFrontendForPage(document->page());
     return 0;
 }
 
-inline InspectorController* InspectorInstrumentation::inspectorControllerForFrame(Frame* frame)
+inline InspectorController* InspectorInstrumentation::inspectorControllerWithFrontendForFrame(Frame* frame)
 {
     if (hasFrontends() && frame)
-        return inspectorControllerForPage(frame->page());
+        return inspectorControllerWithFrontendForPage(frame->page());
     return 0;
 }
 
-inline InspectorController* InspectorInstrumentation::inspectorControllerForPage(Page* page)
+inline InspectorController* InspectorInstrumentation::inspectorControllerWithFrontendForPage(Page* page)
 {
     if (page) {
-        if (InspectorController* inspectorController = page->inspectorController()) {
+        if (InspectorController* inspectorController = inspectorControllerForPage(page)) {
             if (hasFrontend(inspectorController))
                 return inspectorController;
         }
diff --git a/Source/WebCore/inspector/InspectorState.cpp b/Source/WebCore/inspector/InspectorState.cpp
index 7a9a4ad..1b74518 100644
--- a/Source/WebCore/inspector/InspectorState.cpp
+++ b/Source/WebCore/inspector/InspectorState.cpp
@@ -32,7 +32,6 @@
 #if ENABLE(INSPECTOR)
 
 #include "InspectorClient.h"
-#include "InspectorController.h"
 
 namespace WebCore {
 
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp
index 82fcf7e..3caad8d 100644
--- a/Source/WebCore/loader/FrameLoader.cpp
+++ b/Source/WebCore/loader/FrameLoader.cpp
@@ -2580,10 +2580,7 @@ void FrameLoader::detachFromParent()
     // handlers might start a new subresource load in this frame.
     stopAllLoaders();
 
-#if ENABLE(INSPECTOR)
-    if (Page* page = m_frame->page())
-        page->inspectorController()->frameDetachedFromParent(m_frame);
-#endif
+    InspectorInstrumentation::frameDetachedFromParent(m_frame);
 
     detachViewsAndDocumentLoader();
 
@@ -3371,15 +3368,7 @@ void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* world)
 
     m_client->dispatchDidClearWindowObjectInWorld(world);
 
-#if ENABLE(INSPECTOR)
-    if (world != mainThreadNormalWorld())
-        return;
-
-    if (Page* page = m_frame->page()) {
-        if (InspectorController* inspector = page->inspectorController())
-            inspector->inspectedWindowScriptObjectCleared(m_frame);
-    }
-#endif
+    InspectorInstrumentation::didClearWindowObjectInWorld(m_frame, world);
 }
 
 void FrameLoader::updateSandboxFlags()
@@ -3426,10 +3415,7 @@ void FrameLoader::dispatchDidCommitLoad()
 
     m_client->dispatchDidCommitLoad();
 
-#if ENABLE(INSPECTOR)
-    if (Page* page = m_frame->page())
-        page->inspectorController()->didCommitLoad(m_documentLoader.get());
-#endif
+    InspectorInstrumentation::didCommitLoad(m_frame, m_documentLoader.get());
 }
 
 void FrameLoader::tellClientAboutPastMemoryCacheLoads()
diff --git a/Source/WebCore/page/Chrome.cpp b/Source/WebCore/page/Chrome.cpp
index a801065..0405408 100644
--- a/Source/WebCore/page/Chrome.cpp
+++ b/Source/WebCore/page/Chrome.cpp
@@ -33,7 +33,7 @@
 #include "HTMLInputElement.h"
 #include "HTMLNames.h"
 #include "HitTestResult.h"
-#include "InspectorController.h"
+#include "InspectorInstrumentation.h"
 #include "Page.h"
 #include "PageGroupLoadDeferrer.h"
 #include "RenderObject.h"
@@ -344,10 +344,7 @@ void Chrome::mouseDidMoveOverElement(const HitTestResult& result, unsigned modif
     }
     m_client->mouseDidMoveOverElement(result, modifierFlags);
 
-#if ENABLE(INSPECTOR)
-    if (InspectorController* inspector = m_page->inspectorController())
-        inspector->mouseDidMoveOverElement(result, modifierFlags);
-#endif
+    InspectorInstrumentation::mouseDidMoveOverElement(m_page, result, modifierFlags);
 }
 
 void Chrome::setToolTip(const HitTestResult& result)
diff --git a/Source/WebCore/page/Console.cpp b/Source/WebCore/page/Console.cpp
index cf91559..d4aed41 100644
--- a/Source/WebCore/page/Console.cpp
+++ b/Source/WebCore/page/Console.cpp
@@ -146,12 +146,10 @@ void Console::addMessage(MessageSource source, MessageType type, MessageLevel le
     if (source == JSMessageSource)
         page->chrome()->client()->addMessageToConsole(source, type, level, message, lineNumber, sourceURL);
 
-#if ENABLE(INSPECTOR)
     if (callStack)
-        InspectorInstrumentation::addMessageToConsole(page, source, type, level, message, 0, callStack);
+        InspectorInstrumentation::addMessageToConsole(page, source, type, level, message, 0, callStack.get());
     else
         InspectorInstrumentation::addMessageToConsole(page, source, type, level, message, lineNumber, sourceURL);
-#endif
 
     if (!Console::shouldPrintExceptions())
         return;
@@ -189,9 +187,7 @@ void Console::addMessage(MessageType type, MessageLevel level, PassRefPtr<Script
     if (arguments->getFirstArgumentAsString(message))
         page->chrome()->client()->addMessageToConsole(JSMessageSource, type, level, message, lastCaller.lineNumber(), lastCaller.sourceURL());
 
-#if ENABLE(INSPECTOR)
-    InspectorInstrumentation::addMessageToConsole(page, JSMessageSource, type, level, message, arguments, callStack);
-#endif
+    InspectorInstrumentation::addMessageToConsole(page, JSMessageSource, type, level, message, arguments.get(), callStack.get());
 }
 
 void Console::debug(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> callStack)
@@ -250,36 +246,12 @@ void Console::assertCondition(bool condition, PassRefPtr<ScriptArguments> argume
 
 void Console::count(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> callStack)
 {
-#if ENABLE(INSPECTOR)
-    Page* page = this->page();
-    if (!page)
-        return;
-
-    const ScriptCallFrame& lastCaller = callStack->at(0);
-    // Follow Firebug's behavior of counting with null and undefined title in
-    // the same bucket as no argument
-    String title;
-    arguments->getFirstArgumentAsString(title);
-    InspectorInstrumentation::count(page, title, lastCaller.lineNumber(), lastCaller.sourceURL());
-#else
-    UNUSED_PARAM(callStack);
-#endif
+    InspectorInstrumentation::consoleCount(page(), arguments.get(), callStack.get());
 }
 
 void Console::markTimeline(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack>)
 {
-#if ENABLE(INSPECTOR)
-    Page* page = this->page();
-    if (!page)
-        return;
-
-    String message;
-    arguments->getFirstArgumentAsString(message);
-
-    page->inspectorController()->markTimeline(message);
-#else
-    UNUSED_PARAM(arguments);
-#endif
+    InspectorInstrumentation::consoleMarkTimeline(page(), arguments.get());
 }
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
@@ -307,10 +279,8 @@ void Console::profile(const String& title, ScriptState* state, PassRefPtr<Script
 
     ScriptProfiler::start(state, resolvedTitle);
 
-#if ENABLE(INSPECTOR)
     const ScriptCallFrame& lastCaller = callStack->at(0);
-    InspectorInstrumentation::addStartProfilingMessageToConsole(controller, resolvedTitle, lastCaller.lineNumber(), lastCaller.sourceURL());
-#endif
+    InspectorInstrumentation::addStartProfilingMessageToConsole(page, resolvedTitle, lastCaller.lineNumber(), lastCaller.sourceURL());
 }
 
 void Console::profileEnd(const String& title, ScriptState* state, PassRefPtr<ScriptCallStack> callStack)
@@ -341,49 +311,27 @@ void Console::profileEnd(const String& title, ScriptState* state, PassRefPtr<Scr
 
 void Console::time(const String& title)
 {
-#if ENABLE(INSPECTOR)
-    InspectorInstrumentation::startTiming(page(), title);
-#else
-    UNUSED_PARAM(title);
-#endif
+    InspectorInstrumentation::startConsoleTiming(page(), title);
 }
 
 void Console::timeEnd(const String& title, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack> callStack)
 {
-#if ENABLE(INSPECTOR)
-    const ScriptCallFrame& lastCaller = callStack->at(0);
-    InspectorInstrumentation::stopTiming(page(), title, lastCaller.lineNumber(), lastCaller.sourceURL());
-#else
-    UNUSED_PARAM(title);
-    UNUSED_PARAM(callStack);
-#endif
+    InspectorInstrumentation::stopConsoleTiming(page(), title, callStack.get());
 }
 
 void Console::group(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> callStack)
 {
-#if ENABLE(INSPECTOR)
-    InspectorInstrumentation::addMessageToConsole(page(), JSMessageSource, StartGroupMessageType, LogMessageLevel, String(), arguments, callStack);
-#else
-    UNUSED_PARAM(arguments);
-    UNUSED_PARAM(callStack);
-#endif
+    InspectorInstrumentation::addMessageToConsole(page(), JSMessageSource, StartGroupMessageType, LogMessageLevel, String(), arguments.get(), callStack.get());
 }
 
 void Console::groupCollapsed(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> callStack)
 {
-#if ENABLE(INSPECTOR)
-    InspectorInstrumentation::addMessageToConsole(page(), JSMessageSource, StartGroupCollapsedMessageType, LogMessageLevel, String(), arguments, callStack);
-#else
-    UNUSED_PARAM(arguments);
-    UNUSED_PARAM(callStack);
-#endif
+    InspectorInstrumentation::addMessageToConsole(page(), JSMessageSource, StartGroupCollapsedMessageType, LogMessageLevel, String(), arguments.get(), callStack.get());
 }
 
 void Console::groupEnd()
 {
-#if ENABLE(INSPECTOR)
     InspectorInstrumentation::addMessageToConsole(page(), JSMessageSource, EndGroupMessageType, LogMessageLevel, String(), 0, String());
-#endif
 }
 
 bool Console::shouldCaptureFullStackTrace() const
diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp
index 96c34ad..77a7dbc 100644
--- a/Source/WebCore/page/DOMWindow.cpp
+++ b/Source/WebCore/page/DOMWindow.cpp
@@ -65,7 +65,6 @@
 #include "History.h"
 #include "IDBFactory.h"
 #include "IDBFactoryBackendInterface.h"
-#include "InspectorController.h"
 #include "InspectorInstrumentation.h"
 #include "KURL.h"
 #include "Location.h"
@@ -628,9 +627,7 @@ Storage* DOMWindow::sessionStorage(ExceptionCode& ec) const
         return 0;
 
     RefPtr<StorageArea> storageArea = page->sessionStorage()->storageArea(document->securityOrigin());
-#if ENABLE(INSPECTOR)
-    page->inspectorController()->didUseDOMStorage(storageArea.get(), false, m_frame);
-#endif
+    InspectorInstrumentation::didUseDOMStorage(page, storageArea.get(), false, m_frame);
 
     m_sessionStorage = Storage::create(m_frame, storageArea.release());
     return m_sessionStorage.get();
@@ -658,9 +655,7 @@ Storage* DOMWindow::localStorage(ExceptionCode& ec) const
         return 0;
 
     RefPtr<StorageArea> storageArea = page->group().localStorage()->storageArea(document->securityOrigin());
-#if ENABLE(INSPECTOR)
-    page->inspectorController()->didUseDOMStorage(storageArea.get(), true, m_frame);
-#endif
+    InspectorInstrumentation::didUseDOMStorage(page, storageArea.get(), true, m_frame);
 
     m_localStorage = Storage::create(m_frame, storageArea.release());
     return m_localStorage.get();
@@ -1527,13 +1522,7 @@ void DOMWindow::dispatchLoadEvent()
         ownerElement->dispatchGenericEvent(ownerEvent.release());
     }
 
-#if ENABLE(INSPECTOR)
-    if (!frame() || !frame()->page())
-        return;
-
-    if (InspectorController* controller = frame()->page()->inspectorController())
-        controller->mainResourceFiredLoadEvent(frame()->loader()->documentLoader(), url());
-#endif
+    InspectorInstrumentation::mainResourceFiredLoadEvent(frame(), url());
 }
 
 bool DOMWindow::dispatchEvent(PassRefPtr<Event> prpEvent, PassRefPtr<EventTarget> prpTarget)
diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp
index fec1793..8c5330b 100644
--- a/Source/WebCore/page/EventHandler.cpp
+++ b/Source/WebCore/page/EventHandler.cpp
@@ -52,7 +52,7 @@
 #include "HitTestRequest.h"
 #include "HitTestResult.h"
 #include "Image.h"
-#include "InspectorController.h"
+#include "InspectorInstrumentation.h"
 #include "KeyboardEvent.h"
 #include "MouseEvent.h"
 #include "MouseEventWithHitTestResults.h"
@@ -1309,17 +1309,11 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
 
     m_mousePressNode = mev.targetNode();
 
-#if ENABLE(INSPECTOR)
-    if (Page* page = m_frame->page()) {
-        InspectorController* inspector = page->inspectorController();
-        if (inspector && inspector->enabled() && inspector->searchingForNodeInPage()) {
-            inspector->handleMousePress();
-            invalidateClick();
-            return true;
-        }
+    if (InspectorInstrumentation::handleMousePress(m_frame->page())) {
+        invalidateClick();
+        return true;
     }
-#endif
-
+        
     Frame* subframe = subframeForHitTestResult(mev);
     if (subframe && passMousePressEventToSubframe(mev, subframe)) {
         // Start capturing future events for this frame.  We only do this if we didn't clear
diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp
index 3a248a1..012a9be 100644
--- a/Source/WebCore/page/Page.cpp
+++ b/Source/WebCore/page/Page.cpp
@@ -199,10 +199,8 @@ Page::~Page()
         frame->pageDestroyed();
 
     m_editorClient->pageDestroyed();
-    
-#if ENABLE(INSPECTOR)
-    m_inspectorController->inspectedPageDestroyed();
-#endif
+
+    InspectorInstrumentation::inspectedPageDestroyed(this);
 
     backForward()->close();
 
diff --git a/Source/WebCore/storage/Database.cpp b/Source/WebCore/storage/Database.cpp
index 920f75b..8ef780e 100644
--- a/Source/WebCore/storage/Database.cpp
+++ b/Source/WebCore/storage/Database.cpp
@@ -36,7 +36,7 @@
 #include "DatabaseThread.h"
 #include "DatabaseTracker.h"
 #include "Document.h"
-#include "InspectorController.h"
+#include "InspectorInstrumentation.h"
 #include "Logging.h"
 #include "NotImplemented.h"
 #include "Page.h"
@@ -106,13 +106,8 @@ PassRefPtr<Database> Database::openDatabase(ScriptExecutionContext* context, con
     DatabaseTracker::tracker().setDatabaseDetails(context->securityOrigin(), name, displayName, estimatedSize);
 
     context->setHasOpenDatabases();
-#if ENABLE(INSPECTOR)
-    if (context->isDocument()) {
-        Document* document = static_cast<Document*>(context);
-        if (Page* page = document->page())
-            page->inspectorController()->didOpenDatabase(database, context->securityOrigin()->host(), name, expectedVersion);
-    }
-#endif
+
+    InspectorInstrumentation::didOpenDatabase(context, database.get(), context->securityOrigin()->host(), name, expectedVersion);
 
     // If it's a new database and a creation callback was provided, reset the expected
     // version to "" and schedule the creation callback. Because of some subtle String
diff --git a/Source/WebCore/workers/AbstractWorker.cpp b/Source/WebCore/workers/AbstractWorker.cpp
index 10bc95f..18a94b5 100644
--- a/Source/WebCore/workers/AbstractWorker.cpp
+++ b/Source/WebCore/workers/AbstractWorker.cpp
@@ -38,7 +38,7 @@
 #include "Event.h"
 #include "EventException.h"
 #include "EventNames.h"
-#include "InspectorController.h"
+#include "InspectorInstrumentation.h"
 #include "ScriptExecutionContext.h"
 #include "SecurityOrigin.h"
 
@@ -56,10 +56,7 @@ AbstractWorker::~AbstractWorker()
 
 void AbstractWorker::onDestroyWorker()
 {
-#if ENABLE(INSPECTOR)
-    if (InspectorController* inspector = scriptExecutionContext() ? scriptExecutionContext()->inspectorController() : 0)
-        inspector->didDestroyWorker(asID());
-#endif
+    InspectorInstrumentation::didDestroyWorker(scriptExecutionContext(), asID());
 }
 
 void AbstractWorker::contextDestroyed()
diff --git a/Source/WebCore/workers/SharedWorker.cpp b/Source/WebCore/workers/SharedWorker.cpp
index 997f9cd..874ea64 100644
--- a/Source/WebCore/workers/SharedWorker.cpp
+++ b/Source/WebCore/workers/SharedWorker.cpp
@@ -35,7 +35,7 @@
 
 #include "SharedWorker.h"
 
-#include "InspectorController.h"
+#include "InspectorInstrumentation.h"
 #include "KURL.h"
 #include "MessageChannel.h"
 #include "MessagePort.h"
@@ -64,10 +64,7 @@ PassRefPtr<SharedWorker> SharedWorker::create(const String& url, const String& n
 
     SharedWorkerRepository::connect(worker.get(), remotePort.release(), scriptURL, name, ec);
 
-#if ENABLE(INSPECTOR)
-    if (InspectorController* inspector = context->inspectorController())
-        inspector->didCreateWorker(worker->asID(), scriptURL.string(), true);
-#endif
+    InspectorInstrumentation::didCreateWorker(context, worker->asID(), scriptURL.string(), true);
 
     return worker.release();
 }
diff --git a/Source/WebCore/workers/Worker.cpp b/Source/WebCore/workers/Worker.cpp
index 8a2f62a..968352c 100644
--- a/Source/WebCore/workers/Worker.cpp
+++ b/Source/WebCore/workers/Worker.cpp
@@ -40,7 +40,6 @@
 #include "ExceptionCode.h"
 #include "Frame.h"
 #include "FrameLoader.h"
-#include "InspectorController.h"
 #include "InspectorInstrumentation.h"
 #include "MessageEvent.h"
 #include "TextEncoding.h"
@@ -71,10 +70,7 @@ PassRefPtr<Worker> Worker::create(const String& url, ScriptExecutionContext* con
     // The worker context does not exist while loading, so we must ensure that the worker object is not collected, nor are its event listeners.
     worker->setPendingActivity(worker.get());
 
-#if ENABLE(INSPECTOR)
-    if (InspectorController* inspector = context->inspectorController())
-        inspector->didCreateWorker(worker->asID(), scriptURL.string(), false);
-#endif
+    InspectorInstrumentation::didCreateWorker(context, worker->asID(), scriptURL.string(), false);
 
     return worker.release();
 }
diff --git a/Source/WebCore/workers/WorkerMessagingProxy.cpp b/Source/WebCore/workers/WorkerMessagingProxy.cpp
index 10700c6..e89ccb4 100644
--- a/Source/WebCore/workers/WorkerMessagingProxy.cpp
+++ b/Source/WebCore/workers/WorkerMessagingProxy.cpp
@@ -38,7 +38,6 @@
 #include "Document.h"
 #include "ErrorEvent.h"
 #include "ExceptionCode.h"
-#include "InspectorController.h"
 #include "MessageEvent.h"
 #include "ScriptExecutionContext.h"
 #include "Worker.h"

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list