Title: [208240] trunk/Source/WebCore
Revision
208240
Author
commit-qu...@webkit.org
Date
2016-11-01 14:42:51 -0700 (Tue, 01 Nov 2016)

Log Message

Web Inspector: Use more references in inspector code
https://bugs.webkit.org/show_bug.cgi?id=164283

Patch by Joseph Pecoraro <pecor...@apple.com> on 2016-11-01
Reviewed by Timothy Hatcher.

(WebCore::frameForScriptExecutionContext):
(WebCore::InspectorInstrumentation::didInstallTimerImpl):
(WebCore::InspectorInstrumentation::didRemoveTimerImpl):
(WebCore::InspectorInstrumentation::willFireTimerImpl):
(WebCore::InspectorInstrumentation::didLayoutImpl):
(WebCore::InspectorInstrumentation::willPaintImpl):
(WebCore::InspectorInstrumentation::didPaintImpl):
(WebCore::InspectorInstrumentation::didCommitLoadImpl):
(WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):
(WebCore::InspectorInstrumentation::didDispatchDOMStorageEventImpl):
(WebCore::InspectorInstrumentation::instrumentingAgentsForRenderer):
(WebCore::InspectorInstrumentation::instrumentingAgentsForPage): Deleted.
(WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::frameWindowDiscarded):
(WebCore::InspectorInstrumentation::didInstallTimer):
(WebCore::InspectorInstrumentation::didRemoveTimer):
(WebCore::InspectorInstrumentation::willFireTimer):
(WebCore::InspectorInstrumentation::didLayout):
(WebCore::InspectorInstrumentation::willComposite):
(WebCore::InspectorInstrumentation::didComposite):
(WebCore::InspectorInstrumentation::willPaint):
(WebCore::InspectorInstrumentation::didPaint):
(WebCore::InspectorInstrumentation::continueAfterPingLoader):
(WebCore::InspectorInstrumentation::scriptImported):
(WebCore::InspectorInstrumentation::didCommitLoad):
(WebCore::InspectorInstrumentation::frameDocumentUpdated):
(WebCore::InspectorInstrumentation::frameStartedLoading):
(WebCore::InspectorInstrumentation::frameStoppedLoading):
(WebCore::InspectorInstrumentation::frameScheduledNavigation):
(WebCore::InspectorInstrumentation::frameClearedScheduledNavigation):
(WebCore::InspectorInstrumentation::didDispatchDOMStorageEvent):
(WebCore::InspectorInstrumentation::shouldWaitForDebuggerOnStart):
(WebCore::InspectorInstrumentation::workerStarted):
(WebCore::InspectorInstrumentation::workerTerminated):
(WebCore::InspectorInstrumentation::didHandleMemoryPressure):
(WebCore::InspectorInstrumentation::networkStateChanged):
(WebCore::InspectorInstrumentation::addMessageToConsole):
(WebCore::InspectorInstrumentation::consoleCount):
(WebCore::InspectorInstrumentation::startConsoleTiming):
(WebCore::InspectorInstrumentation::stopConsoleTiming):
(WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
(WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
(WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
Convert to references where possible.

* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getMatchedStylesForNode):
(WebCore::InspectorCSSAgent::buildObjectForRule):
(WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
* inspector/InspectorCSSAgent.h:
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::frameDocumentUpdated):
* inspector/InspectorDOMAgent.h:
* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
* inspector/InspectorDOMStorageAgent.h:
* inspector/InspectorInstrumentation.cpp:
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::frameNavigated):
(WebCore::InspectorPageAgent::didPaint):
* inspector/InspectorPageAgent.h:
* inspector/InspectorReplayAgent.cpp:
(WebCore::InspectorReplayAgent::frameNavigated):
* inspector/InspectorReplayAgent.h:
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::didLayout):
(WebCore::InspectorTimelineAgent::didPaint):
* inspector/InspectorTimelineAgent.h:
Pass references through InspectorInstrumentation to the Agents.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::removeById):
(WebCore::DOMTimer::fired):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::willDetachPage):
* page/Frame.cpp:
(WebCore::Frame::setDocument):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::willPaintContents):
(WebCore::FrameView::didPaintContents):
* page/Page.cpp:
(WebCore::networkStateChanged):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintContents):
* replay/ReplayController.cpp:
(WebCore::ReplayController::frameNavigated):
* replay/ReplayController.h:
* storage/StorageEventDispatcher.cpp:
(WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
* workers/Worker.cpp:
(WebCore::Worker::notifyFinished):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::importScripts):
(WebCore::WorkerGlobalScope::addConsoleMessage):
(WebCore::WorkerGlobalScope::addMessage):
* workers/WorkerInspectorProxy.cpp:
(WebCore::WorkerInspectorProxy::workerStartMode):
(WebCore::WorkerInspectorProxy::workerStarted):
(WebCore::WorkerInspectorProxy::workerTerminated):
* workers/WorkerInspectorProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
Pass references to InspectorInstrumentation.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (208239 => 208240)


--- trunk/Source/WebCore/ChangeLog	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/ChangeLog	2016-11-01 21:42:51 UTC (rev 208240)
@@ -1,3 +1,120 @@
+2016-11-01  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Use more references in inspector code
+        https://bugs.webkit.org/show_bug.cgi?id=164283
+
+        Reviewed by Timothy Hatcher.
+
+        (WebCore::frameForScriptExecutionContext):
+        (WebCore::InspectorInstrumentation::didInstallTimerImpl):
+        (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
+        (WebCore::InspectorInstrumentation::willFireTimerImpl):
+        (WebCore::InspectorInstrumentation::didLayoutImpl):
+        (WebCore::InspectorInstrumentation::willPaintImpl):
+        (WebCore::InspectorInstrumentation::didPaintImpl):
+        (WebCore::InspectorInstrumentation::didCommitLoadImpl):
+        (WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):
+        (WebCore::InspectorInstrumentation::didDispatchDOMStorageEventImpl):
+        (WebCore::InspectorInstrumentation::instrumentingAgentsForRenderer):
+        (WebCore::InspectorInstrumentation::instrumentingAgentsForPage): Deleted.
+        (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope): Deleted.
+        * inspector/InspectorInstrumentation.h:
+        (WebCore::InspectorInstrumentation::frameWindowDiscarded):
+        (WebCore::InspectorInstrumentation::didInstallTimer):
+        (WebCore::InspectorInstrumentation::didRemoveTimer):
+        (WebCore::InspectorInstrumentation::willFireTimer):
+        (WebCore::InspectorInstrumentation::didLayout):
+        (WebCore::InspectorInstrumentation::willComposite):
+        (WebCore::InspectorInstrumentation::didComposite):
+        (WebCore::InspectorInstrumentation::willPaint):
+        (WebCore::InspectorInstrumentation::didPaint):
+        (WebCore::InspectorInstrumentation::continueAfterPingLoader):
+        (WebCore::InspectorInstrumentation::scriptImported):
+        (WebCore::InspectorInstrumentation::didCommitLoad):
+        (WebCore::InspectorInstrumentation::frameDocumentUpdated):
+        (WebCore::InspectorInstrumentation::frameStartedLoading):
+        (WebCore::InspectorInstrumentation::frameStoppedLoading):
+        (WebCore::InspectorInstrumentation::frameScheduledNavigation):
+        (WebCore::InspectorInstrumentation::frameClearedScheduledNavigation):
+        (WebCore::InspectorInstrumentation::didDispatchDOMStorageEvent):
+        (WebCore::InspectorInstrumentation::shouldWaitForDebuggerOnStart):
+        (WebCore::InspectorInstrumentation::workerStarted):
+        (WebCore::InspectorInstrumentation::workerTerminated):
+        (WebCore::InspectorInstrumentation::didHandleMemoryPressure):
+        (WebCore::InspectorInstrumentation::networkStateChanged):
+        (WebCore::InspectorInstrumentation::addMessageToConsole):
+        (WebCore::InspectorInstrumentation::consoleCount):
+        (WebCore::InspectorInstrumentation::startConsoleTiming):
+        (WebCore::InspectorInstrumentation::stopConsoleTiming):
+        (WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
+        (WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
+        (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
+        Convert to references where possible.
+
+        * inspector/InspectorCSSAgent.cpp:
+        (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
+        (WebCore::InspectorCSSAgent::buildObjectForRule):
+        (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
+        * inspector/InspectorCSSAgent.h:
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::frameDocumentUpdated):
+        * inspector/InspectorDOMAgent.h:
+        * inspector/InspectorDOMStorageAgent.cpp:
+        (WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
+        * inspector/InspectorDOMStorageAgent.h:
+        * inspector/InspectorInstrumentation.cpp:
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::frameNavigated):
+        (WebCore::InspectorPageAgent::didPaint):
+        * inspector/InspectorPageAgent.h:
+        * inspector/InspectorReplayAgent.cpp:
+        (WebCore::InspectorReplayAgent::frameNavigated):
+        * inspector/InspectorReplayAgent.h:
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::didLayout):
+        (WebCore::InspectorTimelineAgent::didPaint):
+        * inspector/InspectorTimelineAgent.h:
+        Pass references through InspectorInstrumentation to the Agents.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::clear):
+        * page/DOMTimer.cpp:
+        (WebCore::DOMTimer::install):
+        (WebCore::DOMTimer::removeById):
+        (WebCore::DOMTimer::fired):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::willDetachPage):
+        * page/Frame.cpp:
+        (WebCore::Frame::setDocument):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::layout):
+        (WebCore::FrameView::willPaintContents):
+        (WebCore::FrameView::didPaintContents):
+        * page/Page.cpp:
+        (WebCore::networkStateChanged):
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::paintContents):
+        * replay/ReplayController.cpp:
+        (WebCore::ReplayController::frameNavigated):
+        * replay/ReplayController.h:
+        * storage/StorageEventDispatcher.cpp:
+        (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
+        (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
+        * workers/Worker.cpp:
+        (WebCore::Worker::notifyFinished):
+        * workers/WorkerGlobalScope.cpp:
+        (WebCore::WorkerGlobalScope::importScripts):
+        (WebCore::WorkerGlobalScope::addConsoleMessage):
+        (WebCore::WorkerGlobalScope::addMessage):
+        * workers/WorkerInspectorProxy.cpp:
+        (WebCore::WorkerInspectorProxy::workerStartMode):
+        (WebCore::WorkerInspectorProxy::workerStarted):
+        (WebCore::WorkerInspectorProxy::workerTerminated):
+        * workers/WorkerInspectorProxy.h:
+        * workers/WorkerMessagingProxy.cpp:
+        (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
+        Pass references to InspectorInstrumentation.
+
 2016-11-01  Alex Christensen  <achristen...@webkit.org>
 
         Percent-encode non-ASCII code points in hosts of URLs with unrecognized schemes

Modified: trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp (208239 => 208240)


--- trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -576,7 +576,7 @@
     // Matched rules.
     StyleResolver& styleResolver = element->styleResolver();
     auto matchedRules = styleResolver.pseudoStyleRulesForElement(element, elementPseudoId, StyleResolver::AllCSSRules);
-    matchedCSSRules = buildArrayForMatchedRuleList(matchedRules, styleResolver, element, elementPseudoId);
+    matchedCSSRules = buildArrayForMatchedRuleList(matchedRules, styleResolver, *element, elementPseudoId);
 
     if (!originalElement->isPseudoElement()) {
         // Pseudo elements.
@@ -587,7 +587,7 @@
                 if (!matchedRules.isEmpty()) {
                     auto matches = Inspector::Protocol::CSS::PseudoIdMatches::create()
                         .setPseudoId(static_cast<int>(pseudoId))
-                        .setMatches(buildArrayForMatchedRuleList(matchedRules, styleResolver, element, pseudoId))
+                        .setMatches(buildArrayForMatchedRuleList(matchedRules, styleResolver, *element, pseudoId))
                         .release();
                     pseudoElements->addItem(WTFMove(matches));
                 }
@@ -604,7 +604,7 @@
                 StyleResolver& parentStyleResolver = parentElement->styleResolver();
                 auto parentMatchedRules = parentStyleResolver.styleRulesForElement(parentElement, StyleResolver::AllCSSRules);
                 auto entry = Inspector::Protocol::CSS::InheritedStyleEntry::create()
-                    .setMatchedCSSRules(buildArrayForMatchedRuleList(parentMatchedRules, styleResolver, parentElement, NOPSEUDO))
+                    .setMatchedCSSRules(buildArrayForMatchedRuleList(parentMatchedRules, styleResolver, *parentElement, NOPSEUDO))
                     .release();
                 if (parentElement->cssomStyle() && parentElement->cssomStyle()->length()) {
                     if (InspectorStyleSheetForInlineStyle* styleSheet = asInspectorStyleSheet(parentElement))
@@ -1009,7 +1009,7 @@
     return Inspector::Protocol::CSS::StyleSheetOrigin::Regular;
 }
 
-RefPtr<Inspector::Protocol::CSS::CSSRule> InspectorCSSAgent::buildObjectForRule(StyleRule* styleRule, StyleResolver& styleResolver, Element* element)
+RefPtr<Inspector::Protocol::CSS::CSSRule> InspectorCSSAgent::buildObjectForRule(StyleRule* styleRule, StyleResolver& styleResolver, Element& element)
 {
     if (!styleRule)
         return nullptr;
@@ -1017,10 +1017,10 @@
     // StyleRules returned by StyleResolver::styleRulesForElement lack parent pointers since that infomation is not cheaply available.
     // Since the inspector wants to walk the parent chain, we construct the full wrappers here.
     styleResolver.inspectorCSSOMWrappers().collectDocumentWrappers(styleResolver.document().extensionStyleSheets());
-    styleResolver.inspectorCSSOMWrappers().collectScopeWrappers(Style::Scope::forNode(*element));
+    styleResolver.inspectorCSSOMWrappers().collectScopeWrappers(Style::Scope::forNode(element));
 
     // Possiblity of :host styles if this element has a shadow root.
-    if (ShadowRoot* shadowRoot = element->shadowRoot())
+    if (ShadowRoot* shadowRoot = element.shadowRoot())
         styleResolver.inspectorCSSOMWrappers().collectScopeWrappers(shadowRoot->styleScope());
 
     CSSStyleRule* cssomWrapper = styleResolver.inspectorCSSOMWrappers().getWrapperForRuleInSheets(styleRule);
@@ -1028,7 +1028,7 @@
         return nullptr;
 
     InspectorStyleSheet* inspectorStyleSheet = bindStyleSheet(cssomWrapper->parentStyleSheet());
-    return inspectorStyleSheet ? inspectorStyleSheet->buildObjectForRule(cssomWrapper, element) : nullptr;
+    return inspectorStyleSheet ? inspectorStyleSheet->buildObjectForRule(cssomWrapper, &element) : nullptr;
 }
 
 RefPtr<Inspector::Protocol::CSS::CSSRule> InspectorCSSAgent::buildObjectForRule(CSSStyleRule* rule)
@@ -1041,13 +1041,13 @@
     return inspectorStyleSheet ? inspectorStyleSheet->buildObjectForRule(rule, nullptr) : nullptr;
 }
 
-RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::RuleMatch>> InspectorCSSAgent::buildArrayForMatchedRuleList(const Vector<RefPtr<StyleRule>>& matchedRules, StyleResolver& styleResolver, Element* element, PseudoId psuedoId)
+RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::RuleMatch>> InspectorCSSAgent::buildArrayForMatchedRuleList(const Vector<RefPtr<StyleRule>>& matchedRules, StyleResolver& styleResolver, Element& element, PseudoId psuedoId)
 {
     auto result = Inspector::Protocol::Array<Inspector::Protocol::CSS::RuleMatch>::create();
 
     SelectorChecker::CheckingContext context(SelectorChecker::Mode::CollectingRules);
-    context.pseudoId = psuedoId ? psuedoId : element->pseudoId();
-    SelectorChecker selectorChecker(element->document());
+    context.pseudoId = psuedoId ? psuedoId : element.pseudoId();
+    SelectorChecker selectorChecker(element.document());
 
     for (auto& matchedRule : matchedRules) {
         RefPtr<Inspector::Protocol::CSS::CSSRule> ruleObject = buildObjectForRule(matchedRule.get(), styleResolver, element);
@@ -1059,7 +1059,7 @@
         int index = 0;
         for (const CSSSelector* selector = selectorList.first(); selector; selector = CSSSelectorList::next(selector)) {
             unsigned ignoredSpecificity;
-            bool matched = selectorChecker.match(*selector, *element, context, ignoredSpecificity);
+            bool matched = selectorChecker.match(*selector, element, context, ignoredSpecificity);
             if (matched)
                 matchingSelectors->addItem(index);
             ++index;

Modified: trunk/Source/WebCore/inspector/InspectorCSSAgent.h (208239 => 208240)


--- trunk/Source/WebCore/inspector/InspectorCSSAgent.h	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.h	2016-11-01 21:42:51 UTC (rev 208240)
@@ -149,9 +149,9 @@
     InspectorStyleSheet* createInspectorStyleSheetForDocument(Document&);
     Inspector::Protocol::CSS::StyleSheetOrigin detectOrigin(CSSStyleSheet* pageStyleSheet, Document* ownerDocument);
 
-    RefPtr<Inspector::Protocol::CSS::CSSRule> buildObjectForRule(StyleRule*, StyleResolver&, Element*);
+    RefPtr<Inspector::Protocol::CSS::CSSRule> buildObjectForRule(StyleRule*, StyleResolver&, Element&);
     RefPtr<Inspector::Protocol::CSS::CSSRule> buildObjectForRule(CSSStyleRule*);
-    RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::RuleMatch>> buildArrayForMatchedRuleList(const Vector<RefPtr<StyleRule>>&, StyleResolver&, Element*, PseudoId);
+    RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::RuleMatch>> buildArrayForMatchedRuleList(const Vector<RefPtr<StyleRule>>&, StyleResolver&, Element&, PseudoId);
     RefPtr<Inspector::Protocol::CSS::CSSStyle> buildObjectForAttributesStyle(Element*);
     RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::Region>> buildArrayForRegions(ErrorString&, RefPtr<NodeList>&&, int documentNodeId);
     RefPtr<Inspector::Protocol::CSS::NamedFlow> buildObjectForNamedFlow(ErrorString&, WebKitNamedFlow*, int documentNodeId);

Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (208239 => 208240)


--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -2099,15 +2099,13 @@
     m_frontendDispatcher->customElementStateChanged(elementId, customElementState(element));
 }
 
-void InspectorDOMAgent::frameDocumentUpdated(Frame* frame)
+void InspectorDOMAgent::frameDocumentUpdated(Frame& frame)
 {
-    Document* document = frame->document();
+    Document* document = frame.document();
     if (!document)
         return;
 
-    Page* page = frame->page();
-    ASSERT(page);
-    if (frame != &page->mainFrame())
+    if (!frame.isMainFrame())
         return;
 
     // Only update the main frame document, nested frame document updates are not required

Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.h (208239 => 208240)


--- trunk/Source/WebCore/inspector/InspectorDOMAgent.h	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.h	2016-11-01 21:42:51 UTC (rev 208240)
@@ -171,7 +171,7 @@
     void didChangeCustomElementState(Element&);
     bool handleTouchEvent(Node&);
     void didCommitLoad(Document*);
-    void frameDocumentUpdated(Frame*);
+    void frameDocumentUpdated(Frame&);
     void pseudoElementCreated(PseudoElement&);
     void pseudoElementDestroyed(PseudoElement&);
 

Modified: trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp (208239 => 208240)


--- trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -159,7 +159,7 @@
         .release();
 }
 
-void InspectorDOMStorageAgent::didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin, Page*)
+void InspectorDOMStorageAgent::didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin)
 {
     if (!m_enabled)
         return;

Modified: trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.h (208239 => 208240)


--- trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.h	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.h	2016-11-01 21:42:51 UTC (rev 208240)
@@ -70,7 +70,7 @@
     RefPtr<Inspector::Protocol::DOMStorage::StorageId> storageId(SecurityOrigin*, bool isLocalStorage);
 
     // Called from InspectorInstrumentation
-    void didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*);
+    void didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*);
 
 private:
     RefPtr<StorageArea> findStorageArea(ErrorString&, const Inspector::InspectorObject&, Frame*&);

Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp (208239 => 208240)


--- trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -32,8 +32,6 @@
 #include "config.h"
 #include "InspectorInstrumentation.h"
 
-#include "CSSRule.h"
-#include "CSSStyleRule.h"
 #include "DOMWindow.h"
 #include "DOMWrapperWorld.h"
 #include "Database.h"
@@ -42,7 +40,6 @@
 #include "EventDispatcher.h"
 #include "InspectorApplicationCacheAgent.h"
 #include "InspectorCSSAgent.h"
-#include "InspectorController.h"
 #include "InspectorDOMAgent.h"
 #include "InspectorDOMDebuggerAgent.h"
 #include "InspectorDOMStorageAgent.h"
@@ -55,7 +52,6 @@
 #include "InspectorWorkerAgent.h"
 #include "InstrumentingAgents.h"
 #include "MainFrame.h"
-#include "Page.h"
 #include "PageDebuggerAgent.h"
 #include "PageHeapAgent.h"
 #include "PageRuntimeAgent.h"
@@ -62,11 +58,8 @@
 #include "RenderObject.h"
 #include "RenderView.h"
 #include "ScriptController.h"
-#include "StyleResolver.h"
-#include "StyleRule.h"
 #include "WebConsoleAgent.h"
-#include "WorkerInspectorController.h"
-#include "XMLHttpRequest.h"
+#include "WebSocketFrame.h"
 #include <inspector/ConsoleMessage.h>
 #include <inspector/ScriptArguments.h>
 #include <inspector/ScriptCallStack.h>
@@ -73,11 +66,10 @@
 #include <inspector/agents/InspectorDebuggerAgent.h>
 #include <runtime/ConsoleTypes.h>
 #include <wtf/StdLibExtras.h>
-#include <wtf/text/CString.h>
 
 #if ENABLE(WEB_REPLAY)
 #include "InspectorReplayAgent.h"
-#include "ReplayController.h" // for ReplayPosition.
+#include "ReplayController.h"
 #endif
 
 using namespace Inspector;
@@ -105,6 +97,14 @@
     return frame;
 }
 
+static Frame* frameForScriptExecutionContext(ScriptExecutionContext& context)
+{
+    Frame* frame = nullptr;
+    if (is<Document>(context))
+        frame = downcast<Document>(context).frame();
+    return frame;
+}
+
 void InspectorInstrumentation::didClearWindowObjectInWorldImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, DOMWrapperWorld& world)
 {
     InspectorPageAgent* pageAgent = instrumentingAgents.inspectorPageAgent();
@@ -320,7 +320,7 @@
         domDebuggerAgent->willSendXMLHttpRequest(url);
 }
 
-void InspectorInstrumentation::didInstallTimerImpl(InstrumentingAgents& instrumentingAgents, int timerId, std::chrono::milliseconds timeout, bool singleShot, ScriptExecutionContext* context)
+void InspectorInstrumentation::didInstallTimerImpl(InstrumentingAgents& instrumentingAgents, int timerId, std::chrono::milliseconds timeout, bool singleShot, ScriptExecutionContext& context)
 {
     pauseOnNativeEventIfNeeded(instrumentingAgents, false, setTimerEventName, true);
     if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent())
@@ -327,7 +327,7 @@
         timelineAgent->didInstallTimer(timerId, timeout, singleShot, frameForScriptExecutionContext(context));
 }
 
-void InspectorInstrumentation::didRemoveTimerImpl(InstrumentingAgents& instrumentingAgents, int timerId, ScriptExecutionContext* context)
+void InspectorInstrumentation::didRemoveTimerImpl(InstrumentingAgents& instrumentingAgents, int timerId, ScriptExecutionContext& context)
 {
     pauseOnNativeEventIfNeeded(instrumentingAgents, false, clearTimerEventName, true);
     if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent())
@@ -426,7 +426,7 @@
         pageAgent->scriptsEnabled(isEnabled);
 }
 
-InspectorInstrumentationCookie InspectorInstrumentation::willFireTimerImpl(InstrumentingAgents& instrumentingAgents, int timerId, ScriptExecutionContext* context)
+InspectorInstrumentationCookie InspectorInstrumentation::willFireTimerImpl(InstrumentingAgents& instrumentingAgents, int timerId, ScriptExecutionContext& context)
 {
     pauseOnNativeEventIfNeeded(instrumentingAgents, false, timerFiredEventName, false);
 
@@ -463,7 +463,7 @@
     return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId);
 }
 
-void InspectorInstrumentation::didLayoutImpl(const InspectorInstrumentationCookie& cookie, RenderObject* root)
+void InspectorInstrumentation::didLayoutImpl(const InspectorInstrumentationCookie& cookie, RenderObject& root)
 {
     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
         timelineAgent->didLayout(root);
@@ -484,13 +484,13 @@
         timelineAgent->didComposite();
 }
 
-void InspectorInstrumentation::willPaintImpl(InstrumentingAgents& instrumentingAgents, RenderObject* renderer)
+void InspectorInstrumentation::willPaintImpl(InstrumentingAgents& instrumentingAgents, RenderObject& renderer)
 {
     if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent())
-        timelineAgent->willPaint(renderer->frame());
+        timelineAgent->willPaint(renderer.frame());
 }
 
-void InspectorInstrumentation::didPaintImpl(InstrumentingAgents& instrumentingAgents, RenderObject* renderer, const LayoutRect& rect)
+void InspectorInstrumentation::didPaintImpl(InstrumentingAgents& instrumentingAgents, RenderObject& renderer, const LayoutRect& rect)
 {
     if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent())
         timelineAgent->didPaint(renderer, rect);
@@ -724,15 +724,20 @@
 #endif
 }
 
-void InspectorInstrumentation::didCommitLoadImpl(InstrumentingAgents& instrumentingAgents, Page* page, DocumentLoader* loader)
+void InspectorInstrumentation::didCommitLoadImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, DocumentLoader* loader)
 {
     if (!instrumentingAgents.inspectorEnvironment().developerExtrasEnabled())
         return;
 
-    if (!page || !loader || !loader->frame())
+    if (!frame.page())
         return;
 
-    if (loader->frame()->isMainFrame()) {
+    if (!loader)
+        return;
+
+    ASSERT(loader->frame() == &frame);
+
+    if (frame.isMainFrame()) {
         if (WebConsoleAgent* consoleAgent = instrumentingAgents.webConsoleAgent())
             consoleAgent->reset();
 
@@ -746,7 +751,7 @@
             databaseAgent->clearResources();
 
         if (InspectorDOMAgent* domAgent = instrumentingAgents.inspectorDOMAgent())
-            domAgent->setDocument(page->mainFrame().document());
+            domAgent->setDocument(frame.document());
 
         if (InspectorLayerTreeAgent* layerTreeAgent = instrumentingAgents.inspectorLayerTreeAgent())
             layerTreeAgent->reset();
@@ -759,12 +764,12 @@
     }
 
     if (InspectorDOMAgent* domAgent = instrumentingAgents.inspectorDOMAgent())
-        domAgent->didCommitLoad(loader->frame()->document());
+        domAgent->didCommitLoad(frame.document());
 
     if (InspectorPageAgent* pageAgent = instrumentingAgents.inspectorPageAgent())
-        pageAgent->frameNavigated(loader);
+        pageAgent->frameNavigated(frame);
 
-    if (loader->frame()->isMainFrame()) {
+    if (frame.isMainFrame()) {
         if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent())
             timelineAgent->mainFrameNavigated();
     }
@@ -771,11 +776,11 @@
 
 #if ENABLE(WEB_REPLAY)
     if (InspectorReplayAgent* replayAgent = instrumentingAgents.inspectorReplayAgent())
-        replayAgent->frameNavigated(loader);
+        replayAgent->frameNavigated(frame);
 #endif
 }
 
-void InspectorInstrumentation::frameDocumentUpdatedImpl(InstrumentingAgents& instrumentingAgents, Frame* frame)
+void InspectorInstrumentation::frameDocumentUpdatedImpl(InstrumentingAgents& instrumentingAgents, Frame& frame)
 {
     if (!instrumentingAgents.inspectorEnvironment().developerExtrasEnabled())
         return;
@@ -939,10 +944,10 @@
         dbAgent->didOpenDatabase(WTFMove(database), domain, name, version);
 }
 
-void InspectorInstrumentation::didDispatchDOMStorageEventImpl(InstrumentingAgents& instrumentingAgents, const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin, Page* page)
+void InspectorInstrumentation::didDispatchDOMStorageEventImpl(InstrumentingAgents& instrumentingAgents, const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin)
 {
     if (InspectorDOMStorageAgent* domStorageAgent = instrumentingAgents.inspectorDOMStorageAgent())
-        domStorageAgent->didDispatchDOMStorageEvent(key, oldValue, newValue, storageType, securityOrigin, page);
+        domStorageAgent->didDispatchDOMStorageEvent(key, oldValue, newValue, storageType, securityOrigin);
 }
 
 bool InspectorInstrumentation::shouldWaitForDebuggerOnStartImpl(InstrumentingAgents& instrumentingAgents)
@@ -1212,27 +1217,11 @@
     return nullptr;
 }
 
-InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForPage(Page* page)
+InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForRenderer(RenderObject& renderer)
 {
-    return page ? &instrumentingAgentsForPage(*page) : nullptr;
+    return instrumentingAgentsForFrame(renderer.frame());
 }
 
-InstrumentingAgents& InspectorInstrumentation::instrumentingAgentsForPage(Page& page)
-{
-    ASSERT(isMainThread());
-    return page.inspectorController().m_instrumentingAgents.get();
-}
-
-InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForRenderer(RenderObject* renderer)
-{
-    return instrumentingAgentsForFrame(renderer->frame());
-}
-
-InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope(WorkerGlobalScope* workerGlobalScope)
-{
-    return workerGlobalScope ? &workerGlobalScope->inspectorController().m_instrumentingAgents.get() : nullptr;
-}
-
 void InspectorInstrumentation::layerTreeDidChangeImpl(InstrumentingAgents& instrumentingAgents)
 {
     if (InspectorLayerTreeAgent* layerTreeAgent = instrumentingAgents.inspectorLayerTreeAgent())

Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (208239 => 208240)


--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h	2016-11-01 21:42:51 UTC (rev 208240)
@@ -36,13 +36,14 @@
 #include "FormData.h"
 #include "Frame.h"
 #include "HitTestResult.h"
+#include "InspectorController.h"
 #include "InspectorInstrumentationCookie.h"
 #include "MemoryPressureHandler.h"
+#include "Page.h"
 #include "ScriptExecutionContext.h"
 #include "StorageArea.h"
-#include "WebSocketFrame.h"
 #include "WorkerGlobalScope.h"
-#include <runtime/ConsoleTypes.h>
+#include "WorkerInspectorController.h"
 #include <wtf/RefPtr.h>
 
 #if ENABLE(WEB_REPLAY)
@@ -51,10 +52,6 @@
 #endif
 
 
-namespace Deprecated {
-class ScriptObject;
-}
-
 namespace Inspector {
 class ConsoleMessage;
 class ScriptArguments;
@@ -63,7 +60,6 @@
 
 namespace WebCore {
 
-class CSSRule;
 class CachedResource;
 class CharacterData;
 class DOMWindow;
@@ -71,34 +67,23 @@
 class Database;
 class Document;
 class DocumentLoader;
-class Element;
-class GraphicsContext;
 class HTTPHeaderMap;
-class InspectorCSSAgent;
-class InspectorCSSOMWrappers;
-class InspectorInstrumentation;
 class InspectorTimelineAgent;
 class InstrumentingAgents;
 class Node;
-class Page;
 class PseudoElement;
 class RenderLayer;
-class RenderLayerBacking;
 class RenderObject;
 class ResourceRequest;
 class ResourceResponse;
-class ScriptExecutionContext;
 class SecurityOrigin;
 class ShadowRoot;
-class StorageArea;
-class StyleResolver;
-class StyleRule;
 class ThreadableLoaderClient;
 class URL;
 class WorkerInspectorProxy;
-class XMLHttpRequest;
 
 struct ReplayPosition;
+struct WebSocketFrame;
 
 #define FAST_RETURN_IF_NO_FRONTENDS(value) if (LIKELY(!hasFrontends())) return value;
 
@@ -117,7 +102,7 @@
     static void characterDataModified(Document&, CharacterData&);
     static void didInvalidateStyleAttr(Document&, Node&);
     static void documentDetached(Document&);
-    static void frameWindowDiscarded(Frame*, DOMWindow*);
+    static void frameWindowDiscarded(Frame&, DOMWindow*);
     static void mediaQueryResultChanged(Document&);
     static void activeStyleSheetsUpdated(Document&);
     static void didPushShadowRoot(Element& host, ShadowRoot&);
@@ -137,8 +122,8 @@
     static bool forcePseudoState(const Element&, CSSSelector::PseudoClassType);
 
     static void willSendXMLHttpRequest(ScriptExecutionContext*, const String& url);
-    static void didInstallTimer(ScriptExecutionContext*, int timerId, std::chrono::milliseconds timeout, bool singleShot);
-    static void didRemoveTimer(ScriptExecutionContext*, int timerId);
+    static void didInstallTimer(ScriptExecutionContext&, int timerId, std::chrono::milliseconds timeout, bool singleShot);
+    static void didRemoveTimer(ScriptExecutionContext&, int timerId);
 
     static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine);
     static void didCallFunction(const InspectorInstrumentationCookie&, ScriptExecutionContext*);
@@ -151,16 +136,16 @@
     static InspectorInstrumentationCookie willEvaluateScript(Frame&, const String& url, int lineNumber);
     static void didEvaluateScript(const InspectorInstrumentationCookie&, Frame&);
     static void scriptsEnabled(Page&, bool isEnabled);
-    static InspectorInstrumentationCookie willFireTimer(ScriptExecutionContext*, int timerId);
+    static InspectorInstrumentationCookie willFireTimer(ScriptExecutionContext&, int timerId);
     static void didFireTimer(const InspectorInstrumentationCookie&);
     static void didInvalidateLayout(Frame&);
     static InspectorInstrumentationCookie willLayout(Frame&);
-    static void didLayout(const InspectorInstrumentationCookie&, RenderObject*);
+    static void didLayout(const InspectorInstrumentationCookie&, RenderObject&);
     static void didScroll(Page&);
     static void willComposite(Frame&);
     static void didComposite(Frame&);
-    static void willPaint(RenderObject*);
-    static void didPaint(RenderObject*, const LayoutRect&);
+    static void willPaint(RenderObject&);
+    static void didPaint(RenderObject&, const LayoutRect&);
     static InspectorInstrumentationCookie willRecalculateStyle(Document&);
     static void didRecalculateStyle(const InspectorInstrumentationCookie&);
     static void didScheduleStyleRecalculation(Document&);
@@ -182,7 +167,7 @@
     static void didReceiveXHRResponse(ScriptExecutionContext*, unsigned long identifier);
     static void willLoadXHRSynchronously(ScriptExecutionContext*);
     static void didLoadXHRSynchronously(ScriptExecutionContext*);
-    static void scriptImported(ScriptExecutionContext*, unsigned long identifier, const String& sourceString);
+    static void scriptImported(ScriptExecutionContext&, unsigned long identifier, const String& sourceString);
     static void scriptExecutionBlockedByCSP(ScriptExecutionContext*, const String& directiveText);
     static void didReceiveScriptResponse(ScriptExecutionContext*, unsigned long identifier);
     static void domContentLoadedEventFired(Frame&);
@@ -189,7 +174,7 @@
     static void loadEventFired(Frame*);
     static void frameDetachedFromParent(Frame&);
     static void didCommitLoad(Frame&, DocumentLoader*);
-    static void frameDocumentUpdated(Frame*);
+    static void frameDocumentUpdated(Frame&);
     static void loaderDetachedFromFrame(Frame&, DocumentLoader&);
     static void frameStartedLoading(Frame&);
     static void frameStoppedLoading(Frame&);
@@ -200,7 +185,7 @@
     static void willDestroyCachedResource(CachedResource&);
 
     static void addMessageToConsole(Page&, std::unique_ptr<Inspector::ConsoleMessage>);
-    static void addMessageToConsole(WorkerGlobalScope*, std::unique_ptr<Inspector::ConsoleMessage>);
+    static void addMessageToConsole(WorkerGlobalScope&, std::unique_ptr<Inspector::ConsoleMessage>);
 
     static void consoleCount(Page&, JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&);
     static void consoleCount(WorkerGlobalScope&, JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&);
@@ -220,11 +205,11 @@
 
     static void didOpenDatabase(ScriptExecutionContext*, RefPtr<Database>&&, const String& domain, const String& name, const String& version);
 
-    static void didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*);
+    static void didDispatchDOMStorageEvent(Page&, const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*);
 
-    static bool shouldWaitForDebuggerOnStart(ScriptExecutionContext*);
-    static void workerStarted(ScriptExecutionContext*, WorkerInspectorProxy*, const URL&);
-    static void workerTerminated(ScriptExecutionContext*, WorkerInspectorProxy*);
+    static bool shouldWaitForDebuggerOnStart(ScriptExecutionContext&);
+    static void workerStarted(ScriptExecutionContext&, WorkerInspectorProxy*, const URL&);
+    static void workerTerminated(ScriptExecutionContext&, WorkerInspectorProxy*);
 
 #if ENABLE(WEB_REPLAY)
     static void sessionCreated(Page&, RefPtr<ReplaySession>&&);
@@ -259,7 +244,7 @@
     static void didHandleMemoryPressure(Page&, Critical);
 #endif
 
-    static void networkStateChanged(Page*);
+    static void networkStateChanged(Page&);
     static void updateApplicationCacheStatus(Frame*);
 
     static void layerTreeDidChange(Page*);
@@ -311,8 +296,8 @@
     static bool forcePseudoStateImpl(InstrumentingAgents&, const Element&, CSSSelector::PseudoClassType);
 
     static void willSendXMLHttpRequestImpl(InstrumentingAgents&, const String& url);
-    static void didInstallTimerImpl(InstrumentingAgents&, int timerId, std::chrono::milliseconds timeout, bool singleShot, ScriptExecutionContext*);
-    static void didRemoveTimerImpl(InstrumentingAgents&, int timerId, ScriptExecutionContext*);
+    static void didInstallTimerImpl(InstrumentingAgents&, int timerId, std::chrono::milliseconds timeout, bool singleShot, ScriptExecutionContext&);
+    static void didRemoveTimerImpl(InstrumentingAgents&, int timerId, ScriptExecutionContext&);
 
     static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents&, const String& scriptName, int scriptLine, ScriptExecutionContext*);
     static void didCallFunctionImpl(const InspectorInstrumentationCookie&, ScriptExecutionContext*);
@@ -325,16 +310,16 @@
     static InspectorInstrumentationCookie willEvaluateScriptImpl(InstrumentingAgents&, Frame&, const String& url, int lineNumber);
     static void didEvaluateScriptImpl(const InspectorInstrumentationCookie&, Frame&);
     static void scriptsEnabledImpl(InstrumentingAgents&, bool isEnabled);
-    static InspectorInstrumentationCookie willFireTimerImpl(InstrumentingAgents&, int timerId, ScriptExecutionContext*);
+    static InspectorInstrumentationCookie willFireTimerImpl(InstrumentingAgents&, int timerId, ScriptExecutionContext&);
     static void didFireTimerImpl(const InspectorInstrumentationCookie&);
     static void didInvalidateLayoutImpl(InstrumentingAgents&, Frame&);
     static InspectorInstrumentationCookie willLayoutImpl(InstrumentingAgents&, Frame&);
-    static void didLayoutImpl(const InspectorInstrumentationCookie&, RenderObject*);
+    static void didLayoutImpl(const InspectorInstrumentationCookie&, RenderObject&);
     static void didScrollImpl(InstrumentingAgents&);
     static void willCompositeImpl(InstrumentingAgents&, Frame&);
     static void didCompositeImpl(InstrumentingAgents&);
-    static void willPaintImpl(InstrumentingAgents&, RenderObject*);
-    static void didPaintImpl(InstrumentingAgents&, RenderObject*, const LayoutRect&);
+    static void willPaintImpl(InstrumentingAgents&, RenderObject&);
+    static void didPaintImpl(InstrumentingAgents&, RenderObject&, const LayoutRect&);
     static InspectorInstrumentationCookie willRecalculateStyleImpl(InstrumentingAgents&, Document&);
     static void didRecalculateStyleImpl(const InspectorInstrumentationCookie&);
     static void didScheduleStyleRecalculationImpl(InstrumentingAgents&, Document&);
@@ -365,8 +350,8 @@
     static void domContentLoadedEventFiredImpl(InstrumentingAgents&, Frame&);
     static void loadEventFiredImpl(InstrumentingAgents&, Frame*);
     static void frameDetachedFromParentImpl(InstrumentingAgents&, Frame&);
-    static void didCommitLoadImpl(InstrumentingAgents&, Page*, DocumentLoader*);
-    static void frameDocumentUpdatedImpl(InstrumentingAgents&, Frame*);
+    static void didCommitLoadImpl(InstrumentingAgents&, Frame&, DocumentLoader*);
+    static void frameDocumentUpdatedImpl(InstrumentingAgents&, Frame&);
     static void loaderDetachedFromFrameImpl(InstrumentingAgents&, DocumentLoader&);
     static void frameStartedLoadingImpl(InstrumentingAgents&, Frame&);
     static void frameStoppedLoadingImpl(InstrumentingAgents&, Frame&);
@@ -396,7 +381,7 @@
 
     static void didOpenDatabaseImpl(InstrumentingAgents&, RefPtr<Database>&&, const String& domain, const String& name, const String& version);
 
-    static void didDispatchDOMStorageEventImpl(InstrumentingAgents&, const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*);
+    static void didDispatchDOMStorageEventImpl(InstrumentingAgents&, const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*);
 
     static bool shouldWaitForDebuggerOnStartImpl(InstrumentingAgents&);
     static void workerStartedImpl(InstrumentingAgents&, WorkerInspectorProxy*, const URL&);
@@ -442,12 +427,15 @@
     static void renderLayerDestroyedImpl(InstrumentingAgents&, const RenderLayer&);
 
     static InstrumentingAgents& instrumentingAgentsForPage(Page&);
+    static InstrumentingAgents& instrumentingAgentsForWorkerGlobalScope(WorkerGlobalScope&);
+
     static InstrumentingAgents* instrumentingAgentsForFrame(Frame&);
     static InstrumentingAgents* instrumentingAgentsForFrame(Frame*);
     static InstrumentingAgents* instrumentingAgentsForContext(ScriptExecutionContext*);
+    static InstrumentingAgents* instrumentingAgentsForContext(ScriptExecutionContext&);
     static InstrumentingAgents* instrumentingAgentsForDocument(Document&);
     static InstrumentingAgents* instrumentingAgentsForDocument(Document*);
-    static InstrumentingAgents* instrumentingAgentsForRenderer(RenderObject*);
+    static InstrumentingAgents* instrumentingAgentsForRenderer(RenderObject&);
     static InstrumentingAgents* instrumentingAgentsForWorkerGlobalScope(WorkerGlobalScope*);
 
     static InspectorTimelineAgent* retrieveTimelineAgent(const InspectorInstrumentationCookie&);
@@ -535,7 +523,7 @@
         documentDetachedImpl(*instrumentingAgents, document);
 }
 
-inline void InspectorInstrumentation::frameWindowDiscarded(Frame* frame, DOMWindow* domWindow)
+inline void InspectorInstrumentation::frameWindowDiscarded(Frame& frame, DOMWindow* domWindow)
 {
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         frameWindowDiscardedImpl(*instrumentingAgents, domWindow);
@@ -669,7 +657,7 @@
         willSendXMLHttpRequestImpl(*instrumentingAgents, url);
 }
 
-inline void InspectorInstrumentation::didInstallTimer(ScriptExecutionContext* context, int timerId, std::chrono::milliseconds timeout, bool singleShot)
+inline void InspectorInstrumentation::didInstallTimer(ScriptExecutionContext& context, int timerId, std::chrono::milliseconds timeout, bool singleShot)
 {
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
@@ -676,7 +664,7 @@
         didInstallTimerImpl(*instrumentingAgents, timerId, timeout, singleShot, context);
 }
 
-inline void InspectorInstrumentation::didRemoveTimer(ScriptExecutionContext* context, int timerId)
+inline void InspectorInstrumentation::didRemoveTimer(ScriptExecutionContext& context, int timerId)
 {
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
@@ -691,7 +679,6 @@
     return InspectorInstrumentationCookie();
 }
 
-
 inline void InspectorInstrumentation::didCallFunction(const InspectorInstrumentationCookie& cookie, ScriptExecutionContext* context)
 {
     FAST_RETURN_IF_NO_FRONTENDS(void());
@@ -765,7 +752,7 @@
     return scriptsEnabledImpl(instrumentingAgentsForPage(page), isEnabled);
 }
 
-inline InspectorInstrumentationCookie InspectorInstrumentation::willFireTimer(ScriptExecutionContext* context, int timerId)
+inline InspectorInstrumentationCookie InspectorInstrumentation::willFireTimer(ScriptExecutionContext& context, int timerId)
 {
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
@@ -795,7 +782,7 @@
     return InspectorInstrumentationCookie();
 }
 
-inline void InspectorInstrumentation::didLayout(const InspectorInstrumentationCookie& cookie, RenderObject* root)
+inline void InspectorInstrumentation::didLayout(const InspectorInstrumentationCookie& cookie, RenderObject& root)
 {
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (cookie.isValid())
@@ -811,7 +798,7 @@
 inline void InspectorInstrumentation::willComposite(Frame& frame)
 {
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         willCompositeImpl(*instrumentingAgents, frame);
 }
 
@@ -818,11 +805,11 @@
 inline void InspectorInstrumentation::didComposite(Frame& frame)
 {
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         didCompositeImpl(*instrumentingAgents);
 }
 
-inline void InspectorInstrumentation::willPaint(RenderObject* renderer)
+inline void InspectorInstrumentation::willPaint(RenderObject& renderer)
 {
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForRenderer(renderer))
@@ -829,7 +816,7 @@
         return willPaintImpl(*instrumentingAgents, renderer);
 }
 
-inline void InspectorInstrumentation::didPaint(RenderObject* renderer, const LayoutRect& rect)
+inline void InspectorInstrumentation::didPaint(RenderObject& renderer, const LayoutRect& rect)
 {
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForRenderer(renderer))
@@ -873,7 +860,7 @@
 
 inline void InspectorInstrumentation::continueAfterPingLoader(Frame& frame, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& response)
 {
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         InspectorInstrumentation::continueAfterPingLoaderImpl(*instrumentingAgents, identifier, loader, request, response);
 }
 
@@ -961,7 +948,7 @@
         didLoadXHRSynchronouslyImpl(*instrumentingAgents);
 }
 
-inline void InspectorInstrumentation::scriptImported(ScriptExecutionContext* context, unsigned long identifier, const String& sourceString)
+inline void InspectorInstrumentation::scriptImported(ScriptExecutionContext& context, unsigned long identifier, const String& sourceString)
 {
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         scriptImportedImpl(*instrumentingAgents, identifier, sourceString);
@@ -1000,10 +987,10 @@
 inline void InspectorInstrumentation::didCommitLoad(Frame& frame, DocumentLoader* loader)
 {
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
-        didCommitLoadImpl(*instrumentingAgents, frame.page(), loader);
+        didCommitLoadImpl(*instrumentingAgents, frame, loader);
 }
 
-inline void InspectorInstrumentation::frameDocumentUpdated(Frame* frame)
+inline void InspectorInstrumentation::frameDocumentUpdated(Frame& frame)
 {
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
@@ -1018,25 +1005,25 @@
 
 inline void InspectorInstrumentation::frameStartedLoading(Frame& frame)
 {
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         frameStartedLoadingImpl(*instrumentingAgents, frame);
 }
 
 inline void InspectorInstrumentation::frameStoppedLoading(Frame& frame)
 {
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         frameStoppedLoadingImpl(*instrumentingAgents, frame);
 }
 
 inline void InspectorInstrumentation::frameScheduledNavigation(Frame& frame, double delay)
 {
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         frameScheduledNavigationImpl(*instrumentingAgents, frame, delay);
 }
 
 inline void InspectorInstrumentation::frameClearedScheduledNavigation(Frame& frame)
 {
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
         frameClearedScheduledNavigationImpl(*instrumentingAgents, frame);
 }
 
@@ -1065,14 +1052,13 @@
         didOpenDatabaseImpl(*instrumentingAgents, WTFMove(database), domain, name, version);
 }
 
-inline void InspectorInstrumentation::didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin, Page* page)
+inline void InspectorInstrumentation::didDispatchDOMStorageEvent(Page& page, const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin)
 {
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
-        didDispatchDOMStorageEventImpl(*instrumentingAgents, key, oldValue, newValue, storageType, securityOrigin, page);
+    didDispatchDOMStorageEventImpl(instrumentingAgentsForPage(page), key, oldValue, newValue, storageType, securityOrigin);
 }
 
-inline bool InspectorInstrumentation::shouldWaitForDebuggerOnStart(ScriptExecutionContext* context)
+inline bool InspectorInstrumentation::shouldWaitForDebuggerOnStart(ScriptExecutionContext& context)
 {
     FAST_RETURN_IF_NO_FRONTENDS(false);
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
@@ -1080,7 +1066,7 @@
     return false;
 }
 
-inline void InspectorInstrumentation::workerStarted(ScriptExecutionContext* context, WorkerInspectorProxy* proxy, const URL& url)
+inline void InspectorInstrumentation::workerStarted(ScriptExecutionContext& context, WorkerInspectorProxy* proxy, const URL& url)
 {
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
@@ -1087,7 +1073,7 @@
         workerStartedImpl(*instrumentingAgents, proxy, url);
 }
 
-inline void InspectorInstrumentation::workerTerminated(ScriptExecutionContext* context, WorkerInspectorProxy* proxy)
+inline void InspectorInstrumentation::workerTerminated(ScriptExecutionContext& context, WorkerInspectorProxy* proxy)
 {
     FAST_RETURN_IF_NO_FRONTENDS(void());
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
@@ -1229,16 +1215,14 @@
 inline void InspectorInstrumentation::didHandleMemoryPressure(Page& page, Critical critical)
 {
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(&page))
-        didHandleMemoryPressureImpl(*instrumentingAgents, critical);
+    didHandleMemoryPressureImpl(instrumentingAgentsForPage(page), critical);
 }
 #endif
 
-inline void InspectorInstrumentation::networkStateChanged(Page* page)
+inline void InspectorInstrumentation::networkStateChanged(Page& page)
 {
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
-        networkStateChangedImpl(*instrumentingAgents);
+    networkStateChangedImpl(instrumentingAgentsForPage(page));
 }
 
 inline void InspectorInstrumentation::updateApplicationCacheStatus(Frame* frame)
@@ -1253,10 +1237,9 @@
     addMessageToConsoleImpl(instrumentingAgentsForPage(page), WTFMove(message));
 }
 
-inline void InspectorInstrumentation::addMessageToConsole(WorkerGlobalScope* workerGlobalScope, std::unique_ptr<Inspector::ConsoleMessage> message)
+inline void InspectorInstrumentation::addMessageToConsole(WorkerGlobalScope& workerGlobalScope, std::unique_ptr<Inspector::ConsoleMessage> message)
 {
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForWorkerGlobalScope(workerGlobalScope))
-        addMessageToConsoleImpl(*instrumentingAgents, WTFMove(message));
+    addMessageToConsoleImpl(instrumentingAgentsForWorkerGlobalScope(workerGlobalScope), WTFMove(message));
 }
 
 inline void InspectorInstrumentation::consoleCount(Page& page, JSC::ExecState* state, RefPtr<Inspector::ScriptArguments>&& arguments)
@@ -1266,8 +1249,7 @@
 
 inline void InspectorInstrumentation::consoleCount(WorkerGlobalScope& workerGlobalScope, JSC::ExecState* state, RefPtr<Inspector::ScriptArguments>&& arguments)
 {
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForWorkerGlobalScope(&workerGlobalScope))
-        consoleCountImpl(*instrumentingAgents, state, WTFMove(arguments));
+    consoleCountImpl(instrumentingAgentsForWorkerGlobalScope(workerGlobalScope), state, WTFMove(arguments));
 }
 
 inline void InspectorInstrumentation::takeHeapSnapshot(Frame& frame, const String& title)
@@ -1285,8 +1267,7 @@
 
 inline void InspectorInstrumentation::startConsoleTiming(WorkerGlobalScope& workerGlobalScope, const String& title)
 {
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForWorkerGlobalScope(&workerGlobalScope))
-        startConsoleTimingImpl(*instrumentingAgents, title);
+    startConsoleTimingImpl(instrumentingAgentsForWorkerGlobalScope(workerGlobalScope), title);
 }
 
 inline void InspectorInstrumentation::stopConsoleTiming(Frame& frame, const String& title, RefPtr<Inspector::ScriptCallStack>&& stack)
@@ -1297,8 +1278,7 @@
 
 inline void InspectorInstrumentation::stopConsoleTiming(WorkerGlobalScope& workerGlobalScope, const String& title, RefPtr<Inspector::ScriptCallStack>&& stack)
 {
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForWorkerGlobalScope(&workerGlobalScope))
-        stopConsoleTimingImpl(*instrumentingAgents, title, WTFMove(stack));
+    stopConsoleTimingImpl(instrumentingAgentsForWorkerGlobalScope(workerGlobalScope), title, WTFMove(stack));
 }
 
 inline void InspectorInstrumentation::consoleTimeStamp(Frame& frame, RefPtr<Inspector::ScriptArguments>&& arguments)
@@ -1360,12 +1340,15 @@
 
 inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForContext(ScriptExecutionContext* context)
 {
-    if (!context)
-        return nullptr;
-    if (is<Document>(*context))
-        return instrumentingAgentsForPage(downcast<Document>(context)->page());
-    if (is<WorkerGlobalScope>(*context))
-        return instrumentingAgentsForWorkerGlobalScope(downcast<WorkerGlobalScope>(context));
+    return context ? instrumentingAgentsForContext(*context) : nullptr;
+}
+
+inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForContext(ScriptExecutionContext& context)
+{
+    if (is<Document>(context))
+        return instrumentingAgentsForPage(downcast<Document>(context).page());
+    if (is<WorkerGlobalScope>(context))
+        return &instrumentingAgentsForWorkerGlobalScope(downcast<WorkerGlobalScope>(context));
     return nullptr;
 }
 
@@ -1392,4 +1375,25 @@
     return instrumentingAgentsForPage(page);
 }
 
+inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForPage(Page* page)
+{
+    return page ? &instrumentingAgentsForPage(*page) : nullptr;
+}
+
+inline InstrumentingAgents& InspectorInstrumentation::instrumentingAgentsForPage(Page& page)
+{
+    ASSERT(isMainThread());
+    return page.inspectorController().m_instrumentingAgents.get();
+}
+
+inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope(WorkerGlobalScope* workerGlobalScope)
+{
+    return workerGlobalScope ? &instrumentingAgentsForWorkerGlobalScope(*workerGlobalScope) : nullptr;
+}
+
+inline InstrumentingAgents& InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope(WorkerGlobalScope& workerGlobalScope)
+{
+    return workerGlobalScope.inspectorController().m_instrumentingAgents;
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (208239 => 208240)


--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -738,13 +738,13 @@
     m_frontendDispatcher->loadEventFired(timestamp());
 }
 
-void InspectorPageAgent::frameNavigated(DocumentLoader* loader)
+void InspectorPageAgent::frameNavigated(Frame& frame)
 {
-    if (loader->frame()->isMainFrame()) {
+    if (frame.isMainFrame()) {
         m_scriptToEvaluateOnLoadOnce = m_pendingScriptToEvaluateOnLoadOnce;
         m_pendingScriptToEvaluateOnLoadOnce = String();
     }
-    m_frontendDispatcher->frameNavigated(buildObjectForFrame(loader->frame()));
+    m_frontendDispatcher->frameNavigated(buildObjectForFrame(&frame));
 }
 
 void InspectorPageAgent::frameDetached(Frame& frame)
@@ -860,13 +860,13 @@
     m_frontendDispatcher->_javascript_DialogClosed();
 }
 
-void InspectorPageAgent::didPaint(RenderObject* renderer, const LayoutRect& rect)
+void InspectorPageAgent::didPaint(RenderObject& renderer, const LayoutRect& rect)
 {
     if (!m_enabled || !m_showPaintRects)
         return;
 
-    LayoutRect absoluteRect = LayoutRect(renderer->localToAbsoluteQuad(FloatRect(rect)).boundingBox());
-    FrameView* view = renderer->document().view();
+    LayoutRect absoluteRect = LayoutRect(renderer.localToAbsoluteQuad(FloatRect(rect)).boundingBox());
+    FrameView* view = renderer.document().view();
 
     LayoutRect rootRect = absoluteRect;
     if (!view->frame().isMainFrame()) {

Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.h (208239 => 208240)


--- trunk/Source/WebCore/inspector/InspectorPageAgent.h	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.h	2016-11-01 21:42:51 UTC (rev 208240)
@@ -120,7 +120,7 @@
     void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld&);
     void domContentEventFired();
     void loadEventFired();
-    void frameNavigated(DocumentLoader*);
+    void frameNavigated(Frame&);
     void frameDetached(Frame&);
     void loaderDetachedFromFrame(DocumentLoader&);
     void frameStartedLoading(Frame&);
@@ -130,7 +130,7 @@
     void willRunJavaScriptDialog(const String& message);
     void didRunJavaScriptDialog();
     void applyEmulatedMedia(String&);
-    void didPaint(RenderObject*, const LayoutRect&);
+    void didPaint(RenderObject&, const LayoutRect&);
     void didLayout();
     void didScroll();
     void didRecalculateStyle();

Modified: trunk/Source/WebCore/inspector/InspectorReplayAgent.cpp (208239 => 208240)


--- trunk/Source/WebCore/inspector/InspectorReplayAgent.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/inspector/InspectorReplayAgent.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -198,10 +198,10 @@
     m_segmentsMap.clear();
 }
 
-void InspectorReplayAgent::frameNavigated(DocumentLoader* loader)
+void InspectorReplayAgent::frameNavigated(Frame& frame)
 {
     if (sessionState() != WebCore::SessionState::Inactive)
-        m_page.replayController().frameNavigated(loader);
+        m_page.replayController().frameNavigated(frame);
 }
 
 void InspectorReplayAgent::frameDetached(Frame& frame)

Modified: trunk/Source/WebCore/inspector/InspectorReplayAgent.h (208239 => 208240)


--- trunk/Source/WebCore/inspector/InspectorReplayAgent.h	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/inspector/InspectorReplayAgent.h	2016-11-01 21:42:51 UTC (rev 208240)
@@ -67,7 +67,7 @@
     void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
 
     // InspectorInstrumentation callbacks.
-    void frameNavigated(DocumentLoader*);
+    void frameNavigated(Frame&);
     void frameDetached(Frame&);
     void willDispatchEvent(const Event&, Frame*);
 

Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp (208239 => 208240)


--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -325,7 +325,7 @@
     pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Layout, true, &frame);
 }
 
-void InspectorTimelineAgent::didLayout(RenderObject* root)
+void InspectorTimelineAgent::didLayout(RenderObject& root)
 {
     if (m_recordStack.isEmpty())
         return;
@@ -332,7 +332,7 @@
     TimelineRecordEntry& entry = m_recordStack.last();
     ASSERT(entry.type == TimelineRecordType::Layout);
     Vector<FloatQuad> quads;
-    root->absoluteQuads(quads);
+    root.absoluteQuads(quads);
     if (quads.size() >= 1)
         TimelineRecordFactory::appendLayoutRoot(entry.data.get(), quads[0]);
     else
@@ -374,12 +374,12 @@
     pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Paint, true, &frame);
 }
 
-void InspectorTimelineAgent::didPaint(RenderObject* renderer, const LayoutRect& clipRect)
+void InspectorTimelineAgent::didPaint(RenderObject& renderer, const LayoutRect& clipRect)
 {
     TimelineRecordEntry& entry = m_recordStack.last();
     ASSERT(entry.type == TimelineRecordType::Paint);
     FloatQuad quad;
-    localToPageQuad(*renderer, clipRect, &quad);
+    localToPageQuad(renderer, clipRect, &quad);
     entry.data = ""
     didCompleteCurrentRecord(TimelineRecordType::Paint);
 }

Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.h (208239 => 208240)


--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.h	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.h	2016-11-01 21:42:51 UTC (rev 208240)
@@ -124,11 +124,11 @@
     void didEvaluateScript(Frame&);
     void didInvalidateLayout(Frame&);
     void willLayout(Frame&);
-    void didLayout(RenderObject*);
+    void didLayout(RenderObject&);
     void willComposite(Frame&);
     void didComposite();
     void willPaint(Frame&);
-    void didPaint(RenderObject*, const LayoutRect&);
+    void didPaint(RenderObject&, const LayoutRect&);
     void willRecalculateStyle(Frame*);
     void didRecalculateStyle();
     void didScheduleStyleRecalculation(Frame*);

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (208239 => 208240)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -593,7 +593,7 @@
 
     // Do this after detaching the document so that the unload event works.
     if (clearWindowProperties) {
-        InspectorInstrumentation::frameWindowDiscarded(&m_frame, m_frame.document()->domWindow());
+        InspectorInstrumentation::frameWindowDiscarded(m_frame, m_frame.document()->domWindow());
         m_frame.document()->domWindow()->resetUnlessSuspendedForDocumentSuspension();
         m_frame.script().clearWindowShell(newDocument->domWindow(), m_frame.document()->pageCacheState() == Document::AboutToEnterPageCache);
     }

Modified: trunk/Source/WebCore/page/DOMTimer.cpp (208239 => 208240)


--- trunk/Source/WebCore/page/DOMTimer.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/page/DOMTimer.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -218,7 +218,7 @@
 #endif
 
     timer->suspendIfNeeded();
-    InspectorInstrumentation::didInstallTimer(&context, timer->m_timeoutId, timeout, singleShot);
+    InspectorInstrumentation::didInstallTimer(context, timer->m_timeoutId, timeout, singleShot);
 
     // Keep track of nested timer installs.
     if (NestedTimersMap* nestedTimers = NestedTimersMap::instanceForContext(context))
@@ -238,7 +238,7 @@
     if (NestedTimersMap* nestedTimers = NestedTimersMap::instanceForContext(context))
         nestedTimers->remove(timeoutId);
 
-    InspectorInstrumentation::didRemoveTimer(&context, timeoutId);
+    InspectorInstrumentation::didRemoveTimer(context, timeoutId);
     context.removeTimeout(timeoutId);
 }
 
@@ -311,7 +311,7 @@
     // Only the first execution of a multi-shot timer should get an affirmative user gesture indicator.
     m_userGestureTokenToForward = nullptr;
 
-    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireTimer(&context, m_timeoutId);
+    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireTimer(context, m_timeoutId);
 
     // Simple case for non-one-shot timers.
     if (isActive()) {

Modified: trunk/Source/WebCore/page/DOMWindow.cpp (208239 => 208240)


--- trunk/Source/WebCore/page/DOMWindow.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/page/DOMWindow.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -491,7 +491,8 @@
 
 void DOMWindow::willDetachPage()
 {
-    InspectorInstrumentation::frameWindowDiscarded(m_frame, this);
+    if (m_frame)
+        InspectorInstrumentation::frameWindowDiscarded(*m_frame, this);
 }
 
 void DOMWindow::willDestroyCachedFrame()

Modified: trunk/Source/WebCore/page/Frame.cpp (208239 => 208240)


--- trunk/Source/WebCore/page/Frame.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/page/Frame.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -280,7 +280,7 @@
     if (newDocument)
         newDocument->didBecomeCurrentDocumentInFrame();
 
-    InspectorInstrumentation::frameDocumentUpdated(this);
+    InspectorInstrumentation::frameDocumentUpdated(*this);
 }
 
 #if ENABLE(ORIENTATION_EVENTS)

Modified: trunk/Source/WebCore/page/FrameView.cpp (208239 => 208240)


--- trunk/Source/WebCore/page/FrameView.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/page/FrameView.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -1565,7 +1565,7 @@
         }
     }
 
-    InspectorInstrumentation::didLayout(cookie, root);
+    InspectorInstrumentation::didLayout(cookie, *root);
     DebugPageOverlays::didLayout(frame());
 
     --m_nestedLayoutCount;
@@ -4215,7 +4215,7 @@
     Document* document = frame().document();
 
     if (!context.paintingDisabled())
-        InspectorInstrumentation::willPaint(renderView());
+        InspectorInstrumentation::willPaint(*renderView());
 
     paintingState.isTopLevelPainter = !sCurrentPaintTimeStamp;
 
@@ -4273,7 +4273,7 @@
         sCurrentPaintTimeStamp = 0;
 
     if (!context.paintingDisabled()) {
-        InspectorInstrumentation::didPaint(renderView(), dirtyRect);
+        InspectorInstrumentation::didPaint(*renderView(), dirtyRect);
         // FIXME: should probably not fire milestones for snapshot painting. https://bugs.webkit.org/show_bug.cgi?id=117623
         firePaintRelatedMilestonesIfNeeded();
     }

Modified: trunk/Source/WebCore/page/Page.cpp (208239 => 208240)


--- trunk/Source/WebCore/page/Page.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/page/Page.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -145,7 +145,7 @@
     for (auto& page : *allPages) {
         for (Frame* frame = &page->mainFrame(); frame; frame = frame->tree().traverseNext())
             frames.append(*frame);
-        InspectorInstrumentation::networkStateChanged(page);
+        InspectorInstrumentation::networkStateChanged(*page);
     }
 
     AtomicString eventName = isOnLine ? eventNames().onlineEvent : eventNames().offlineEvent;

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (208239 => 208240)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -2433,7 +2433,7 @@
         || graphicsLayer == m_maskLayer.get()
         || graphicsLayer == m_childClippingMaskLayer.get()
         || graphicsLayer == m_scrollingContentsLayer.get()) {
-        InspectorInstrumentation::willPaint(&renderer());
+        InspectorInstrumentation::willPaint(renderer());
 
         if (!(paintingPhase & GraphicsLayerPaintOverflowContents))
             dirtyRect.intersect(enclosingIntRect(compositedBoundsIncludingMargin()));
@@ -2441,7 +2441,7 @@
         // We have to use the same root as for hit testing, because both methods can compute and cache clipRects.
         paintIntoLayer(graphicsLayer, context, dirtyRect, PaintBehaviorNormal, paintingPhase);
 
-        InspectorInstrumentation::didPaint(&renderer(), dirtyRect);
+        InspectorInstrumentation::didPaint(renderer(), dirtyRect);
     } else if (graphicsLayer == layerForHorizontalScrollbar()) {
         paintScrollbar(m_owningLayer.horizontalScrollbar(), context, dirtyRect);
     } else if (graphicsLayer == layerForVerticalScrollbar()) {

Modified: trunk/Source/WebCore/replay/ReplayController.cpp (208239 => 208240)


--- trunk/Source/WebCore/replay/ReplayController.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/replay/ReplayController.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -403,10 +403,9 @@
     startPlayback();
 }
 
-void ReplayController::frameNavigated(DocumentLoader* loader)
+void ReplayController::frameNavigated(Frame& frame)
 {
     ASSERT(m_sessionState != SessionState::Inactive);
-    ASSERT_ARG(loader, loader);
     
     // The initial capturing segment is created prior to main frame navigation.
     // Otherwise, the prior capturing segment was completed when the frame detached,
@@ -421,8 +420,8 @@
 
     // We store the input cursor in both Document and JSDOMWindow, so that
     // replay state is accessible from _javascript_Core and script-free layout code.
-    loader->frame()->document()->setInputCursor(*m_activeCursor);
-    loader->frame()->script().globalObject(mainThreadNormalWorld())->setInputCursor(m_activeCursor.get());
+    frame.document()->setInputCursor(*m_activeCursor);
+    frame.script().globalObject(mainThreadNormalWorld())->setInputCursor(m_activeCursor.get());
 }
 
 void ReplayController::frameDetached(Frame& frame)

Modified: trunk/Source/WebCore/replay/ReplayController.h (208239 => 208240)


--- trunk/Source/WebCore/replay/ReplayController.h	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/replay/ReplayController.h	2016-11-01 21:42:51 UTC (rev 208240)
@@ -131,7 +131,7 @@
     void switchSession(RefPtr<ReplaySession>&&);
 
     // InspectorReplayAgent notifications.
-    void frameNavigated(DocumentLoader*);
+    void frameNavigated(Frame&);
     void frameDetached(Frame&);
     void willDispatchEvent(const Event&, Frame*);
 

Modified: trunk/Source/WebCore/storage/StorageEventDispatcher.cpp (208239 => 208240)


--- trunk/Source/WebCore/storage/StorageEventDispatcher.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/storage/StorageEventDispatcher.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -76,7 +76,7 @@
 
 void StorageEventDispatcher::dispatchSessionStorageEventsToFrames(Page& page, const Vector<RefPtr<Frame>>& frames, const String& key, const String& oldValue, const String& newValue, const String& url, SecurityOrigin* securityOrigin)
 {
-    InspectorInstrumentation::didDispatchDOMStorageEvent(key, oldValue, newValue, SessionStorage, securityOrigin, &page);
+    InspectorInstrumentation::didDispatchDOMStorageEvent(page, key, oldValue, newValue, SessionStorage, securityOrigin);
 
     for (auto& frame : frames) {
         auto result = frame->document()->domWindow()->sessionStorage();
@@ -88,7 +88,7 @@
 void StorageEventDispatcher::dispatchLocalStorageEventsToFrames(PageGroup& pageGroup, const Vector<RefPtr<Frame>>& frames, const String& key, const String& oldValue, const String& newValue, const String& url, SecurityOrigin* securityOrigin)
 {
     for (auto& page : pageGroup.pages())
-        InspectorInstrumentation::didDispatchDOMStorageEvent(key, oldValue, newValue, LocalStorage, securityOrigin, page);
+        InspectorInstrumentation::didDispatchDOMStorageEvent(*page, key, oldValue, newValue, LocalStorage, securityOrigin);
 
     for (auto& frame : frames) {
         auto result = frame->document()->domWindow()->localStorage();

Modified: trunk/Source/WebCore/workers/Worker.cpp (208239 => 208240)


--- trunk/Source/WebCore/workers/Worker.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/workers/Worker.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -156,7 +156,7 @@
     else {
         const ContentSecurityPolicyResponseHeaders& contentSecurityPolicyResponseHeaders = m_contentSecurityPolicyResponseHeaders ? m_contentSecurityPolicyResponseHeaders.value() : scriptExecutionContext()->contentSecurityPolicy()->responseHeaders();
         m_contextProxy->startWorkerGlobalScope(m_scriptLoader->url(), scriptExecutionContext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script(), contentSecurityPolicyResponseHeaders, m_shouldBypassMainWorldContentSecurityPolicy, m_runtimeFlags);
-        InspectorInstrumentation::scriptImported(scriptExecutionContext(), m_scriptLoader->identifier(), m_scriptLoader->script());
+        InspectorInstrumentation::scriptImported(*scriptExecutionContext(), m_scriptLoader->identifier(), m_scriptLoader->script());
     }
     m_scriptLoader = nullptr;
 

Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.cpp (208239 => 208240)


--- trunk/Source/WebCore/workers/WorkerGlobalScope.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -228,7 +228,7 @@
         if (scriptLoader->failed())
             return Exception { NETWORK_ERR };
 
-        InspectorInstrumentation::scriptImported(this, scriptLoader->identifier(), scriptLoader->script());
+        InspectorInstrumentation::scriptImported(*this, scriptLoader->identifier(), scriptLoader->script());
 
         NakedPtr<JSC::Exception> exception;
         m_script->evaluate(ScriptSourceCode(scriptLoader->script(), scriptLoader->responseURL()), exception);
@@ -258,7 +258,7 @@
         return;
     }
 
-    InspectorInstrumentation::addMessageToConsole(this, WTFMove(message));
+    InspectorInstrumentation::addMessageToConsole(*this, WTFMove(message));
 }
 
 void WorkerGlobalScope::addConsoleMessage(MessageSource source, MessageLevel level, const String& message, unsigned long requestIdentifier)
@@ -278,7 +278,7 @@
         message = std::make_unique<Inspector::ConsoleMessage>(source, MessageType::Log, level, messageText, WTFMove(callStack), requestIdentifier);
     else
         message = std::make_unique<Inspector::ConsoleMessage>(source, MessageType::Log, level, messageText, sourceURL, lineNumber, columnNumber, state, requestIdentifier);
-    InspectorInstrumentation::addMessageToConsole(this, WTFMove(message));
+    InspectorInstrumentation::addMessageToConsole(*this, WTFMove(message));
 }
 
 bool WorkerGlobalScope::isContextThread() const

Modified: trunk/Source/WebCore/workers/WorkerInspectorProxy.cpp (208239 => 208240)


--- trunk/Source/WebCore/workers/WorkerInspectorProxy.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/workers/WorkerInspectorProxy.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -56,7 +56,7 @@
     ASSERT(!m_pageChannel);
 }
 
-WorkerThreadStartMode WorkerInspectorProxy::workerStartMode(ScriptExecutionContext* scriptExecutionContext)
+WorkerThreadStartMode WorkerInspectorProxy::workerStartMode(ScriptExecutionContext& scriptExecutionContext)
 {
     bool pauseOnStart = InspectorInstrumentation::shouldWaitForDebuggerOnStart(scriptExecutionContext);
     return pauseOnStart ? WorkerThreadStartMode::WaitForInspector : WorkerThreadStartMode::Normal;
@@ -72,7 +72,7 @@
 
     allWorkerInspectorProxies().add(this);
 
-    InspectorInstrumentation::workerStarted(m_scriptExecutionContext.get(), this, m_url);
+    InspectorInstrumentation::workerStarted(*m_scriptExecutionContext.get(), this, m_url);
 }
 
 void WorkerInspectorProxy::workerTerminated()
@@ -80,7 +80,7 @@
     if (!m_workerThread)
         return;
 
-    InspectorInstrumentation::workerTerminated(m_scriptExecutionContext.get(), this);
+    InspectorInstrumentation::workerTerminated(*m_scriptExecutionContext.get(), this);
 
     allWorkerInspectorProxies().remove(this);
 

Modified: trunk/Source/WebCore/workers/WorkerInspectorProxy.h (208239 => 208240)


--- trunk/Source/WebCore/workers/WorkerInspectorProxy.h	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/workers/WorkerInspectorProxy.h	2016-11-01 21:42:51 UTC (rev 208240)
@@ -58,7 +58,7 @@
     const String& identifier() const { return m_identifier; }
     ScriptExecutionContext* scriptExecutionContext() const { return m_scriptExecutionContext.get(); }
 
-    WorkerThreadStartMode workerStartMode(ScriptExecutionContext*);
+    WorkerThreadStartMode workerStartMode(ScriptExecutionContext&);
     void workerStarted(ScriptExecutionContext*, WorkerThread*, const URL&);
     void workerTerminated();
 

Modified: trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp (208239 => 208240)


--- trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp	2016-11-01 21:31:40 UTC (rev 208239)
+++ trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp	2016-11-01 21:42:51 UTC (rev 208240)
@@ -79,7 +79,7 @@
     // FIXME: This need to be revisited when we support nested worker one day
     ASSERT(m_scriptExecutionContext);
     Document& document = downcast<Document>(*m_scriptExecutionContext);
-    WorkerThreadStartMode startMode = m_inspectorProxy->workerStartMode(m_scriptExecutionContext.get());
+    WorkerThreadStartMode startMode = m_inspectorProxy->workerStartMode(*m_scriptExecutionContext.get());
 
 #if ENABLE(INDEXED_DATABASE)
     IDBClient::IDBConnectionProxy* proxy = document.idbConnectionProxy();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to