Changeset 189218 in webkit


Ignore:
Timestamp:
Sep 1, 2015 10:52:15 AM (9 years ago)
Author:
BJ Burg
Message:

Web Inspector: tighten up lifetimes for InspectorController-owned objects; add brace initializers to agents
https://bugs.webkit.org/show_bug.cgi?id=148612

Reviewed by Joseph Pecoraro.

Both InjectedScriptManager and AgentRegistry (thus all agents) are
Source/JavaScriptCore:

owned by JSGlobalObjectInspectorController. So, use references.

Add brace initalizers for scalar and pointer members in agent classes.

  • inspector/ConsoleMessage.cpp:

(Inspector::ConsoleMessage::addToFrontend):
(Inspector::ConsoleMessage::updateRepeatCountInConsole):
(Inspector::ConsoleMessage::ConsoleMessage):

  • inspector/ConsoleMessage.h:
  • inspector/JSGlobalObjectInspectorController.cpp:

(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):

  • inspector/agents/InspectorAgent.cpp:

(Inspector::InspectorAgent::InspectorAgent):

  • inspector/agents/InspectorAgent.h:
  • inspector/agents/InspectorConsoleAgent.cpp:

(Inspector::InspectorConsoleAgent::InspectorConsoleAgent):
(Inspector::InspectorConsoleAgent::enable):
(Inspector::InspectorConsoleAgent::clearMessages):
(Inspector::InspectorConsoleAgent::addMessageToConsole):
(Inspector::InspectorConsoleAgent::addConsoleMessage):

  • inspector/agents/InspectorConsoleAgent.h:
  • inspector/agents/InspectorDebuggerAgent.cpp:

(Inspector::InspectorDebuggerAgent::InspectorDebuggerAgent):
(Inspector::InspectorDebuggerAgent::removeBreakpoint):
(Inspector::InspectorDebuggerAgent::getFunctionDetails):
(Inspector::InspectorDebuggerAgent::evaluateOnCallFrame):
(Inspector::InspectorDebuggerAgent::didPause):
(Inspector::InspectorDebuggerAgent::breakpointActionProbe):
(Inspector::InspectorDebuggerAgent::didContinue):
(Inspector::InspectorDebuggerAgent::clearExceptionValue):

  • inspector/agents/InspectorDebuggerAgent.h:
  • inspector/agents/InspectorRuntimeAgent.cpp:

(Inspector::InspectorRuntimeAgent::InspectorRuntimeAgent):
(Inspector::InspectorRuntimeAgent::callFunctionOn):
(Inspector::InspectorRuntimeAgent::getProperties):
(Inspector::InspectorRuntimeAgent::getDisplayableProperties):
(Inspector::InspectorRuntimeAgent::getCollectionEntries):
(Inspector::InspectorRuntimeAgent::saveResult):
(Inspector::InspectorRuntimeAgent::releaseObject):
(Inspector::InspectorRuntimeAgent::releaseObjectGroup):

  • inspector/agents/InspectorRuntimeAgent.h:
  • inspector/agents/JSGlobalObjectConsoleAgent.cpp:

(Inspector::JSGlobalObjectConsoleAgent::JSGlobalObjectConsoleAgent):

  • inspector/agents/JSGlobalObjectConsoleAgent.h:
  • inspector/agents/JSGlobalObjectDebuggerAgent.cpp:

(Inspector::JSGlobalObjectDebuggerAgent::JSGlobalObjectDebuggerAgent):
(Inspector::JSGlobalObjectDebuggerAgent::injectedScriptForEval):

  • inspector/agents/JSGlobalObjectDebuggerAgent.h:
  • inspector/agents/JSGlobalObjectRuntimeAgent.cpp:

(Inspector::JSGlobalObjectRuntimeAgent::JSGlobalObjectRuntimeAgent):
(Inspector::JSGlobalObjectRuntimeAgent::injectedScriptForEval):

  • inspector/agents/JSGlobalObjectRuntimeAgent.h:

Source/WebCore:

owned by [Worker]InspectorController. So, use references.

InstrumentingAgents is morally owned by InspectorController as well, but
must be a Ref for now since instrumentation cookies take a strong reference.

Add brace initalizers for scalar and pointer members in agent classes.

No new tests, no behavior change.

  • inspector/InspectorApplicationCacheAgent.cpp:

(WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
(WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorApplicationCacheAgent::enable):

  • inspector/InspectorApplicationCacheAgent.h:
  • inspector/InspectorCSSAgent.cpp:

(WebCore::InspectorCSSAgent::InspectorCSSAgent):
(WebCore::InspectorCSSAgent::enable):
(WebCore::InspectorCSSAgent::disable):

  • inspector/InspectorCSSAgent.h:
  • inspector/InspectorConsoleInstrumentation.h:

(WebCore::InspectorInstrumentation::addMessageToConsole):
(WebCore::InspectorInstrumentation::consoleCount):
(WebCore::InspectorInstrumentation::startProfiling):
(WebCore::InspectorInstrumentation::stopProfiling):

  • inspector/InspectorController.cpp:

(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::connectFrontend):
(WebCore::InspectorController::disconnectFrontend):
(WebCore::InspectorController::disconnectAllFrontends):

  • inspector/InspectorController.h:
  • inspector/InspectorDOMAgent.cpp:

(WebCore::InspectorDOMAgent::InspectorDOMAgent):
(WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
(WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorDOMAgent::focusNode):
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
(WebCore::InspectorDOMAgent::nodeForObjectId):
(WebCore::InspectorDOMAgent::resolveNode):

  • inspector/InspectorDOMAgent.h:
  • inspector/InspectorDOMDebuggerAgent.cpp:

(WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
(WebCore::InspectorDOMDebuggerAgent::~InspectorDOMDebuggerAgent):
(WebCore::InspectorDOMDebuggerAgent::debuggerWasEnabled):
(WebCore::InspectorDOMDebuggerAgent::disable):

  • inspector/InspectorDOMDebuggerAgent.h:
  • inspector/InspectorDOMStorageAgent.cpp:

(WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
(WebCore::InspectorDOMStorageAgent::~InspectorDOMStorageAgent):

  • inspector/InspectorDOMStorageAgent.h:
  • inspector/InspectorDatabaseAgent.cpp:

(WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
(WebCore::InspectorDatabaseAgent::~InspectorDatabaseAgent):

  • inspector/InspectorDatabaseAgent.h:
  • inspector/InspectorIndexedDBAgent.cpp:

(WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
(WebCore::InspectorIndexedDBAgent::requestData):

  • inspector/InspectorIndexedDBAgent.h:
  • inspector/InspectorInstrumentation.cpp:

(WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
(WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):

  • inspector/InspectorInstrumentation.h:

(WebCore::InspectorInstrumentation::mouseDidMoveOverElement):
(WebCore::InspectorInstrumentation::scriptsEnabled):
(WebCore::InspectorInstrumentation::didScroll):
(WebCore::InspectorInstrumentation::markResourceAsCached):
(WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCache):
(WebCore::InspectorInstrumentation::willRunJavaScriptDialog):
(WebCore::InspectorInstrumentation::sessionCreated):
(WebCore::InspectorInstrumentation::sessionLoaded):
(WebCore::InspectorInstrumentation::sessionModified):
(WebCore::InspectorInstrumentation::segmentCreated):
(WebCore::InspectorInstrumentation::segmentCompleted):
(WebCore::InspectorInstrumentation::segmentLoaded):
(WebCore::InspectorInstrumentation::segmentUnloaded):
(WebCore::InspectorInstrumentation::captureStarted):
(WebCore::InspectorInstrumentation::captureStopped):
(WebCore::InspectorInstrumentation::playbackStarted):
(WebCore::InspectorInstrumentation::playbackPaused):
(WebCore::InspectorInstrumentation::playbackFinished):
(WebCore::InspectorInstrumentation::playbackHitPosition):

  • inspector/InspectorLayerTreeAgent.cpp:

(WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent):
(WebCore::InspectorLayerTreeAgent::enable):
(WebCore::InspectorLayerTreeAgent::disable):
(WebCore::InspectorLayerTreeAgent::layersForNode):
(WebCore::InspectorLayerTreeAgent::idForNode):

  • inspector/InspectorLayerTreeAgent.h:
  • inspector/InspectorPageAgent.cpp:

(WebCore::InspectorPageAgent::InspectorPageAgent):
(WebCore::InspectorPageAgent::timestamp):
(WebCore::InspectorPageAgent::enable):
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::frameStartedLoading):
(WebCore::InspectorPageAgent::snapshotNode):

  • inspector/InspectorPageAgent.h:
  • inspector/InspectorReplayAgent.cpp:

(WebCore::InspectorReplayAgent::InspectorReplayAgent):
(WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
(WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):

  • inspector/InspectorReplayAgent.h:
  • inspector/InspectorResourceAgent.cpp:

(WebCore::InspectorResourceAgent::InspectorResourceAgent):
(WebCore::InspectorResourceAgent::~InspectorResourceAgent):
(WebCore::InspectorResourceAgent::timestamp):
(WebCore::InspectorResourceAgent::enable):
(WebCore::InspectorResourceAgent::disable):

  • inspector/InspectorResourceAgent.h:
  • inspector/InspectorTimelineAgent.cpp:

(WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
(WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorTimelineAgent::internalStart):
(WebCore::InspectorTimelineAgent::internalStop):
(WebCore::InspectorTimelineAgent::timestamp):
(WebCore::InspectorTimelineAgent::startFromConsole):
(WebCore::InspectorTimelineAgent::willCallFunction):
(WebCore::InspectorTimelineAgent::willEvaluateScript):
(WebCore::InspectorTimelineAgent::InspectorTimelineAgent):

  • inspector/InspectorTimelineAgent.h:
  • inspector/InspectorWebAgentBase.h:

(WebCore::InspectorAgentBase::InspectorAgentBase):

  • inspector/InspectorWorkerAgent.cpp:

(WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
(WebCore::InspectorWorkerAgent::~InspectorWorkerAgent):

  • inspector/InspectorWorkerAgent.h:
  • inspector/InstrumentingAgents.cpp:

(WebCore::InstrumentingAgents::InstrumentingAgents): Deleted.

  • inspector/InstrumentingAgents.h:

(WebCore::InstrumentingAgents::create):

  • inspector/PageConsoleAgent.cpp:

(WebCore::PageConsoleAgent::PageConsoleAgent):
(WebCore::PageConsoleAgent::addInspectedNode):

  • inspector/PageConsoleAgent.h:
  • inspector/PageDebuggerAgent.cpp:

(WebCore::PageDebuggerAgent::PageDebuggerAgent):
(WebCore::PageDebuggerAgent::enable):
(WebCore::PageDebuggerAgent::disable):
(WebCore::PageDebuggerAgent::injectedScriptForEval):

  • inspector/PageDebuggerAgent.h:
  • inspector/PageRuntimeAgent.cpp:

(WebCore::PageRuntimeAgent::PageRuntimeAgent):
(WebCore::PageRuntimeAgent::injectedScriptForEval):
(WebCore::PageRuntimeAgent::notifyContextCreated):

  • inspector/PageRuntimeAgent.h:
  • inspector/WebConsoleAgent.cpp:

(WebCore::WebConsoleAgent::WebConsoleAgent):
(WebCore::WebConsoleAgent::frameWindowDiscarded):
(WebCore::WebConsoleAgent::didFinishXHRLoading):
(WebCore::WebConsoleAgent::didReceiveResponse):
(WebCore::WebConsoleAgent::didFailLoading):

  • inspector/WebConsoleAgent.h:
  • inspector/WebDebuggerAgent.cpp:

(WebCore::WebDebuggerAgent::WebDebuggerAgent):
(WebCore::WebDebuggerAgent::enable):
(WebCore::WebDebuggerAgent::disable):

  • inspector/WebDebuggerAgent.h:
  • inspector/WorkerConsoleAgent.cpp:

(WebCore::WorkerConsoleAgent::WorkerConsoleAgent):

  • inspector/WorkerConsoleAgent.h:
  • inspector/WorkerDebuggerAgent.cpp:

(WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
(WebCore::WorkerDebuggerAgent::injectedScriptForEval):

  • inspector/WorkerDebuggerAgent.h:
  • inspector/WorkerInspectorController.cpp:

(WebCore::WorkerInspectorController::WorkerInspectorController):

  • inspector/WorkerInspectorController.h:
  • inspector/WorkerRuntimeAgent.cpp:

(WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
(WebCore::WorkerRuntimeAgent::injectedScriptForEval):

  • inspector/WorkerRuntimeAgent.h:
Location:
trunk/Source
Files:
71 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r189201 r189218  
     12015-09-01  Brian Burg  <bburg@apple.com>
     2
     3        Web Inspector: tighten up lifetimes for InspectorController-owned objects; add brace initializers to agents
     4        https://bugs.webkit.org/show_bug.cgi?id=148612
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        Both InjectedScriptManager and AgentRegistry (thus all agents) are
     9        owned by JSGlobalObjectInspectorController. So, use references.
     10
     11        Add brace initalizers for scalar and pointer members in agent classes.
     12
     13        * inspector/ConsoleMessage.cpp:
     14        (Inspector::ConsoleMessage::addToFrontend):
     15        (Inspector::ConsoleMessage::updateRepeatCountInConsole):
     16        (Inspector::ConsoleMessage::ConsoleMessage):
     17        * inspector/ConsoleMessage.h:
     18        * inspector/JSGlobalObjectInspectorController.cpp:
     19        (Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
     20        * inspector/agents/InspectorAgent.cpp:
     21        (Inspector::InspectorAgent::InspectorAgent):
     22        * inspector/agents/InspectorAgent.h:
     23        * inspector/agents/InspectorConsoleAgent.cpp:
     24        (Inspector::InspectorConsoleAgent::InspectorConsoleAgent):
     25        (Inspector::InspectorConsoleAgent::enable):
     26        (Inspector::InspectorConsoleAgent::clearMessages):
     27        (Inspector::InspectorConsoleAgent::addMessageToConsole):
     28        (Inspector::InspectorConsoleAgent::addConsoleMessage):
     29        * inspector/agents/InspectorConsoleAgent.h:
     30        * inspector/agents/InspectorDebuggerAgent.cpp:
     31        (Inspector::InspectorDebuggerAgent::InspectorDebuggerAgent):
     32        (Inspector::InspectorDebuggerAgent::removeBreakpoint):
     33        (Inspector::InspectorDebuggerAgent::getFunctionDetails):
     34        (Inspector::InspectorDebuggerAgent::evaluateOnCallFrame):
     35        (Inspector::InspectorDebuggerAgent::didPause):
     36        (Inspector::InspectorDebuggerAgent::breakpointActionProbe):
     37        (Inspector::InspectorDebuggerAgent::didContinue):
     38        (Inspector::InspectorDebuggerAgent::clearExceptionValue):
     39        * inspector/agents/InspectorDebuggerAgent.h:
     40        * inspector/agents/InspectorRuntimeAgent.cpp:
     41        (Inspector::InspectorRuntimeAgent::InspectorRuntimeAgent):
     42        (Inspector::InspectorRuntimeAgent::callFunctionOn):
     43        (Inspector::InspectorRuntimeAgent::getProperties):
     44        (Inspector::InspectorRuntimeAgent::getDisplayableProperties):
     45        (Inspector::InspectorRuntimeAgent::getCollectionEntries):
     46        (Inspector::InspectorRuntimeAgent::saveResult):
     47        (Inspector::InspectorRuntimeAgent::releaseObject):
     48        (Inspector::InspectorRuntimeAgent::releaseObjectGroup):
     49        * inspector/agents/InspectorRuntimeAgent.h:
     50        * inspector/agents/JSGlobalObjectConsoleAgent.cpp:
     51        (Inspector::JSGlobalObjectConsoleAgent::JSGlobalObjectConsoleAgent):
     52        * inspector/agents/JSGlobalObjectConsoleAgent.h:
     53        * inspector/agents/JSGlobalObjectDebuggerAgent.cpp:
     54        (Inspector::JSGlobalObjectDebuggerAgent::JSGlobalObjectDebuggerAgent):
     55        (Inspector::JSGlobalObjectDebuggerAgent::injectedScriptForEval):
     56        * inspector/agents/JSGlobalObjectDebuggerAgent.h:
     57        * inspector/agents/JSGlobalObjectRuntimeAgent.cpp:
     58        (Inspector::JSGlobalObjectRuntimeAgent::JSGlobalObjectRuntimeAgent):
     59        (Inspector::JSGlobalObjectRuntimeAgent::injectedScriptForEval):
     60        * inspector/agents/JSGlobalObjectRuntimeAgent.h:
     61
    1622015-08-31  Yusuke Suzuki  <utatane.tea@gmail.com>
    263
  • trunk/Source/JavaScriptCore/inspector/ConsoleMessage.cpp

    r186279 r189218  
    11/*
    2  * Copyright (C) 2007, 2008, 2014 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007, 2008, 2014, 2015 Apple Inc. All rights reserved.
    33 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
    44 * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
     
    5050    , m_message(message)
    5151    , m_url()
    52     , m_line(0)
    53     , m_column(0)
    54     , m_repeatCount(1)
    5552    , m_requestId(IdentifiersFactory::requestId(requestIdentifier))
    5653{
     
    6562    , m_line(line)
    6663    , m_column(column)
    67     , m_repeatCount(1)
    6864    , m_requestId(IdentifiersFactory::requestId(requestIdentifier))
    6965{
     
    7773    , m_message(message)
    7874    , m_url()
    79     , m_line(0)
    80     , m_column(0)
    81     , m_repeatCount(1)
    8275    , m_requestId(IdentifiersFactory::requestId(requestIdentifier))
    8376{
     
    9992    , m_arguments(arguments)
    10093    , m_url()
    101     , m_line(0)
    102     , m_column(0)
    103     , m_repeatCount(1)
    10494    , m_requestId(IdentifiersFactory::requestId(requestIdentifier))
    10595{
     
    180170}
    181171
    182 void ConsoleMessage::addToFrontend(ConsoleFrontendDispatcher* consoleFrontendDispatcher, InjectedScriptManager* injectedScriptManager, bool generatePreview)
     172void ConsoleMessage::addToFrontend(ConsoleFrontendDispatcher& consoleFrontendDispatcher, InjectedScriptManager& injectedScriptManager, bool generatePreview)
    183173{
    184174    Ref<Inspector::Protocol::Console::ConsoleMessage> jsonObj = Inspector::Protocol::Console::ConsoleMessage::create()
     
    199189
    200190    if (m_arguments && m_arguments->argumentCount()) {
    201         InjectedScript injectedScript = injectedScriptManager->injectedScriptFor(m_arguments->globalState());
     191        InjectedScript injectedScript = injectedScriptManager.injectedScriptFor(m_arguments->globalState());
    202192        if (!injectedScript.hasNoValue()) {
    203193            Ref<Inspector::Protocol::Array<Inspector::Protocol::Runtime::RemoteObject>> jsonArgs = Inspector::Protocol::Array<Inspector::Protocol::Runtime::RemoteObject>::create();
     
    230220        jsonObj->setStackTrace(m_callStack->buildInspectorArray());
    231221
    232     consoleFrontendDispatcher->messageAdded(WTF::move(jsonObj));
    233 }
    234 
    235 void ConsoleMessage::updateRepeatCountInConsole(ConsoleFrontendDispatcher* consoleFrontendDispatcher)
    236 {
    237     consoleFrontendDispatcher->messageRepeatCountUpdated(m_repeatCount);
     222    consoleFrontendDispatcher.messageAdded(WTF::move(jsonObj));
     223}
     224
     225void ConsoleMessage::updateRepeatCountInConsole(ConsoleFrontendDispatcher& consoleFrontendDispatcher)
     226{
     227    consoleFrontendDispatcher.messageRepeatCountUpdated(m_repeatCount);
    238228}
    239229
  • trunk/Source/JavaScriptCore/inspector/ConsoleMessage.h

    r180116 r189218  
    11/*
    2  * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007, 2008, 2015 Apple Inc. All rights reserved.
    33 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
    44 * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
     
    5656    ~ConsoleMessage();
    5757
    58     void addToFrontend(ConsoleFrontendDispatcher*, InjectedScriptManager*, bool generatePreview);
    59     void updateRepeatCountInConsole(ConsoleFrontendDispatcher*);
     58    void addToFrontend(ConsoleFrontendDispatcher&, InjectedScriptManager&, bool generatePreview);
     59    void updateRepeatCountInConsole(ConsoleFrontendDispatcher&);
    6060
    6161    MessageSource source() const { return m_source; }
     
    8585    RefPtr<ScriptCallStack> m_callStack;
    8686    String m_url;
    87     unsigned m_line;
    88     unsigned m_column;
    89     unsigned m_repeatCount;
     87    unsigned m_line { 0 };
     88    unsigned m_column { 0 };
     89    unsigned m_repeatCount { 1 };
    9090    String m_requestId;
    9191};
  • trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp

    r186279 r189218  
    7373{
    7474    auto inspectorAgent = std::make_unique<InspectorAgent>(*this);
    75     auto runtimeAgent = std::make_unique<JSGlobalObjectRuntimeAgent>(m_injectedScriptManager.get(), m_globalObject);
    76     auto consoleAgent = std::make_unique<JSGlobalObjectConsoleAgent>(m_injectedScriptManager.get());
    77     auto debuggerAgent = std::make_unique<JSGlobalObjectDebuggerAgent>(m_injectedScriptManager.get(), m_globalObject, consoleAgent.get());
     75    auto runtimeAgent = std::make_unique<JSGlobalObjectRuntimeAgent>(*m_injectedScriptManager, m_globalObject);
     76    auto consoleAgent = std::make_unique<JSGlobalObjectConsoleAgent>(*m_injectedScriptManager);
     77    auto debuggerAgent = std::make_unique<JSGlobalObjectDebuggerAgent>(*m_injectedScriptManager, m_globalObject, consoleAgent.get());
    7878
    7979    m_inspectorAgent = inspectorAgent.get();
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp

    r186279 r189218  
    11/*
    2  * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007-2010, 2015 Apple Inc. All rights reserved.
    33 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
    44 * Copyright (C) 2011 Google Inc. All rights reserved.
     
    4141    : InspectorAgentBase(ASCIILiteral("Inspector"))
    4242    , m_environment(environment)
    43     , m_enabled(false)
    4443{
    4544}
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorAgent.h

    r180116 r189218  
    7676    RefPtr<Inspector::Protocol::Array<String>> m_pendingExtraDomainsData;
    7777#endif
    78     bool m_enabled;
     78    bool m_enabled { false };
    7979};
    8080
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp

    r186279 r189218  
    4343static const int expireConsoleMessagesStep = 100;
    4444
    45 InspectorConsoleAgent::InspectorConsoleAgent(InjectedScriptManager* injectedScriptManager)
     45InspectorConsoleAgent::InspectorConsoleAgent(InjectedScriptManager& injectedScriptManager)
    4646    : InspectorAgentBase(ASCIILiteral("Console"))
    4747    , m_injectedScriptManager(injectedScriptManager)
    48     , m_previousMessage(nullptr)
    49     , m_expiredConsoleMessageCount(0)
    50     , m_enabled(false)
    5148{
    5249}
     
    8077    if (m_expiredConsoleMessageCount) {
    8178        ConsoleMessage expiredMessage(MessageSource::Other, MessageType::Log, MessageLevel::Warning, String::format("%d console messages are not shown.", m_expiredConsoleMessageCount));
    82         expiredMessage.addToFrontend(m_frontendDispatcher.get(), m_injectedScriptManager, false);
     79        expiredMessage.addToFrontend(*m_frontendDispatcher, m_injectedScriptManager, false);
    8380    }
    8481
    8582    size_t messageCount = m_consoleMessages.size();
    8683    for (size_t i = 0; i < messageCount; ++i)
    87         m_consoleMessages[i]->addToFrontend(m_frontendDispatcher.get(), m_injectedScriptManager, false);
     84        m_consoleMessages[i]->addToFrontend(*m_frontendDispatcher, m_injectedScriptManager, false);
    8885}
    8986
     
    10299    m_previousMessage = nullptr;
    103100
    104     m_injectedScriptManager->releaseObjectGroup(ASCIILiteral("console"));
     101    m_injectedScriptManager.releaseObjectGroup(ASCIILiteral("console"));
    105102
    106103    if (m_frontendDispatcher && m_enabled)
     
    119116void InspectorConsoleAgent::addMessageToConsole(std::unique_ptr<ConsoleMessage> message)
    120117{
    121     if (!m_injectedScriptManager->inspectorEnvironment().developerExtrasEnabled())
     118    if (!m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled())
    122119        return;
    123120
     
    201198void InspectorConsoleAgent::addConsoleMessage(std::unique_ptr<ConsoleMessage> consoleMessage)
    202199{
    203     ASSERT(m_injectedScriptManager->inspectorEnvironment().developerExtrasEnabled());
     200    ASSERT(m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled());
    204201    ASSERT_ARG(consoleMessage, consoleMessage);
    205202
     
    207204        m_previousMessage->incrementCount();
    208205        if (m_frontendDispatcher && m_enabled)
    209             m_previousMessage->updateRepeatCountInConsole(m_frontendDispatcher.get());
     206            m_previousMessage->updateRepeatCountInConsole(*m_frontendDispatcher);
    210207    } else {
    211208        m_previousMessage = consoleMessage.get();
    212209        m_consoleMessages.append(WTF::move(consoleMessage));
    213210        if (m_frontendDispatcher && m_enabled)
    214             m_previousMessage->addToFrontend(m_frontendDispatcher.get(), m_injectedScriptManager, true);
     211            m_previousMessage->addToFrontend(*m_frontendDispatcher, m_injectedScriptManager, true);
    215212    }
    216213
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.h

    r180116 r189218  
    5353    WTF_MAKE_FAST_ALLOCATED;
    5454public:
    55     InspectorConsoleAgent(InjectedScriptManager*);
     55    InspectorConsoleAgent(InjectedScriptManager&);
    5656    virtual ~InspectorConsoleAgent();
    5757
     
    8181    void addConsoleMessage(std::unique_ptr<ConsoleMessage>);
    8282
    83     InjectedScriptManager* m_injectedScriptManager;
     83    InjectedScriptManager& m_injectedScriptManager;
    8484    std::unique_ptr<ConsoleFrontendDispatcher> m_frontendDispatcher;
    8585    RefPtr<ConsoleBackendDispatcher> m_backendDispatcher;
    86     ConsoleMessage* m_previousMessage;
     86    ConsoleMessage* m_previousMessage { nullptr };
    8787    Vector<std::unique_ptr<ConsoleMessage>> m_consoleMessages;
    88     int m_expiredConsoleMessageCount;
     88    int m_expiredConsoleMessageCount { 0 };
    8989    HashMap<String, unsigned> m_counts;
    9090    HashMap<String, double> m_times;
    91     bool m_enabled;
     91    bool m_enabled { false };
    9292};
    9393
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp

    r186279 r189218  
    5656}
    5757
    58 InspectorDebuggerAgent::InspectorDebuggerAgent(InjectedScriptManager* injectedScriptManager)
     58InspectorDebuggerAgent::InspectorDebuggerAgent(InjectedScriptManager& injectedScriptManager)
    5959    : InspectorAgentBase(ASCIILiteral("Debugger"))
    6060    , m_injectedScriptManager(injectedScriptManager)
     
    383383        const BreakpointActions& breakpointActions = scriptDebugServer().getActionsForBreakpoint(breakpointID);
    384384        for (auto& action : breakpointActions)
    385             m_injectedScriptManager->releaseObjectGroup(objectGroupForBreakpointAction(action));
     385            m_injectedScriptManager.releaseObjectGroup(objectGroupForBreakpointAction(action));
    386386
    387387        scriptDebugServer().removeBreakpoint(breakpointID);
     
    463463void InspectorDebuggerAgent::getFunctionDetails(ErrorString& errorString, const String& functionId, RefPtr<Inspector::Protocol::Debugger::FunctionDetails>& details)
    464464{
    465     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(functionId);
     465    InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(functionId);
    466466    if (injectedScript.hasNoValue()) {
    467467        errorString = ASCIILiteral("Function object id is obsolete");
     
    554554void InspectorDebuggerAgent::evaluateOnCallFrame(ErrorString& errorString, const String& callFrameId, const String& expression, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* generatePreview, const bool* saveResult, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown, Inspector::Protocol::OptOutput<int>* savedResultIndex)
    555555{
    556     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(callFrameId);
     556    InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(callFrameId);
    557557    if (injectedScript.hasNoValue()) {
    558558        errorString = ASCIILiteral("Inspected frame has gone");
     
    662662    m_currentCallStack = callFrames;
    663663
    664     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(scriptState);
     664    InjectedScript injectedScript = m_injectedScriptManager.injectedScriptFor(scriptState);
    665665
    666666    // If a high level pause pause reason is not already set, try to infer a reason from the debugger.
     
    713713        m_listener->didPause();
    714714
    715     RefPtr<Stopwatch> stopwatch = m_injectedScriptManager->inspectorEnvironment().executionStopwatch();
     715    RefPtr<Stopwatch> stopwatch = m_injectedScriptManager.inspectorEnvironment().executionStopwatch();
    716716    if (stopwatch && stopwatch->isActive()) {
    717717        stopwatch->stop();
     
    727727void InspectorDebuggerAgent::breakpointActionProbe(JSC::ExecState* scriptState, const ScriptBreakpointAction& action, unsigned batchId, unsigned sampleId, const Deprecated::ScriptValue& sample)
    728728{
    729     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(scriptState);
     729    InjectedScript injectedScript = m_injectedScriptManager.injectedScriptFor(scriptState);
    730730    RefPtr<Protocol::Runtime::RemoteObject> payload = injectedScript.wrapObject(sample, objectGroupForBreakpointAction(action), true);
    731731    auto result = Protocol::Debugger::ProbeSample::create()
     
    733733        .setBatchId(batchId)
    734734        .setSampleId(sampleId)
    735         .setTimestamp(m_injectedScriptManager->inspectorEnvironment().executionStopwatch()->elapsedTime())
     735        .setTimestamp(m_injectedScriptManager.inspectorEnvironment().executionStopwatch()->elapsedTime())
    736736        .setPayload(payload.release())
    737737        .release();
     
    744744    if (m_didPauseStopwatch) {
    745745        m_didPauseStopwatch = false;
    746         m_injectedScriptManager->inspectorEnvironment().executionStopwatch()->start();
     746        m_injectedScriptManager.inspectorEnvironment().executionStopwatch()->start();
    747747    }
    748748
    749749    m_pausedScriptState = nullptr;
    750750    m_currentCallStack = Deprecated::ScriptValue();
    751     m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtraceObjectGroup);
     751    m_injectedScriptManager.releaseObjectGroup(InspectorDebuggerAgent::backtraceObjectGroup);
    752752    clearBreakDetails();
    753753    clearExceptionValue();
     
    822822{
    823823    if (m_hasExceptionValue) {
    824         m_injectedScriptManager->clearExceptionValue();
     824        m_injectedScriptManager.clearExceptionValue();
    825825        m_hasExceptionValue = false;
    826826    }
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h

    r185722 r189218  
    110110
    111111protected:
    112     InspectorDebuggerAgent(InjectedScriptManager*);
     112    InspectorDebuggerAgent(InjectedScriptManager&);
    113113
    114     InjectedScriptManager* injectedScriptManager() const { return m_injectedScriptManager; }
     114    InjectedScriptManager& injectedScriptManager() const { return m_injectedScriptManager; }
    115115    virtual InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId) = 0;
    116116
     
    155155    typedef HashMap<JSC::BreakpointID, String> DebugServerBreakpointIDToBreakpointIdentifier;
    156156
    157     InjectedScriptManager* m_injectedScriptManager;
     157    InjectedScriptManager& m_injectedScriptManager;
    158158    std::unique_ptr<DebuggerFrontendDispatcher> m_frontendDispatcher;
    159159    RefPtr<DebuggerBackendDispatcher> m_backendDispatcher;
    160     Listener* m_listener {nullptr};
    161     JSC::ExecState* m_pausedScriptState {nullptr};
     160    Listener* m_listener { nullptr };
     161    JSC::ExecState* m_pausedScriptState { nullptr };
    162162    Deprecated::ScriptValue m_currentCallStack;
    163163    ScriptsMap m_scripts;
     
    168168    DebuggerFrontendDispatcher::Reason m_breakReason;
    169169    RefPtr<InspectorObject> m_breakAuxData;
    170     bool m_enabled {false};
    171     bool m_javaScriptPauseScheduled {false};
    172     bool m_hasExceptionValue {false};
    173     bool m_didPauseStopwatch {false};
     170    bool m_enabled { false };
     171    bool m_javaScriptPauseScheduled { false };
     172    bool m_hasExceptionValue { false };
     173    bool m_didPauseStopwatch { false };
    174174    RefPtr<WTF::Stopwatch> m_stopwatch;
    175175};
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp

    r188846 r189218  
    11/*
    2  * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
     2 * Copyright (C) 2013-2015 Apple Inc. All rights reserved.
    33 * Copyright (C) 2011 Google Inc. All rights reserved.
    44 *
     
    5757}
    5858
    59 InspectorRuntimeAgent::InspectorRuntimeAgent(InjectedScriptManager* injectedScriptManager)
     59InspectorRuntimeAgent::InspectorRuntimeAgent(InjectedScriptManager& injectedScriptManager)
    6060    : InspectorAgentBase(ASCIILiteral("Runtime"))
    6161    , m_injectedScriptManager(injectedScriptManager)
    62     , m_scriptDebugServer(nullptr)
    63     , m_enabled(false)
    64     , m_isTypeProfilingEnabled(false)
    6562{
    6663}
     
    138135void InspectorRuntimeAgent::callFunctionOn(ErrorString& errorString, const String& objectId, const String& expression, const InspectorArray* optionalArguments, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* generatePreview, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown)
    139136{
    140     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
     137    InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId);
    141138    if (injectedScript.hasNoValue()) {
    142139        errorString = ASCIILiteral("Inspected frame has gone");
     
    164161void InspectorRuntimeAgent::getProperties(ErrorString& errorString, const String& objectId, const bool* const ownProperties, const bool* const generatePreview, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::PropertyDescriptor>>& result, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::InternalPropertyDescriptor>>& internalProperties)
    165162{
    166     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
     163    InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId);
    167164    if (injectedScript.hasNoValue()) {
    168165        errorString = ASCIILiteral("Inspected frame has gone");
     
    182179void InspectorRuntimeAgent::getDisplayableProperties(ErrorString& errorString, const String& objectId, const bool* const generatePreview, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::PropertyDescriptor>>& result, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::InternalPropertyDescriptor>>& internalProperties)
    183180{
    184     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
     181    InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId);
    185182    if (injectedScript.hasNoValue()) {
    186183        errorString = ASCIILiteral("Inspected frame has gone");
     
    200197void InspectorRuntimeAgent::getCollectionEntries(ErrorString& errorString, const String& objectId, const String* objectGroup, const int* startIndex, const int* numberToFetch, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Runtime::CollectionEntry>>& entries)
    201198{
    202     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
     199    InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId);
    203200    if (injectedScript.hasNoValue()) {
    204201        errorString = ASCIILiteral("Inspected frame has gone");
     
    218215    String objectId;
    219216    if (callArgument.getString(ASCIILiteral("objectId"), objectId)) {
    220         injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
     217        injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId);
    221218        if (injectedScript.hasNoValue()) {
    222219            errorString = ASCIILiteral("Inspected frame has gone");
     
    234231void InspectorRuntimeAgent::releaseObject(ErrorString&, const String& objectId)
    235232{
    236     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
     233    InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId);
    237234    if (!injectedScript.hasNoValue())
    238235        injectedScript.releaseObject(objectId);
     
    241238void InspectorRuntimeAgent::releaseObjectGroup(ErrorString&, const String& objectGroup)
    242239{
    243     m_injectedScriptManager->releaseObjectGroup(objectGroup);
     240    m_injectedScriptManager.releaseObjectGroup(objectGroup);
    244241}
    245242
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h

    r185722 r189218  
    11/*
    2  * Copyright (C) 2013 Apple Inc. All rights reserved.
     2 * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
    33 * Copyright (C) 2011 Google Inc. All rights reserved.
    44 *
     
    8080
    8181protected:
    82     InspectorRuntimeAgent(InjectedScriptManager*);
     82    InspectorRuntimeAgent(InjectedScriptManager&);
    8383
    84     InjectedScriptManager* injectedScriptManager() { return m_injectedScriptManager; }
     84    InjectedScriptManager& injectedScriptManager() { return m_injectedScriptManager; }
    8585
    8686    virtual JSC::VM& globalVM() = 0;
     
    9393    void setTypeProfilerEnabledState(bool);
    9494
    95     InjectedScriptManager* m_injectedScriptManager;
    96     ScriptDebugServer* m_scriptDebugServer;
    97     bool m_enabled;
    98     bool m_isTypeProfilingEnabled;
     95    InjectedScriptManager& m_injectedScriptManager;
     96    ScriptDebugServer* m_scriptDebugServer { nullptr };
     97    bool m_enabled { false };
     98    bool m_isTypeProfilingEnabled { false };
    9999};
    100100
  • trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectConsoleAgent.cpp

    r178820 r189218  
    11/*
    2  * Copyright (C) 2014 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2929namespace Inspector {
    3030
    31 JSGlobalObjectConsoleAgent::JSGlobalObjectConsoleAgent(InjectedScriptManager* injectedScriptManager)
     31JSGlobalObjectConsoleAgent::JSGlobalObjectConsoleAgent(InjectedScriptManager& injectedScriptManager)
    3232    : InspectorConsoleAgent(injectedScriptManager)
    3333{
  • trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectConsoleAgent.h

    r178820 r189218  
    11/*
    2  * Copyright (C) 2014 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3636    WTF_MAKE_FAST_ALLOCATED;
    3737public:
    38     JSGlobalObjectConsoleAgent(InjectedScriptManager*);
     38    JSGlobalObjectConsoleAgent(InjectedScriptManager&);
    3939    virtual ~JSGlobalObjectConsoleAgent() { }
    4040
  • trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.cpp

    r178820 r189218  
    11/*
    2  * Copyright (C) 2014 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3939namespace Inspector {
    4040
    41 JSGlobalObjectDebuggerAgent::JSGlobalObjectDebuggerAgent(InjectedScriptManager* injectedScriptManager, JSC::JSGlobalObject& globalObject, InspectorConsoleAgent* consoleAgent)
     41JSGlobalObjectDebuggerAgent::JSGlobalObjectDebuggerAgent(InjectedScriptManager& injectedScriptManager, JSC::JSGlobalObject& globalObject, InspectorConsoleAgent* consoleAgent)
    4242    : InspectorDebuggerAgent(injectedScriptManager)
    4343    , m_scriptDebugServer(globalObject)
     
    6464
    6565    ExecState* exec = m_scriptDebugServer.globalObject().globalExec();
    66     return injectedScriptManager()->injectedScriptFor(exec);
     66    return injectedScriptManager().injectedScriptFor(exec);
    6767}
    6868
  • trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.h

    r178820 r189218  
    11/*
    2  * Copyright (C) 2014 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3838    WTF_MAKE_FAST_ALLOCATED;
    3939public:
    40     JSGlobalObjectDebuggerAgent(InjectedScriptManager*, JSC::JSGlobalObject&, InspectorConsoleAgent*);
     40    JSGlobalObjectDebuggerAgent(InjectedScriptManager&, JSC::JSGlobalObject&, InspectorConsoleAgent*);
    4141    virtual ~JSGlobalObjectDebuggerAgent() { }
    4242
     
    5656private:
    5757    JSGlobalObjectScriptDebugServer m_scriptDebugServer;
    58     InspectorConsoleAgent* m_consoleAgent;
     58    InspectorConsoleAgent* m_consoleAgent { nullptr };
    5959};
    6060
  • trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.cpp

    r186279 r189218  
    3535namespace Inspector {
    3636
    37 JSGlobalObjectRuntimeAgent::JSGlobalObjectRuntimeAgent(InjectedScriptManager* injectedScriptManager, JSGlobalObject& globalObject)
     37JSGlobalObjectRuntimeAgent::JSGlobalObjectRuntimeAgent(InjectedScriptManager& injectedScriptManager, JSGlobalObject& globalObject)
    3838    : InspectorRuntimeAgent(injectedScriptManager)
    3939    , m_globalObject(globalObject)
     
    6565
    6666    JSC::ExecState* scriptState = m_globalObject.globalExec();
    67     InjectedScript injectedScript = injectedScriptManager()->injectedScriptFor(scriptState);
     67    InjectedScript injectedScript = injectedScriptManager().injectedScriptFor(scriptState);
    6868    if (injectedScript.hasNoValue())
    6969        errorString = ASCIILiteral("Internal error: main world execution context not found.");
  • trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.h

    r180116 r189218  
    3737class JSGlobalObjectRuntimeAgent final : public InspectorRuntimeAgent {
    3838public:
    39     JSGlobalObjectRuntimeAgent(InjectedScriptManager*, JSC::JSGlobalObject&);
     39    JSGlobalObjectRuntimeAgent(InjectedScriptManager&, JSC::JSGlobalObject&);
    4040
    4141    virtual void didCreateFrontendAndBackend(FrontendChannel*, BackendDispatcher*) override;
  • trunk/Source/WebCore/ChangeLog

    r189216 r189218  
     12015-09-01  Brian Burg  <bburg@apple.com>
     2
     3        Web Inspector: tighten up lifetimes for InspectorController-owned objects; add brace initializers to agents
     4        https://bugs.webkit.org/show_bug.cgi?id=148612
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        Both InjectedScriptManager and AgentRegistry (thus all agents) are
     9        owned by [Worker]InspectorController. So, use references.
     10
     11        InstrumentingAgents is morally owned by InspectorController as well, but
     12        must be a Ref for now since instrumentation cookies take a strong reference.
     13
     14        Add brace initalizers for scalar and pointer members in agent classes.
     15
     16        No new tests, no behavior change.
     17
     18        * inspector/InspectorApplicationCacheAgent.cpp:
     19        (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
     20        (WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend):
     21        (WebCore::InspectorApplicationCacheAgent::enable):
     22        * inspector/InspectorApplicationCacheAgent.h:
     23        * inspector/InspectorCSSAgent.cpp:
     24        (WebCore::InspectorCSSAgent::InspectorCSSAgent):
     25        (WebCore::InspectorCSSAgent::enable):
     26        (WebCore::InspectorCSSAgent::disable):
     27        * inspector/InspectorCSSAgent.h:
     28        * inspector/InspectorConsoleInstrumentation.h:
     29        (WebCore::InspectorInstrumentation::addMessageToConsole):
     30        (WebCore::InspectorInstrumentation::consoleCount):
     31        (WebCore::InspectorInstrumentation::startProfiling):
     32        (WebCore::InspectorInstrumentation::stopProfiling):
     33        * inspector/InspectorController.cpp:
     34        (WebCore::InspectorController::InspectorController):
     35        (WebCore::InspectorController::connectFrontend):
     36        (WebCore::InspectorController::disconnectFrontend):
     37        (WebCore::InspectorController::disconnectAllFrontends):
     38        * inspector/InspectorController.h:
     39        * inspector/InspectorDOMAgent.cpp:
     40        (WebCore::InspectorDOMAgent::InspectorDOMAgent):
     41        (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
     42        (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
     43        (WebCore::InspectorDOMAgent::focusNode):
     44        (WebCore::InspectorDOMAgent::buildObjectForEventListener):
     45        (WebCore::InspectorDOMAgent::nodeForObjectId):
     46        (WebCore::InspectorDOMAgent::resolveNode):
     47        * inspector/InspectorDOMAgent.h:
     48        * inspector/InspectorDOMDebuggerAgent.cpp:
     49        (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
     50        (WebCore::InspectorDOMDebuggerAgent::~InspectorDOMDebuggerAgent):
     51        (WebCore::InspectorDOMDebuggerAgent::debuggerWasEnabled):
     52        (WebCore::InspectorDOMDebuggerAgent::disable):
     53        * inspector/InspectorDOMDebuggerAgent.h:
     54        * inspector/InspectorDOMStorageAgent.cpp:
     55        (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
     56        (WebCore::InspectorDOMStorageAgent::~InspectorDOMStorageAgent):
     57        * inspector/InspectorDOMStorageAgent.h:
     58        * inspector/InspectorDatabaseAgent.cpp:
     59        (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
     60        (WebCore::InspectorDatabaseAgent::~InspectorDatabaseAgent):
     61        * inspector/InspectorDatabaseAgent.h:
     62        * inspector/InspectorIndexedDBAgent.cpp:
     63        (WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
     64        (WebCore::InspectorIndexedDBAgent::requestData):
     65        * inspector/InspectorIndexedDBAgent.h:
     66        * inspector/InspectorInstrumentation.cpp:
     67        (WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
     68        (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
     69        * inspector/InspectorInstrumentation.h:
     70        (WebCore::InspectorInstrumentation::mouseDidMoveOverElement):
     71        (WebCore::InspectorInstrumentation::scriptsEnabled):
     72        (WebCore::InspectorInstrumentation::didScroll):
     73        (WebCore::InspectorInstrumentation::markResourceAsCached):
     74        (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCache):
     75        (WebCore::InspectorInstrumentation::willRunJavaScriptDialog):
     76        (WebCore::InspectorInstrumentation::sessionCreated):
     77        (WebCore::InspectorInstrumentation::sessionLoaded):
     78        (WebCore::InspectorInstrumentation::sessionModified):
     79        (WebCore::InspectorInstrumentation::segmentCreated):
     80        (WebCore::InspectorInstrumentation::segmentCompleted):
     81        (WebCore::InspectorInstrumentation::segmentLoaded):
     82        (WebCore::InspectorInstrumentation::segmentUnloaded):
     83        (WebCore::InspectorInstrumentation::captureStarted):
     84        (WebCore::InspectorInstrumentation::captureStopped):
     85        (WebCore::InspectorInstrumentation::playbackStarted):
     86        (WebCore::InspectorInstrumentation::playbackPaused):
     87        (WebCore::InspectorInstrumentation::playbackFinished):
     88        (WebCore::InspectorInstrumentation::playbackHitPosition):
     89        * inspector/InspectorLayerTreeAgent.cpp:
     90        (WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent):
     91        (WebCore::InspectorLayerTreeAgent::enable):
     92        (WebCore::InspectorLayerTreeAgent::disable):
     93        (WebCore::InspectorLayerTreeAgent::layersForNode):
     94        (WebCore::InspectorLayerTreeAgent::idForNode):
     95        * inspector/InspectorLayerTreeAgent.h:
     96        * inspector/InspectorPageAgent.cpp:
     97        (WebCore::InspectorPageAgent::InspectorPageAgent):
     98        (WebCore::InspectorPageAgent::timestamp):
     99        (WebCore::InspectorPageAgent::enable):
     100        (WebCore::InspectorPageAgent::disable):
     101        (WebCore::InspectorPageAgent::frameStartedLoading):
     102        (WebCore::InspectorPageAgent::snapshotNode):
     103        * inspector/InspectorPageAgent.h:
     104        * inspector/InspectorReplayAgent.cpp:
     105        (WebCore::InspectorReplayAgent::InspectorReplayAgent):
     106        (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
     107        (WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):
     108        * inspector/InspectorReplayAgent.h:
     109        * inspector/InspectorResourceAgent.cpp:
     110        (WebCore::InspectorResourceAgent::InspectorResourceAgent):
     111        (WebCore::InspectorResourceAgent::~InspectorResourceAgent):
     112        (WebCore::InspectorResourceAgent::timestamp):
     113        (WebCore::InspectorResourceAgent::enable):
     114        (WebCore::InspectorResourceAgent::disable):
     115        * inspector/InspectorResourceAgent.h:
     116        * inspector/InspectorTimelineAgent.cpp:
     117        (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
     118        (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
     119        (WebCore::InspectorTimelineAgent::internalStart):
     120        (WebCore::InspectorTimelineAgent::internalStop):
     121        (WebCore::InspectorTimelineAgent::timestamp):
     122        (WebCore::InspectorTimelineAgent::startFromConsole):
     123        (WebCore::InspectorTimelineAgent::willCallFunction):
     124        (WebCore::InspectorTimelineAgent::willEvaluateScript):
     125        (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
     126        * inspector/InspectorTimelineAgent.h:
     127        * inspector/InspectorWebAgentBase.h:
     128        (WebCore::InspectorAgentBase::InspectorAgentBase):
     129        * inspector/InspectorWorkerAgent.cpp:
     130        (WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
     131        (WebCore::InspectorWorkerAgent::~InspectorWorkerAgent):
     132        * inspector/InspectorWorkerAgent.h:
     133        * inspector/InstrumentingAgents.cpp:
     134        (WebCore::InstrumentingAgents::InstrumentingAgents): Deleted.
     135        * inspector/InstrumentingAgents.h:
     136        (WebCore::InstrumentingAgents::create):
     137        * inspector/PageConsoleAgent.cpp:
     138        (WebCore::PageConsoleAgent::PageConsoleAgent):
     139        (WebCore::PageConsoleAgent::addInspectedNode):
     140        * inspector/PageConsoleAgent.h:
     141        * inspector/PageDebuggerAgent.cpp:
     142        (WebCore::PageDebuggerAgent::PageDebuggerAgent):
     143        (WebCore::PageDebuggerAgent::enable):
     144        (WebCore::PageDebuggerAgent::disable):
     145        (WebCore::PageDebuggerAgent::injectedScriptForEval):
     146        * inspector/PageDebuggerAgent.h:
     147        * inspector/PageRuntimeAgent.cpp:
     148        (WebCore::PageRuntimeAgent::PageRuntimeAgent):
     149        (WebCore::PageRuntimeAgent::injectedScriptForEval):
     150        (WebCore::PageRuntimeAgent::notifyContextCreated):
     151        * inspector/PageRuntimeAgent.h:
     152        * inspector/WebConsoleAgent.cpp:
     153        (WebCore::WebConsoleAgent::WebConsoleAgent):
     154        (WebCore::WebConsoleAgent::frameWindowDiscarded):
     155        (WebCore::WebConsoleAgent::didFinishXHRLoading):
     156        (WebCore::WebConsoleAgent::didReceiveResponse):
     157        (WebCore::WebConsoleAgent::didFailLoading):
     158        * inspector/WebConsoleAgent.h:
     159        * inspector/WebDebuggerAgent.cpp:
     160        (WebCore::WebDebuggerAgent::WebDebuggerAgent):
     161        (WebCore::WebDebuggerAgent::enable):
     162        (WebCore::WebDebuggerAgent::disable):
     163        * inspector/WebDebuggerAgent.h:
     164        * inspector/WorkerConsoleAgent.cpp:
     165        (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
     166        * inspector/WorkerConsoleAgent.h:
     167        * inspector/WorkerDebuggerAgent.cpp:
     168        (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
     169        (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
     170        * inspector/WorkerDebuggerAgent.h:
     171        * inspector/WorkerInspectorController.cpp:
     172        (WebCore::WorkerInspectorController::WorkerInspectorController):
     173        * inspector/WorkerInspectorController.h:
     174        * inspector/WorkerRuntimeAgent.cpp:
     175        (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
     176        (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
     177        * inspector/WorkerRuntimeAgent.h:
     178
    11792015-09-01  Jinyoung Hur  <hur.ims@navercorp.com>
    2180
  • trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp

    r186279 r189218  
    4444namespace WebCore {
    4545
    46 InspectorApplicationCacheAgent::InspectorApplicationCacheAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent)
     46InspectorApplicationCacheAgent::InspectorApplicationCacheAgent(InstrumentingAgents& instrumentingAgents, InspectorPageAgent* pageAgent)
    4747    : InspectorAgentBase(ASCIILiteral("ApplicationCache"), instrumentingAgents)
    4848    , m_pageAgent(pageAgent)
     
    6161    m_backendDispatcher = nullptr;
    6262
    63     m_instrumentingAgents->setInspectorApplicationCacheAgent(nullptr);
     63    m_instrumentingAgents.setInspectorApplicationCacheAgent(nullptr);
    6464}
    6565
    6666void InspectorApplicationCacheAgent::enable(ErrorString&)
    6767{
    68     m_instrumentingAgents->setInspectorApplicationCacheAgent(this);
     68    m_instrumentingAgents.setInspectorApplicationCacheAgent(this);
    6969
    7070    // We need to pass initial navigator.onOnline.
  • trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.h

    r184291 r189218  
    5151    WTF_MAKE_NONCOPYABLE(InspectorApplicationCacheAgent); WTF_MAKE_FAST_ALLOCATED;
    5252public:
    53     InspectorApplicationCacheAgent(InstrumentingAgents*, InspectorPageAgent*);
     53    InspectorApplicationCacheAgent(InstrumentingAgents&, InspectorPageAgent*);
    5454    virtual ~InspectorApplicationCacheAgent() { }
    5555
     
    7272    DocumentLoader* assertFrameWithDocumentLoader(ErrorString&, const String& frameId);
    7373
    74     InspectorPageAgent* m_pageAgent;
    7574    std::unique_ptr<Inspector::ApplicationCacheFrontendDispatcher> m_frontendDispatcher;
    7675    RefPtr<Inspector::ApplicationCacheBackendDispatcher> m_backendDispatcher;
     76    InspectorPageAgent* m_pageAgent { nullptr };
    7777};
    7878
  • trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp

    r189104 r189218  
    11/*
    2  * Copyright (C) 2010, Google Inc. All rights reserved.
     2 * Copyright (C) 2010 Google Inc. All rights reserved.
     3 * Copyright (C) 2015 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    341342}
    342343
    343 InspectorCSSAgent::InspectorCSSAgent(InstrumentingAgents* instrumentingAgents, InspectorDOMAgent* domAgent)
     344InspectorCSSAgent::InspectorCSSAgent(InstrumentingAgents& instrumentingAgents, InspectorDOMAgent* domAgent)
    344345    : InspectorAgentBase(ASCIILiteral("CSS"), instrumentingAgents)
    345346    , m_domAgent(domAgent)
    346     , m_lastStyleSheetId(1)
    347347{
    348348    m_domAgent->setDOMListener(this);
     
    396396void InspectorCSSAgent::enable(ErrorString&)
    397397{
    398     m_instrumentingAgents->setInspectorCSSAgent(this);
     398    m_instrumentingAgents.setInspectorCSSAgent(this);
    399399
    400400    for (auto* document : m_domAgent->documents())
     
    404404void InspectorCSSAgent::disable(ErrorString&)
    405405{
    406     m_instrumentingAgents->setInspectorCSSAgent(nullptr);
     406    m_instrumentingAgents.setInspectorCSSAgent(nullptr);
    407407}
    408408
  • trunk/Source/WebCore/inspector/InspectorCSSAgent.h

    r189104 r189218  
    11/*
    2  * Copyright (C) 2010, Google Inc. All rights reserved.
     2 * Copyright (C) 2010 Google Inc. All rights reserved.
     3 * Copyright (C) 2015 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    8283    };
    8384
    84     InspectorCSSAgent(InstrumentingAgents*, InspectorDOMAgent*);
     85    InspectorCSSAgent(InstrumentingAgents&, InspectorDOMAgent*);
    8586    virtual ~InspectorCSSAgent();
    8687
     
    170171    std::unique_ptr<Inspector::CSSFrontendDispatcher> m_frontendDispatcher;
    171172    RefPtr<Inspector::CSSBackendDispatcher> m_backendDispatcher;
    172     InspectorDOMAgent* m_domAgent;
     173    InspectorDOMAgent* m_domAgent { nullptr };
    173174
    174175    IdToInspectorStyleSheet m_idToInspectorStyleSheet;
     
    181182    std::unique_ptr<ChangeRegionOversetTask> m_changeRegionOversetTask;
    182183
    183     int m_lastStyleSheetId;
     184    int m_lastStyleSheetId { 1 };
    184185    bool m_creatingViaInspectorStyleSheet { false };
    185186};
  • trunk/Source/WebCore/inspector/InspectorConsoleInstrumentation.h

    r178820 r189218  
    11/*
    22* Copyright (C) 2011 Google Inc. All rights reserved.
     3* Copyright (C) 2015 Apple Inc. All rights reserved.
    34*
    45* Redistribution and use in source and binary forms, with or without
     
    4142inline void InspectorInstrumentation::addMessageToConsole(Page& page, std::unique_ptr<Inspector::ConsoleMessage> message)
    4243{
    43     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    44         addMessageToConsoleImpl(*instrumentingAgents, WTF::move(message));
     44    addMessageToConsoleImpl(instrumentingAgentsForPage(page), WTF::move(message));
    4545}
    4646
     
    5353inline void InspectorInstrumentation::consoleCount(Page& page, JSC::ExecState* state, RefPtr<Inspector::ScriptArguments>&& arguments)
    5454{
    55     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    56         consoleCountImpl(*instrumentingAgents, state, WTF::move(arguments));
     55    consoleCountImpl(instrumentingAgentsForPage(page), state, WTF::move(arguments));
    5756}
    5857
     
    7877inline void InspectorInstrumentation::startProfiling(Page& page, JSC::ExecState* exec, const String &title)
    7978{
    80     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    81         startProfilingImpl(*instrumentingAgents, exec, title);
     79    startProfilingImpl(instrumentingAgentsForPage(page), exec, title);
    8280}
    8381
    8482inline RefPtr<JSC::Profile> InspectorInstrumentation::stopProfiling(Page& page, JSC::ExecState* exec, const String &title)
    8583{
    86     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    87         return stopProfilingImpl(*instrumentingAgents, exec, title);
    88     return nullptr;
     84    return stopProfilingImpl(instrumentingAgentsForPage(page), exec, title);
    8985}
    9086
  • trunk/Source/WebCore/inspector/InspectorController.cpp

    r189034 r189218  
    103103    m_agents.append(WTF::move(pageAgentPtr));
    104104
    105     auto runtimeAgentPtr = std::make_unique<PageRuntimeAgent>(m_injectedScriptManager.get(), &page, pageAgent);
     105    auto runtimeAgentPtr = std::make_unique<PageRuntimeAgent>(*m_injectedScriptManager, &page, pageAgent);
    106106    PageRuntimeAgent* runtimeAgent = runtimeAgentPtr.get();
    107107    m_instrumentingAgents->setPageRuntimeAgent(runtimeAgent);
    108108    m_agents.append(WTF::move(runtimeAgentPtr));
    109109
    110     auto domAgentPtr = std::make_unique<InspectorDOMAgent>(m_instrumentingAgents.get(), pageAgent, m_injectedScriptManager.get(), m_overlay.get());
     110    auto domAgentPtr = std::make_unique<InspectorDOMAgent>(m_instrumentingAgents.get(), pageAgent, *m_injectedScriptManager, m_overlay.get());
    111111    m_domAgent = domAgentPtr.get();
    112112    m_agents.append(WTF::move(domAgentPtr));
     
    119119
    120120#if ENABLE(INDEXED_DATABASE)
    121     m_agents.append(std::make_unique<InspectorIndexedDBAgent>(m_instrumentingAgents.get(), m_injectedScriptManager.get(), pageAgent));
     121    m_agents.append(std::make_unique<InspectorIndexedDBAgent>(m_instrumentingAgents.get(), *m_injectedScriptManager, pageAgent));
    122122#endif
    123123
     
    138138    m_agents.append(WTF::move(resourceAgentPtr));
    139139
    140     auto consoleAgentPtr = std::make_unique<PageConsoleAgent>(m_injectedScriptManager.get(), m_domAgent);
     140    auto consoleAgentPtr = std::make_unique<PageConsoleAgent>(*m_injectedScriptManager, m_domAgent);
    141141    WebConsoleAgent* consoleAgent = consoleAgentPtr.get();
    142142    m_instrumentingAgents->setWebConsoleAgent(consoleAgentPtr.get());
    143143    m_agents.append(WTF::move(consoleAgentPtr));
    144144
    145     auto debuggerAgentPtr = std::make_unique<PageDebuggerAgent>(m_injectedScriptManager.get(), m_instrumentingAgents.get(), pageAgent, m_overlay.get());
     145    auto debuggerAgentPtr = std::make_unique<PageDebuggerAgent>(*m_injectedScriptManager, m_instrumentingAgents.get(), pageAgent, m_overlay.get());
    146146    m_debuggerAgent = debuggerAgentPtr.get();
    147147    m_agents.append(WTF::move(debuggerAgentPtr));
     
    232232    m_agents.didCreateFrontendAndBackend(frontendChannel, m_backendDispatcher.get());
    233233
    234     InspectorInstrumentation::registerInstrumentingAgents(*m_instrumentingAgents);
     234    InspectorInstrumentation::registerInstrumentingAgents(m_instrumentingAgents.get());
    235235    InspectorInstrumentation::frontendCreated();
    236236
     
    262262    m_overlay->freePage();
    263263    InspectorInstrumentation::frontendDeleted();
    264     InspectorInstrumentation::unregisterInstrumentingAgents(*m_instrumentingAgents);
     264    InspectorInstrumentation::unregisterInstrumentingAgents(m_instrumentingAgents.get());
    265265}
    266266
  • trunk/Source/WebCore/inspector/InspectorController.h

    r189034 r189218  
    11/*
    22 * Copyright (C) 2011 Google Inc. All rights reserved.
     3 * Copyright (C) 2015 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    138139    friend class InspectorInstrumentation;
    139140
    140     RefPtr<InstrumentingAgents> m_instrumentingAgents;
     141    Ref<InstrumentingAgents> m_instrumentingAgents;
    141142    std::unique_ptr<WebInjectedScriptManager> m_injectedScriptManager;
    142     std::unique_ptr<InspectorOverlay> m_overlay;
    143 
    144     Inspector::InspectorAgent* m_inspectorAgent;
    145     InspectorDOMAgent* m_domAgent;
    146     InspectorResourceAgent* m_resourceAgent;
    147     InspectorPageAgent* m_pageAgent;
    148     PageDebuggerAgent* m_debuggerAgent;
    149     InspectorDOMDebuggerAgent* m_domDebuggerAgent;
    150     InspectorTimelineAgent* m_timelineAgent;
    151 
    152143    RefPtr<Inspector::BackendDispatcher> m_backendDispatcher;
    153144    Inspector::FrontendChannel* m_frontendChannel { nullptr };
     145    std::unique_ptr<InspectorOverlay> m_overlay;
    154146    Ref<WTF::Stopwatch> m_executionStopwatch;
     147    Inspector::AgentRegistry m_agents;
     148
    155149    Page& m_page;
    156150    InspectorClient* m_inspectorClient;
    157151    InspectorFrontendClient* m_inspectorFrontendClient { nullptr };
    158     Inspector::AgentRegistry m_agents;
     152
     153    Inspector::InspectorAgent* m_inspectorAgent { nullptr };
     154    InspectorDOMAgent* m_domAgent { nullptr };
     155    InspectorResourceAgent* m_resourceAgent { nullptr };
     156    InspectorPageAgent* m_pageAgent { nullptr };
     157    PageDebuggerAgent* m_debuggerAgent { nullptr };
     158    InspectorDOMDebuggerAgent* m_domDebuggerAgent { nullptr };
     159    InspectorTimelineAgent* m_timelineAgent { nullptr };
     160
    159161    Vector<InspectorInstrumentationCookie, 2> m_injectedScriptInstrumentationCookies;
    160162    bool m_isUnderTest { false };
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp

    r187496 r189218  
    202202}
    203203
    204 InspectorDOMAgent::InspectorDOMAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay)
     204InspectorDOMAgent::InspectorDOMAgent(InstrumentingAgents& instrumentingAgents, InspectorPageAgent* pageAgent, InjectedScriptManager& injectedScriptManager, InspectorOverlay* overlay)
    205205    : InspectorAgentBase(ASCIILiteral("DOM"), instrumentingAgents)
     206    , m_injectedScriptManager(injectedScriptManager)
    206207    , m_pageAgent(pageAgent)
    207     , m_injectedScriptManager(injectedScriptManager)
    208208    , m_overlay(overlay)
    209     , m_domListener(0)
    210     , m_lastNodeId(1)
    211     , m_lastBackendNodeId(-1)
    212     , m_searchingForNode(false)
    213     , m_suppressAttributeModifiedEvent(false)
    214     , m_documentRequested(false)
    215209{
    216210}
     
    230224    m_domEditor = std::make_unique<DOMEditor>(m_history.get());
    231225
    232     m_instrumentingAgents->setInspectorDOMAgent(this);
     226    m_instrumentingAgents.setInspectorDOMAgent(this);
    233227    m_document = m_pageAgent->mainFrame()->document();
    234228
     
    249243    hideHighlight(unused);
    250244
    251     m_instrumentingAgents->setInspectorDOMAgent(0);
     245    m_instrumentingAgents.setInspectorDOMAgent(0);
    252246    m_documentRequested = false;
    253247    reset();
     
    10071001
    10081002    JSC::ExecState* scriptState = mainWorldExecState(frame);
    1009     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(scriptState);
     1003    InjectedScript injectedScript = m_injectedScriptManager.injectedScriptFor(scriptState);
    10101004    if (injectedScript.hasNoValue())
    10111005        return;
     
    14831477        .release();
    14841478    if (objectGroupId && handler && state) {
    1485         InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(state);
     1479        InjectedScript injectedScript = m_injectedScriptManager.injectedScriptFor(state);
    14861480        if (!injectedScript.hasNoValue())
    14871481            value->setHandler(injectedScript.wrapObject(Deprecated::ScriptValue(state->vm(), handler), *objectGroupId));
     
    20732067Node* InspectorDOMAgent::nodeForObjectId(const String& objectId)
    20742068{
    2075     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
     2069    InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId);
    20762070    if (injectedScript.hasNoValue())
    20772071        return nullptr;
     
    21132107
    21142108    JSC::ExecState* scriptState = mainWorldExecState(frame);
    2115     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(scriptState);
     2109    InjectedScript injectedScript = m_injectedScriptManager.injectedScriptFor(scriptState);
    21162110    if (injectedScript.hasNoValue())
    21172111        return 0;
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.h

    r187496 r189218  
    105105    };
    106106
    107     InspectorDOMAgent(InstrumentingAgents*, InspectorPageAgent*, Inspector::InjectedScriptManager*, InspectorOverlay*);
     107    InspectorDOMAgent(InstrumentingAgents&, InspectorPageAgent*, Inspector::InjectedScriptManager&, InspectorOverlay*);
    108108    virtual ~InspectorDOMAgent();
    109109
     
    248248    void innerHighlightQuad(std::unique_ptr<FloatQuad>, const Inspector::InspectorObject* color, const Inspector::InspectorObject* outlineColor, const bool* usePageCoordinates);
    249249
    250     InspectorPageAgent* m_pageAgent;
    251     Inspector::InjectedScriptManager* m_injectedScriptManager;
    252     InspectorOverlay* m_overlay;
    253250    std::unique_ptr<Inspector::DOMFrontendDispatcher> m_frontendDispatcher;
    254251    RefPtr<Inspector::DOMBackendDispatcher> m_backendDispatcher;
    255     DOMListener* m_domListener;
     252    Inspector::InjectedScriptManager& m_injectedScriptManager;
     253    InspectorPageAgent* m_pageAgent { nullptr };
     254
     255    InspectorOverlay* m_overlay { nullptr };
     256    DOMListener* m_domListener { nullptr };
    256257    NodeToIdMap m_documentNodeToIdMap;
    257258    typedef HashMap<RefPtr<Node>, BackendNodeId> NodeToBackendIdMap;
     
    263264    HashSet<int> m_childrenRequested;
    264265    HashMap<BackendNodeId, std::pair<Node*, String>> m_backendIdToNode;
    265     int m_lastNodeId;
    266     BackendNodeId m_lastBackendNodeId;
     266    int m_lastNodeId { 1 };
     267    BackendNodeId m_lastBackendNodeId { -1 };
    267268    RefPtr<Document> m_document;
    268269    typedef HashMap<String, Vector<RefPtr<Node>>> SearchResults;
     
    270271    std::unique_ptr<RevalidateStyleAttributeTask> m_revalidateStyleAttrTask;
    271272    RefPtr<Node> m_nodeToFocus;
    272     bool m_searchingForNode;
     273    bool m_searchingForNode { false };
    273274    std::unique_ptr<HighlightConfig> m_inspectModeHighlightConfig;
    274275    std::unique_ptr<InspectorHistory> m_history;
    275276    std::unique_ptr<DOMEditor> m_domEditor;
    276     bool m_suppressAttributeModifiedEvent;
    277     bool m_documentRequested;
     277    bool m_suppressAttributeModifiedEvent { false };
     278    bool m_documentRequested { false };
    278279};
    279280
  • trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp

    r186279 r189218  
    6060namespace WebCore {
    6161
    62 InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent(InstrumentingAgents* instrumentingAgents, InspectorDOMAgent* domAgent, InspectorDebuggerAgent* debuggerAgent)
     62InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent(InstrumentingAgents& instrumentingAgents, InspectorDOMAgent* domAgent, InspectorDebuggerAgent* debuggerAgent)
    6363    : InspectorAgentBase(ASCIILiteral("DOMDebugger"), instrumentingAgents)
    6464    , m_domAgent(domAgent)
    6565    , m_debuggerAgent(debuggerAgent)
    66     , m_pauseInNextEventListener(false)
    67     , m_pauseOnAllXHRsEnabled(false)
    6866{
    6967    m_debuggerAgent->setListener(this);
     
    7371{
    7472    ASSERT(!m_debuggerAgent);
    75     ASSERT(!m_instrumentingAgents->inspectorDOMDebuggerAgent());
     73    ASSERT(!m_instrumentingAgents.inspectorDOMDebuggerAgent());
    7674}
    7775
     
    7977void InspectorDOMDebuggerAgent::debuggerWasEnabled()
    8078{
    81     m_instrumentingAgents->setInspectorDOMDebuggerAgent(this);
     79    m_instrumentingAgents.setInspectorDOMDebuggerAgent(this);
    8280}
    8381
     
    9997void InspectorDOMDebuggerAgent::disable()
    10098{
    101     m_instrumentingAgents->setInspectorDOMDebuggerAgent(nullptr);
     99    m_instrumentingAgents.setInspectorDOMDebuggerAgent(nullptr);
    102100    clear();
    103101}
  • trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h

    r180116 r189218  
    5656    WTF_MAKE_FAST_ALLOCATED;
    5757public:
    58     InspectorDOMDebuggerAgent(InstrumentingAgents*, InspectorDOMAgent*, Inspector::InspectorDebuggerAgent*);
     58    InspectorDOMDebuggerAgent(InstrumentingAgents&, InspectorDOMAgent*, Inspector::InspectorDebuggerAgent*);
    5959    virtual ~InspectorDOMDebuggerAgent();
    6060
     
    100100    void clear();
    101101
    102     InspectorDOMAgent* m_domAgent;
    103     Inspector::InspectorDebuggerAgent* m_debuggerAgent;
    104102    RefPtr<Inspector::DOMDebuggerBackendDispatcher> m_backendDispatcher;
     103    InspectorDOMAgent* m_domAgent { nullptr };
     104    Inspector::InspectorDebuggerAgent* m_debuggerAgent { nullptr };
     105
    105106    HashMap<Node*, uint32_t> m_domBreakpoints;
    106107    HashSet<String> m_eventListenerBreakpoints;
    107108    HashSet<String> m_xhrBreakpoints;
    108     bool m_pauseInNextEventListener;
    109     bool m_pauseOnAllXHRsEnabled;
     109    bool m_pauseInNextEventListener { false };
     110    bool m_pauseOnAllXHRsEnabled { false };
    110111};
    111112
  • trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp

    r186279 r189218  
    5454namespace WebCore {
    5555
    56 InspectorDOMStorageAgent::InspectorDOMStorageAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent)
     56InspectorDOMStorageAgent::InspectorDOMStorageAgent(InstrumentingAgents& instrumentingAgents, InspectorPageAgent* pageAgent)
    5757    : InspectorAgentBase(ASCIILiteral("DOMStorage"), instrumentingAgents)
    5858    , m_pageAgent(pageAgent)
    59     , m_enabled(false)
    60 {
    61     m_instrumentingAgents->setInspectorDOMStorageAgent(this);
     59{
     60    m_instrumentingAgents.setInspectorDOMStorageAgent(this);
    6261}
    6362
    6463InspectorDOMStorageAgent::~InspectorDOMStorageAgent()
    6564{
    66     m_instrumentingAgents->setInspectorDOMStorageAgent(nullptr);
    67     m_instrumentingAgents = nullptr;
     65    m_instrumentingAgents.setInspectorDOMStorageAgent(nullptr);
    6866}
    6967
  • trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.h

    r185722 r189218  
    5555    WTF_MAKE_FAST_ALLOCATED;
    5656public:
    57     InspectorDOMStorageAgent(InstrumentingAgents*, InspectorPageAgent*);
     57    InspectorDOMStorageAgent(InstrumentingAgents&, InspectorPageAgent*);
    5858    virtual ~InspectorDOMStorageAgent();
    5959
     
    7878    RefPtr<StorageArea> findStorageArea(ErrorString&, const Inspector::InspectorObject&, Frame*&);
    7979
    80     InspectorPageAgent* m_pageAgent;
    8180    std::unique_ptr<Inspector::DOMStorageFrontendDispatcher> m_frontendDispatcher;
    8281    RefPtr<Inspector::DOMStorageBackendDispatcher> m_backendDispatcher;
    83     bool m_enabled;
     82    InspectorPageAgent* m_pageAgent { nullptr };
     83
     84    bool m_enabled { false };
    8485};
    8586
  • trunk/Source/WebCore/inspector/InspectorDatabaseAgent.cpp

    r186279 r189218  
    211211}
    212212
    213 InspectorDatabaseAgent::InspectorDatabaseAgent(InstrumentingAgents* instrumentingAgents)
     213InspectorDatabaseAgent::InspectorDatabaseAgent(InstrumentingAgents& instrumentingAgents)
    214214    : InspectorAgentBase(ASCIILiteral("Database"), instrumentingAgents)
    215     , m_enabled(false)
    216 {
    217     m_instrumentingAgents->setInspectorDatabaseAgent(this);
     215{
     216    m_instrumentingAgents.setInspectorDatabaseAgent(this);
    218217}
    219218
    220219InspectorDatabaseAgent::~InspectorDatabaseAgent()
    221220{
    222     m_instrumentingAgents->setInspectorDatabaseAgent(nullptr);
     221    m_instrumentingAgents.setInspectorDatabaseAgent(nullptr);
    223222}
    224223
  • trunk/Source/WebCore/inspector/InspectorDatabaseAgent.h

    r180116 r189218  
    5151    WTF_MAKE_FAST_ALLOCATED;
    5252public:
    53     explicit InspectorDatabaseAgent(InstrumentingAgents*);
     53    explicit InspectorDatabaseAgent(InstrumentingAgents&);
    5454    virtual ~InspectorDatabaseAgent();
    5555
     
    7575    std::unique_ptr<Inspector::DatabaseFrontendDispatcher> m_frontendDispatcher;
    7676    RefPtr<Inspector::DatabaseBackendDispatcher> m_backendDispatcher;
     77
    7778    typedef HashMap<String, RefPtr<InspectorDatabaseResource>> DatabaseResourcesMap;
    7879    DatabaseResourcesMap m_resources;
    79     bool m_enabled;
     80    bool m_enabled { false };
    8081};
    8182
  • trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp

    r186279 r189218  
    565565} // namespace
    566566
    567 InspectorIndexedDBAgent::InspectorIndexedDBAgent(InstrumentingAgents* instrumentingAgents, InjectedScriptManager* injectedScriptManager, InspectorPageAgent* pageAgent)
     567InspectorIndexedDBAgent::InspectorIndexedDBAgent(InstrumentingAgents& instrumentingAgents, InjectedScriptManager& injectedScriptManager, InspectorPageAgent* pageAgent)
    568568    : InspectorAgentBase(ASCIILiteral("IndexedDB"), instrumentingAgents)
    569569    , m_injectedScriptManager(injectedScriptManager)
     
    667667        return;
    668668
    669     InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(mainWorldExecState(frame));
     669    InjectedScript injectedScript = m_injectedScriptManager.injectedScriptFor(mainWorldExecState(frame));
    670670
    671671    RefPtr<IDBKeyRange> idbKeyRange = keyRange ? idbKeyRangeFromKeyRange(keyRange) : nullptr;
  • trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.h

    r185722 r189218  
    5151    WTF_MAKE_FAST_ALLOCATED;
    5252public:
    53     InspectorIndexedDBAgent(InstrumentingAgents*, Inspector::InjectedScriptManager*, InspectorPageAgent*);
     53    InspectorIndexedDBAgent(InstrumentingAgents&, Inspector::InjectedScriptManager&, InspectorPageAgent*);
    5454    virtual ~InspectorIndexedDBAgent();
    5555
     
    6666
    6767private:
    68     Inspector::InjectedScriptManager* m_injectedScriptManager;
    69     InspectorPageAgent* m_pageAgent;
    7068    RefPtr<Inspector::IndexedDBBackendDispatcher> m_backendDispatcher;
     69    Inspector::InjectedScriptManager& m_injectedScriptManager;
     70    InspectorPageAgent* m_pageAgent { nullptr };
    7171};
    7272
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp

    r189002 r189218  
    11/*
    22* Copyright (C) 2011 Google Inc. All rights reserved.
    3 * Copyright (C) 2014 Apple Inc. All rights reserved.
     3* Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
    44*
    55* Redistribution and use in source and binary forms, with or without
     
    12621262InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForPage(Page* page)
    12631263{
    1264     return page ? instrumentingAgentsForPage(*page) : nullptr;
    1265 }
    1266 
    1267 InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForPage(Page& page)
     1264    return page ? &instrumentingAgentsForPage(*page) : nullptr;
     1265}
     1266
     1267InstrumentingAgents& InspectorInstrumentation::instrumentingAgentsForPage(Page& page)
    12681268{
    12691269    ASSERT(isMainThread());
     
    12781278InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope(WorkerGlobalScope* workerGlobalScope)
    12791279{
    1280     return workerGlobalScope ? workerGlobalScope->workerInspectorController().m_instrumentingAgents.get() : nullptr;
     1280    return workerGlobalScope ? &workerGlobalScope->workerInspectorController().m_instrumentingAgents.get() : nullptr;
    12811281}
    12821282
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.h

    r189002 r189218  
    11/*
    22* Copyright (C) 2010 Google Inc. All rights reserved.
    3 * Copyright (C) 2014 Apple Inc. All rights reserved.
     3* Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
    44*
    55* Redistribution and use in source and binary forms, with or without
     
    458458    static void renderLayerDestroyedImpl(InstrumentingAgents&, const RenderLayer&);
    459459
    460     static InstrumentingAgents* instrumentingAgentsForPage(Page&);
     460    static InstrumentingAgents& instrumentingAgentsForPage(Page&);
    461461    static InstrumentingAgents* instrumentingAgentsForFrame(Frame&);
    462462    static InstrumentingAgents* instrumentingAgentsForFrame(Frame*);
     
    640640{
    641641    FAST_RETURN_IF_NO_FRONTENDS(void());
    642     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    643         mouseDidMoveOverElementImpl(*instrumentingAgents, result, modifierFlags);
     642    mouseDidMoveOverElementImpl(instrumentingAgentsForPage(page), result, modifierFlags);
    644643}
    645644
     
    790789{
    791790    FAST_RETURN_IF_NO_FRONTENDS(void());
    792     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    793         return scriptsEnabledImpl(*instrumentingAgents, isEnabled);
     791    return scriptsEnabledImpl(instrumentingAgentsForPage(page), isEnabled);
    794792}
    795793
     
    834832{
    835833    FAST_RETURN_IF_NO_FRONTENDS(void());
    836     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    837         didScrollImpl(*instrumentingAgents);
     834    didScrollImpl(instrumentingAgentsForPage(page));
    838835}
    839836
     
    938935inline void InspectorInstrumentation::markResourceAsCached(Page& page, unsigned long identifier)
    939936{
    940     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    941         markResourceAsCachedImpl(*instrumentingAgents, identifier);
     937    markResourceAsCachedImpl(instrumentingAgentsForPage(page), identifier);
    942938}
    943939
    944940inline void InspectorInstrumentation::didLoadResourceFromMemoryCache(Page& page, DocumentLoader* loader, CachedResource* resource)
    945941{
    946     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    947         didLoadResourceFromMemoryCacheImpl(*instrumentingAgents, loader, resource);
     942    didLoadResourceFromMemoryCacheImpl(instrumentingAgentsForPage(page), loader, resource);
    948943}
    949944
     
    11041099{
    11051100    FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
    1106     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    1107         return willRunJavaScriptDialogImpl(*instrumentingAgents, message);
    1108     return InspectorInstrumentationCookie();
     1101    return willRunJavaScriptDialogImpl(instrumentingAgentsForPage(page), message);
    11091102}
    11101103
     
    12121205{
    12131206    FAST_RETURN_IF_NO_FRONTENDS(void());
    1214     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    1215         sessionCreatedImpl(*instrumentingAgents, WTF::move(session));
     1207    sessionCreatedImpl(instrumentingAgentsForPage(page), WTF::move(session));
    12161208}
    12171209
     
    12191211{
    12201212    FAST_RETURN_IF_NO_FRONTENDS(void());
    1221     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    1222         sessionLoadedImpl(*instrumentingAgents, WTF::move(session));
     1213    sessionLoadedImpl(instrumentingAgentsForPage(page), WTF::move(session));
    12231214}
    12241215
     
    12261217{
    12271218    FAST_RETURN_IF_NO_FRONTENDS(void());
    1228     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    1229         sessionModifiedImpl(*instrumentingAgents, WTF::move(session));
     1219    sessionModifiedImpl(instrumentingAgentsForPage(page), WTF::move(session));
    12301220}
    12311221
     
    12331223{
    12341224    FAST_RETURN_IF_NO_FRONTENDS(void());
    1235     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    1236         segmentCreatedImpl(*instrumentingAgents, WTF::move(segment));
     1225    segmentCreatedImpl(instrumentingAgentsForPage(page), WTF::move(segment));
    12371226}
    12381227
     
    12401229{
    12411230    FAST_RETURN_IF_NO_FRONTENDS(void());
    1242     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    1243         segmentCompletedImpl(*instrumentingAgents, WTF::move(segment));
     1231    segmentCompletedImpl(instrumentingAgentsForPage(page), WTF::move(segment));
    12441232}
    12451233
     
    12471235{
    12481236    FAST_RETURN_IF_NO_FRONTENDS(void());
    1249     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    1250         segmentLoadedImpl(*instrumentingAgents, WTF::move(segment));
     1237    segmentLoadedImpl(instrumentingAgentsForPage(page), WTF::move(segment));
    12511238}
    12521239
     
    12541241{
    12551242    FAST_RETURN_IF_NO_FRONTENDS(void());
    1256     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    1257         segmentUnloadedImpl(*instrumentingAgents);
     1243    segmentUnloadedImpl(instrumentingAgentsForPage(page));
    12581244}
    12591245
     
    12611247{
    12621248    FAST_RETURN_IF_NO_FRONTENDS(void());
    1263     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    1264         captureStartedImpl(*instrumentingAgents);
     1249    captureStartedImpl(instrumentingAgentsForPage(page));
    12651250}
    12661251
     
    12681253{
    12691254    FAST_RETURN_IF_NO_FRONTENDS(void());
    1270     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    1271         captureStoppedImpl(*instrumentingAgents);
     1255    captureStoppedImpl(instrumentingAgentsForPage(page));
    12721256}
    12731257
     
    12751259{
    12761260    FAST_RETURN_IF_NO_FRONTENDS(void());
    1277     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    1278         playbackStartedImpl(*instrumentingAgents);
     1261        playbackStartedImpl(instrumentingAgentsForPage(page));
    12791262}
    12801263
     
    12821265{
    12831266    FAST_RETURN_IF_NO_FRONTENDS(void());
    1284     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    1285         playbackPausedImpl(*instrumentingAgents, position);
     1267        playbackPausedImpl(instrumentingAgentsForPage(page), position);
    12861268}
    12871269
     
    12891271{
    12901272    FAST_RETURN_IF_NO_FRONTENDS(void());
    1291     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    1292         playbackFinishedImpl(*instrumentingAgents);
     1273        playbackFinishedImpl(instrumentingAgentsForPage(page));
    12931274}
    12941275
     
    12961277{
    12971278    FAST_RETURN_IF_NO_FRONTENDS(void());
    1298     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
    1299         playbackHitPositionImpl(*instrumentingAgents, position);
     1279        playbackHitPositionImpl(instrumentingAgentsForPage(page), position);
    13001280}
    13011281#endif // ENABLE(WEB_REPLAY)
  • trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp

    r188530 r189218  
    4747namespace WebCore {
    4848
    49 InspectorLayerTreeAgent::InspectorLayerTreeAgent(InstrumentingAgents* instrumentingAgents)
     49InspectorLayerTreeAgent::InspectorLayerTreeAgent(InstrumentingAgents& instrumentingAgents)
    5050    : InspectorAgentBase(ASCIILiteral("LayerTree"), instrumentingAgents)
    5151{
     
    8282void InspectorLayerTreeAgent::enable(ErrorString&)
    8383{
    84     m_instrumentingAgents->setInspectorLayerTreeAgent(this);
     84    m_instrumentingAgents.setInspectorLayerTreeAgent(this);
    8585}
    8686
    8787void InspectorLayerTreeAgent::disable(ErrorString&)
    8888{
    89     m_instrumentingAgents->setInspectorLayerTreeAgent(nullptr);
     89    m_instrumentingAgents.setInspectorLayerTreeAgent(nullptr);
    9090}
    9191
     
    109109    layers = Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>::create();
    110110
    111     Node* node = m_instrumentingAgents->inspectorDOMAgent()->nodeForId(nodeId);
     111    Node* node = m_instrumentingAgents.inspectorDOMAgent()->nodeForId(nodeId);
    112112    if (!node) {
    113113        errorString = ASCIILiteral("Provided node id doesn't match any known node");
     
    208208        return 0;
    209209
    210     InspectorDOMAgent* domAgent = m_instrumentingAgents->inspectorDOMAgent();
     210    InspectorDOMAgent* domAgent = m_instrumentingAgents.inspectorDOMAgent();
    211211   
    212212    int nodeId = domAgent->boundNodeId(node);
  • trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.h

    r180116 r189218  
    4848    WTF_MAKE_FAST_ALLOCATED;
    4949public:
    50     explicit InspectorLayerTreeAgent(InstrumentingAgents*);
     50    explicit InspectorLayerTreeAgent(InstrumentingAgents&);
    5151    virtual ~InspectorLayerTreeAgent();
    5252
  • trunk/Source/WebCore/inspector/InspectorPageAgent.cpp

    r186372 r189218  
    326326}
    327327
    328 InspectorPageAgent::InspectorPageAgent(InstrumentingAgents* instrumentingAgents, Page* page, InspectorClient* client, InspectorOverlay* overlay)
     328InspectorPageAgent::InspectorPageAgent(InstrumentingAgents& instrumentingAgents, Page* page, InspectorClient* client, InspectorOverlay* overlay)
    329329    : InspectorAgentBase(ASCIILiteral("Page"), instrumentingAgents)
    330330    , m_page(page)
    331331    , m_client(client)
    332332    , m_overlay(overlay)
    333     , m_lastScriptIdentifier(0)
    334     , m_enabled(false)
    335     , m_isFirstLayoutAfterOnLoad(false)
    336     , m_originalScriptExecutionDisabled(false)
    337     , m_ignoreScriptsEnabledNotification(false)
    338     , m_showPaintRects(false)
    339333{
    340334}
     
    360354double InspectorPageAgent::timestamp()
    361355{
    362     return m_instrumentingAgents->inspectorEnvironment().executionStopwatch()->elapsedTime();
     356    return m_instrumentingAgents.inspectorEnvironment().executionStopwatch()->elapsedTime();
    363357}
    364358
     
    366360{
    367361    m_enabled = true;
    368     m_instrumentingAgents->setInspectorPageAgent(this);
    369 
    370     auto stopwatch = m_instrumentingAgents->inspectorEnvironment().executionStopwatch();
     362    m_instrumentingAgents.setInspectorPageAgent(this);
     363
     364    auto stopwatch = m_instrumentingAgents.inspectorEnvironment().executionStopwatch();
    371365    stopwatch->reset();
    372366    stopwatch->start();
     
    380374    m_enabled = false;
    381375    m_scriptsToEvaluateOnLoad = nullptr;
    382     m_instrumentingAgents->setInspectorPageAgent(nullptr);
     376    m_instrumentingAgents.setInspectorPageAgent(nullptr);
    383377
    384378    ErrorString unused;
     
    825819{
    826820    if (frame.isMainFrame()) {
    827         auto stopwatch = m_instrumentingAgents->inspectorEnvironment().executionStopwatch();
     821        auto stopwatch = m_instrumentingAgents.inspectorEnvironment().executionStopwatch();
    828822        stopwatch->reset();
    829823        stopwatch->start();
     
    10231017    ASSERT(frame);
    10241018
    1025     InspectorDOMAgent* domAgent = m_instrumentingAgents->inspectorDOMAgent();
     1019    InspectorDOMAgent* domAgent = m_instrumentingAgents.inspectorDOMAgent();
    10261020    ASSERT(domAgent);
    10271021    Node* node = domAgent->assertNode(errorString, nodeId);
  • trunk/Source/WebCore/inspector/InspectorPageAgent.h

    r180116 r189218  
    6969    WTF_MAKE_FAST_ALLOCATED;
    7070public:
    71     InspectorPageAgent(InstrumentingAgents*, Page*, InspectorClient*, InspectorOverlay*);
     71    InspectorPageAgent(InstrumentingAgents&, Page*, InspectorClient*, InspectorOverlay*);
    7272
    7373    enum ResourceType {
     
    167167    Ref<Inspector::Protocol::Page::Frame> buildObjectForFrame(Frame*);
    168168    Ref<Inspector::Protocol::Page::FrameResourceTree> buildObjectForFrameTree(Frame*);
    169     Page* m_page;
    170     InspectorClient* m_client;
     169
    171170    std::unique_ptr<Inspector::PageFrontendDispatcher> m_frontendDispatcher;
    172171    RefPtr<Inspector::PageBackendDispatcher> m_backendDispatcher;
    173     InspectorOverlay* m_overlay;
    174     long m_lastScriptIdentifier;
     172
     173    Page* m_page { nullptr };
     174    InspectorClient* m_client { nullptr };
     175    InspectorOverlay* m_overlay { nullptr };
     176
     177    long m_lastScriptIdentifier { 0 };
    175178    String m_pendingScriptToEvaluateOnLoadOnce;
    176179    String m_scriptToEvaluateOnLoadOnce;
     
    178181    HashMap<String, Frame*> m_identifierToFrame;
    179182    HashMap<DocumentLoader*, String> m_loaderToIdentifier;
    180     bool m_enabled;
    181     bool m_isFirstLayoutAfterOnLoad;
    182     bool m_originalScriptExecutionDisabled;
    183     bool m_ignoreScriptsEnabledNotification;
    184     bool m_showPaintRects;
     183    bool m_enabled { false };
     184    bool m_isFirstLayoutAfterOnLoad { false };
     185    bool m_originalScriptExecutionDisabled { false };
     186    bool m_ignoreScriptsEnabledNotification { false };
     187    bool m_showPaintRects { false };
    185188    String m_emulatedMedia;
    186189    RefPtr<Inspector::InspectorObject> m_scriptsToEvaluateOnLoad;
  • trunk/Source/WebCore/inspector/InspectorReplayAgent.cpp

    r186279 r189218  
    157157}
    158158
    159 InspectorReplayAgent::InspectorReplayAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent)
     159InspectorReplayAgent::InspectorReplayAgent(InstrumentingAgents& instrumentingAgents, InspectorPageAgent* pageAgent)
    160160    : InspectorAgentBase(ASCIILiteral("Replay"), instrumentingAgents)
    161161    , m_page(*pageAgent->page())
     
    179179    m_backendDispatcher = Inspector::ReplayBackendDispatcher::create(backendDispatcher, this);
    180180
    181     m_instrumentingAgents->setInspectorReplayAgent(this);
     181    m_instrumentingAgents.setInspectorReplayAgent(this);
    182182    ASSERT(sessionState() == WebCore::SessionState::Inactive);
    183183
     
    196196    m_backendDispatcher = nullptr;
    197197
    198     m_instrumentingAgents->setInspectorReplayAgent(nullptr);
     198    m_instrumentingAgents.setInspectorReplayAgent(nullptr);
    199199
    200200    // Drop references to all sessions and segments.
  • trunk/Source/WebCore/inspector/InspectorReplayAgent.h

    r185722 r189218  
    6363    WTF_MAKE_NONCOPYABLE(InspectorReplayAgent);
    6464public:
    65     InspectorReplayAgent(InstrumentingAgents*, InspectorPageAgent*);
     65    InspectorReplayAgent(InstrumentingAgents&, InspectorPageAgent*);
    6666    virtual ~InspectorReplayAgent();
    6767
  • trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp

    r186279 r189218  
    161161} // namespace
    162162
    163 InspectorResourceAgent::InspectorResourceAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InspectorClient* client)
     163InspectorResourceAgent::InspectorResourceAgent(InstrumentingAgents& instrumentingAgents, InspectorPageAgent* pageAgent, InspectorClient* client)
    164164    : InspectorAgentBase(ASCIILiteral("Network"), instrumentingAgents)
    165165    , m_pageAgent(pageAgent)
    166166    , m_client(client)
    167167    , m_resourcesData(std::make_unique<NetworkResourcesData>())
    168     , m_enabled(false)
    169     , m_cacheDisabled(false)
    170     , m_loadingXHRSynchronously(false)
    171     , m_isRecalculatingStyle(false)
    172168{
    173169}
     
    269265        disable(unused);
    270266    }
    271     ASSERT(!m_instrumentingAgents->inspectorResourceAgent());
     267    ASSERT(!m_instrumentingAgents.inspectorResourceAgent());
    272268}
    273269
    274270double InspectorResourceAgent::timestamp()
    275271{
    276     return m_instrumentingAgents->inspectorEnvironment().executionStopwatch()->elapsedTime();
     272    return m_instrumentingAgents.inspectorEnvironment().executionStopwatch()->elapsedTime();
    277273}
    278274
     
    608604        return;
    609605    m_enabled = true;
    610     m_instrumentingAgents->setInspectorResourceAgent(this);
     606    m_instrumentingAgents.setInspectorResourceAgent(this);
    611607}
    612608
     
    614610{
    615611    m_enabled = false;
    616     m_instrumentingAgents->setInspectorResourceAgent(nullptr);
     612    m_instrumentingAgents.setInspectorResourceAgent(nullptr);
    617613    m_resourcesData->clear();
    618614    m_extraRequestHeaders.clear();
  • trunk/Source/WebCore/inspector/InspectorResourceAgent.h

    r185722 r189218  
    7676    WTF_MAKE_FAST_ALLOCATED;
    7777public:
    78     InspectorResourceAgent(InstrumentingAgents*, InspectorPageAgent*, InspectorClient*);
     78    InspectorResourceAgent(InstrumentingAgents&, InspectorPageAgent*, InspectorClient*);
    7979    virtual ~InspectorResourceAgent();
    8080
     
    132132    double timestamp();
    133133
    134     InspectorPageAgent* m_pageAgent;
    135     InspectorClient* m_client;
    136134    std::unique_ptr<Inspector::NetworkFrontendDispatcher> m_frontendDispatcher;
    137135    RefPtr<Inspector::NetworkBackendDispatcher> m_backendDispatcher;
     136    InspectorPageAgent* m_pageAgent { nullptr };
     137
     138    InspectorClient* m_client { nullptr };
     139
    138140    std::unique_ptr<NetworkResourcesData> m_resourcesData;
    139     bool m_enabled;
    140     bool m_cacheDisabled;
    141     bool m_loadingXHRSynchronously;
     141    bool m_enabled { false };
     142    bool m_cacheDisabled { false };
     143    bool m_loadingXHRSynchronously { false };
    142144    HashMap<String, String> m_extraRequestHeaders;
    143 
    144145    HashSet<unsigned long> m_hiddenRequestIdentifiers;
    145 
    146146    // FIXME: InspectorResourceAgent should now be aware of style recalculation.
    147147    RefPtr<Inspector::Protocol::Network::Initiator> m_styleRecalculationInitiator;
    148     bool m_isRecalculatingStyle;
     148    bool m_isRecalculatingStyle { false };
    149149};
    150150
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp

    r188163 r189218  
    9595    m_backendDispatcher = Inspector::TimelineBackendDispatcher::create(backendDispatcher, this);
    9696
    97     m_instrumentingAgents->setPersistentInspectorTimelineAgent(this);
     97    m_instrumentingAgents.setPersistentInspectorTimelineAgent(this);
    9898
    9999    if (m_scriptDebugServer)
     
    106106    m_backendDispatcher = nullptr;
    107107
    108     m_instrumentingAgents->setPersistentInspectorTimelineAgent(nullptr);
     108    m_instrumentingAgents.setPersistentInspectorTimelineAgent(nullptr);
    109109
    110110    if (reason != Inspector::DisconnectReason::InspectedTargetDestroyed) {
     
    141141        m_maxCallStackDepth = 5;
    142142
    143     m_instrumentingAgents->setInspectorTimelineAgent(this);
     143    m_instrumentingAgents.setInspectorTimelineAgent(this);
    144144
    145145    if (m_scriptDebugServer)
     
    194194        return;
    195195
    196     m_instrumentingAgents->setInspectorTimelineAgent(nullptr);
     196    m_instrumentingAgents.setInspectorTimelineAgent(nullptr);
    197197
    198198    if (m_scriptDebugServer)
     
    220220double InspectorTimelineAgent::timestamp()
    221221{
    222     return m_instrumentingAgents->inspectorEnvironment().executionStopwatch()->elapsedTime();
     222    return m_instrumentingAgents.inspectorEnvironment().executionStopwatch()->elapsedTime();
    223223}
    224224
     
    267267        internalStart();
    268268
    269     startProfiling(exec, title, m_instrumentingAgents->inspectorEnvironment().executionStopwatch());
     269    startProfiling(exec, title, m_instrumentingAgents.inspectorEnvironment().executionStopwatch());
    270270
    271271    m_pendingConsoleProfileRecords.append(createRecordEntry(TimelineRecordFactory::createConsoleProfileData(title), TimelineRecordType::ConsoleProfile, true, frameFromExecState(exec)));
     
    306306
    307307    if (frame && !m_callStackDepth)
    308         startProfiling(frame, ASCIILiteral("Timeline FunctionCall"), m_instrumentingAgents->inspectorEnvironment().executionStopwatch());
     308        startProfiling(frame, ASCIILiteral("Timeline FunctionCall"), m_instrumentingAgents.inspectorEnvironment().executionStopwatch());
    309309
    310310    ++m_callStackDepth;
     
    495495    if (!m_callStackDepth) {
    496496        ++m_callStackDepth;
    497         startProfiling(&frame, ASCIILiteral("Timeline EvaluateScript"), m_instrumentingAgents->inspectorEnvironment().executionStopwatch());
     497        startProfiling(&frame, ASCIILiteral("Timeline EvaluateScript"), m_instrumentingAgents.inspectorEnvironment().executionStopwatch());
    498498    }
    499499}
     
    730730}
    731731
    732 InspectorTimelineAgent::InspectorTimelineAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InspectorType type, InspectorClient* client)
     732InspectorTimelineAgent::InspectorTimelineAgent(InstrumentingAgents& instrumentingAgents, InspectorPageAgent* pageAgent, InspectorType type, InspectorClient* client)
    733733    : InspectorAgentBase(ASCIILiteral("Timeline"), instrumentingAgents)
    734734    , m_pageAgent(pageAgent)
     735    , m_client(client)
    735736    , m_inspectorType(type)
    736     , m_client(client)
    737737{
    738738}
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.h

    r186133 r189218  
    118118    enum InspectorType { PageInspector, WorkerInspector };
    119119
    120     InspectorTimelineAgent(InstrumentingAgents*, InspectorPageAgent*, InspectorType, InspectorClient*);
     120    InspectorTimelineAgent(InstrumentingAgents&, InspectorPageAgent*, InspectorType, InspectorClient*);
    121121    virtual ~InspectorTimelineAgent();
    122122
     
    232232    Page* page();
    233233
    234     InspectorPageAgent* m_pageAgent;
    235     PageScriptDebugServer* m_scriptDebugServer { nullptr };
    236 
    237234    std::unique_ptr<Inspector::TimelineFrontendDispatcher> m_frontendDispatcher;
    238235    RefPtr<Inspector::TimelineBackendDispatcher> m_backendDispatcher;
     236    InspectorPageAgent* m_pageAgent;
     237
     238    PageScriptDebugServer* m_scriptDebugServer { nullptr };
     239    InspectorClient* m_client { nullptr };
    239240
    240241    Vector<TimelineRecordEntry> m_recordStack;
    241 
    242242    int m_id { 1 };
    243243    int m_callStackDepth { 0 };
    244244    int m_maxCallStackDepth { 5 };
    245245    InspectorType m_inspectorType;
    246     InspectorClient* m_client;
    247246
    248247    Vector<TimelineRecordEntry> m_pendingConsoleProfileRecords;
  • trunk/Source/WebCore/inspector/InspectorWebAgentBase.h

    r160457 r189218  
    3838class InspectorAgentBase : public Inspector::InspectorAgentBase {
    3939protected:
    40     InspectorAgentBase(const String& name, InstrumentingAgents* instrumentingAgents)
     40    InspectorAgentBase(const String& name, InstrumentingAgents& instrumentingAgents)
    4141        : Inspector::InspectorAgentBase(name)
    4242        , m_instrumentingAgents(instrumentingAgents)
     
    4444    }
    4545
    46     InstrumentingAgents* m_instrumentingAgents;
     46    InstrumentingAgents& m_instrumentingAgents;
    4747};
    4848   
  • trunk/Source/WebCore/inspector/InspectorWorkerAgent.cpp

    r186279 r189218  
    102102int InspectorWorkerAgent::WorkerFrontendChannel::s_nextId = 1;
    103103
    104 InspectorWorkerAgent::InspectorWorkerAgent(InstrumentingAgents* instrumentingAgents)
     104InspectorWorkerAgent::InspectorWorkerAgent(InstrumentingAgents& instrumentingAgents)
    105105    : InspectorAgentBase(ASCIILiteral("Worker"), instrumentingAgents)
    106     , m_enabled(false)
    107     , m_shouldPauseDedicatedWorkerOnStart(false)
    108 {
    109     m_instrumentingAgents->setInspectorWorkerAgent(this);
     106{
     107    m_instrumentingAgents.setInspectorWorkerAgent(this);
    110108}
    111109
    112110InspectorWorkerAgent::~InspectorWorkerAgent()
    113111{
    114     m_instrumentingAgents->setInspectorWorkerAgent(nullptr);
     112    m_instrumentingAgents.setInspectorWorkerAgent(nullptr);
    115113}
    116114
  • trunk/Source/WebCore/inspector/InspectorWorkerAgent.h

    r185722 r189218  
    5252    WTF_MAKE_FAST_ALLOCATED;
    5353public:
    54     explicit InspectorWorkerAgent(InstrumentingAgents*);
     54    explicit InspectorWorkerAgent(InstrumentingAgents&);
    5555    virtual ~InspectorWorkerAgent();
    5656
     
    7777    void destroyWorkerFrontendChannels();
    7878
     79    class WorkerFrontendChannel;
     80
    7981    std::unique_ptr<Inspector::WorkerFrontendDispatcher> m_frontendDispatcher;
    8082    RefPtr<Inspector::WorkerBackendDispatcher> m_backendDispatcher;
    81     bool m_enabled;
    82     bool m_shouldPauseDedicatedWorkerOnStart;
    8383
    84     class WorkerFrontendChannel;
     84    bool m_enabled { false };
     85    bool m_shouldPauseDedicatedWorkerOnStart { false };
     86   
    8587    typedef HashMap<int, WorkerFrontendChannel*> WorkerChannels;
    8688    WorkerChannels m_idToChannel;
  • trunk/Source/WebCore/inspector/InstrumentingAgents.cpp

    r182193 r189218  
    11/*
    22 * Copyright (C) 2011 Google Inc. All rights reserved.
    3  * Copyright (C) 2014 Apple Inc. All rights reserved.
     3 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    4545InstrumentingAgents::InstrumentingAgents(InspectorEnvironment& environment)
    4646    : m_environment(environment)
    47     , m_inspectorAgent(nullptr)
    48     , m_inspectorPageAgent(nullptr)
    49     , m_inspectorCSSAgent(nullptr)
    50     , m_inspectorLayerTreeAgent(nullptr)
    51     , m_webConsoleAgent(nullptr)
    52     , m_inspectorDOMAgent(nullptr)
    53     , m_inspectorResourceAgent(nullptr)
    54     , m_pageRuntimeAgent(nullptr)
    55     , m_workerRuntimeAgent(nullptr)
    56     , m_inspectorTimelineAgent(nullptr)
    57     , m_persistentInspectorTimelineAgent(nullptr)
    58     , m_inspectorDOMStorageAgent(nullptr)
    59 #if ENABLE(WEB_REPLAY)
    60     , m_inspectorReplayAgent(nullptr)
    61 #endif
    62     , m_inspectorDatabaseAgent(nullptr)
    63     , m_inspectorApplicationCacheAgent(nullptr)
    64     , m_inspectorDebuggerAgent(nullptr)
    65     , m_pageDebuggerAgent(nullptr)
    66     , m_inspectorDOMDebuggerAgent(nullptr)
    67     , m_inspectorWorkerAgent(nullptr)
    6847{
    6948}
  • trunk/Source/WebCore/inspector/InstrumentingAgents.h

    r182193 r189218  
    11/*
    22 * Copyright (C) 2011 Google Inc. All rights reserved.
    3  * Copyright (C) 2014 Apple Inc. All rights reserved.
     3 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    6969    WTF_MAKE_FAST_ALLOCATED;
    7070public:
    71     static PassRefPtr<InstrumentingAgents> create(Inspector::InspectorEnvironment& environment)
     71    // FIXME: InstrumentingAgents could be uniquely owned by InspectorController if instrumentation
     72    // cookies kept only a weak reference to InstrumentingAgents. Then, reset() would be unnecessary.
     73    static Ref<InstrumentingAgents> create(Inspector::InspectorEnvironment& environment)
    7274    {
    73         return adoptRef(new InstrumentingAgents(environment));
     75        return adoptRef(*new InstrumentingAgents(environment));
    7476    }
    7577    ~InstrumentingAgents() { }
     
    142144    Inspector::InspectorEnvironment& m_environment;
    143145
    144     Inspector::InspectorAgent* m_inspectorAgent;
    145     InspectorPageAgent* m_inspectorPageAgent;
    146     InspectorCSSAgent* m_inspectorCSSAgent;
    147     InspectorLayerTreeAgent* m_inspectorLayerTreeAgent;
    148     WebConsoleAgent* m_webConsoleAgent;
    149     InspectorDOMAgent* m_inspectorDOMAgent;
    150     InspectorResourceAgent* m_inspectorResourceAgent;
    151     PageRuntimeAgent* m_pageRuntimeAgent;
    152     WorkerRuntimeAgent* m_workerRuntimeAgent;
    153     InspectorTimelineAgent* m_inspectorTimelineAgent;
    154     InspectorTimelineAgent* m_persistentInspectorTimelineAgent;
    155     InspectorDOMStorageAgent* m_inspectorDOMStorageAgent;
     146    Inspector::InspectorAgent* m_inspectorAgent { nullptr };
     147    InspectorPageAgent* m_inspectorPageAgent { nullptr };
     148    InspectorCSSAgent* m_inspectorCSSAgent { nullptr };
     149    InspectorLayerTreeAgent* m_inspectorLayerTreeAgent { nullptr };
     150    WebConsoleAgent* m_webConsoleAgent { nullptr };
     151    InspectorDOMAgent* m_inspectorDOMAgent { nullptr };
     152    InspectorResourceAgent* m_inspectorResourceAgent { nullptr };
     153    PageRuntimeAgent* m_pageRuntimeAgent { nullptr };
     154    WorkerRuntimeAgent* m_workerRuntimeAgent { nullptr };
     155    InspectorTimelineAgent* m_inspectorTimelineAgent { nullptr };
     156    InspectorTimelineAgent* m_persistentInspectorTimelineAgent { nullptr };
     157    InspectorDOMStorageAgent* m_inspectorDOMStorageAgent { nullptr };
    156158#if ENABLE(WEB_REPLAY)
    157     InspectorReplayAgent* m_inspectorReplayAgent;
     159    InspectorReplayAgent* m_inspectorReplayAgent { nullptr };
    158160#endif
    159     InspectorDatabaseAgent* m_inspectorDatabaseAgent;
    160     InspectorApplicationCacheAgent* m_inspectorApplicationCacheAgent;
    161     Inspector::InspectorDebuggerAgent* m_inspectorDebuggerAgent;
    162     PageDebuggerAgent* m_pageDebuggerAgent;
    163     InspectorDOMDebuggerAgent* m_inspectorDOMDebuggerAgent;
    164     InspectorWorkerAgent* m_inspectorWorkerAgent;
     161    InspectorDatabaseAgent* m_inspectorDatabaseAgent { nullptr };
     162    InspectorApplicationCacheAgent* m_inspectorApplicationCacheAgent { nullptr };
     163    Inspector::InspectorDebuggerAgent* m_inspectorDebuggerAgent { nullptr };
     164    PageDebuggerAgent* m_pageDebuggerAgent { nullptr };
     165    InspectorDOMDebuggerAgent* m_inspectorDOMDebuggerAgent { nullptr };
     166    InspectorWorkerAgent* m_inspectorWorkerAgent { nullptr };
    165167};
    166168
    167 }
     169} // namespace WebCore
    168170
    169171#endif // !defined(InstrumentingAgents_h)
  • trunk/Source/WebCore/inspector/PageConsoleAgent.cpp

    r178820 r189218  
    11/*
    22 * Copyright (C) 2011 Google Inc. All rights reserved.
     3 * Copyright (C) 2015 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    4142namespace WebCore {
    4243
    43 PageConsoleAgent::PageConsoleAgent(WebInjectedScriptManager* injectedScriptManager, InspectorDOMAgent* domAgent)
     44PageConsoleAgent::PageConsoleAgent(WebInjectedScriptManager& injectedScriptManager, InspectorDOMAgent* domAgent)
    4445    : WebConsoleAgent(injectedScriptManager)
    4546    , m_inspectorDOMAgent(domAgent)
     
    7374    }
    7475
    75     if (CommandLineAPIHost* commandLineAPIHost = static_cast<WebInjectedScriptManager*>(m_injectedScriptManager)->commandLineAPIHost())
     76    if (CommandLineAPIHost* commandLineAPIHost = static_cast<WebInjectedScriptManager&>(m_injectedScriptManager).commandLineAPIHost())
    7677        commandLineAPIHost->addInspectedObject(std::make_unique<InspectableNode>(node));
    7778}
  • trunk/Source/WebCore/inspector/PageConsoleAgent.h

    r178820 r189218  
    11/*
    22 * Copyright (C) 2011 Google Inc. All rights reserved.
     3 * Copyright (C) 2015 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    4243    WTF_MAKE_FAST_ALLOCATED;
    4344public:
    44     PageConsoleAgent(WebInjectedScriptManager*, InspectorDOMAgent*);
     45    PageConsoleAgent(WebInjectedScriptManager&, InspectorDOMAgent*);
    4546    virtual ~PageConsoleAgent() { }
    4647
  • trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp

    r180653 r189218  
    11/*
    22 * Copyright (C) 2011 Google Inc. All rights reserved.
     3 * Copyright (C) 2015 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    5051namespace WebCore {
    5152
    52 PageDebuggerAgent::PageDebuggerAgent(InjectedScriptManager* injectedScriptManager, InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InspectorOverlay* overlay)
     53PageDebuggerAgent::PageDebuggerAgent(InjectedScriptManager& injectedScriptManager, InstrumentingAgents& instrumentingAgents, InspectorPageAgent* pageAgent, InspectorOverlay* overlay)
    5354    : WebDebuggerAgent(injectedScriptManager, instrumentingAgents)
    5455    , m_pageAgent(pageAgent)
     
    6162{
    6263    WebDebuggerAgent::enable();
    63     m_instrumentingAgents->setPageDebuggerAgent(this);
     64    m_instrumentingAgents.setPageDebuggerAgent(this);
    6465}
    6566
     
    6768{
    6869    WebDebuggerAgent::disable(isBeingDestroyed);
    69     m_instrumentingAgents->setPageDebuggerAgent(nullptr);
     70    m_instrumentingAgents.setPageDebuggerAgent(nullptr);
    7071}
    7172
     
    125126    if (!executionContextId) {
    126127        JSC::ExecState* scriptState = mainWorldExecState(m_pageAgent->mainFrame());
    127         return injectedScriptManager()->injectedScriptFor(scriptState);
     128        return injectedScriptManager().injectedScriptFor(scriptState);
    128129    }
    129130
    130     InjectedScript injectedScript = injectedScriptManager()->injectedScriptForId(*executionContextId);
     131    InjectedScript injectedScript = injectedScriptManager().injectedScriptForId(*executionContextId);
    131132    if (injectedScript.hasNoValue())
    132133        errorString = ASCIILiteral("Execution context with given id not found.");
  • trunk/Source/WebCore/inspector/PageDebuggerAgent.h

    r178820 r189218  
    11/*
    22 * Copyright (C) 2011 Google Inc. All rights reserved.
     3 * Copyright (C) 2015 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    4748    WTF_MAKE_FAST_ALLOCATED;
    4849public:
    49     PageDebuggerAgent(Inspector::InjectedScriptManager*, InstrumentingAgents*, InspectorPageAgent*, InspectorOverlay*);
     50    PageDebuggerAgent(Inspector::InjectedScriptManager&, InstrumentingAgents&, InspectorPageAgent*, InspectorOverlay*);
    5051    virtual ~PageDebuggerAgent() { }
    5152
     
    7172    virtual void setOverlayMessage(ErrorString&, const String*) override;
    7273
    73     InspectorPageAgent* m_pageAgent;
    74     InspectorOverlay* m_overlay;
     74    InspectorPageAgent* m_pageAgent { nullptr };
     75
     76    InspectorOverlay* m_overlay { nullptr };
    7577    PageScriptDebugServer m_scriptDebugServer;
    7678};
  • trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp

    r186279 r189218  
    5353namespace WebCore {
    5454
    55 PageRuntimeAgent::PageRuntimeAgent(InjectedScriptManager* injectedScriptManager, Page* page, InspectorPageAgent* pageAgent)
     55PageRuntimeAgent::PageRuntimeAgent(InjectedScriptManager& injectedScriptManager, Page* page, InspectorPageAgent* pageAgent)
    5656    : InspectorRuntimeAgent(injectedScriptManager)
     57    , m_pageAgent(pageAgent)
    5758    , m_inspectedPage(page)
    58     , m_pageAgent(pageAgent)
    59     , m_mainWorldContextCreated(false)
    6059{
    6160}
     
    122121    if (!executionContextId) {
    123122        JSC::ExecState* scriptState = mainWorldExecState(&m_inspectedPage->mainFrame());
    124         InjectedScript result = injectedScriptManager()->injectedScriptFor(scriptState);
     123        InjectedScript result = injectedScriptManager().injectedScriptFor(scriptState);
    125124        if (result.hasNoValue())
    126125            errorString = ASCIILiteral("Internal error: main world execution context not found.");
     
    128127    }
    129128
    130     InjectedScript injectedScript = injectedScriptManager()->injectedScriptForId(*executionContextId);
     129    InjectedScript injectedScript = injectedScriptManager().injectedScriptForId(*executionContextId);
    131130    if (injectedScript.hasNoValue())
    132131        errorString = ASCIILiteral("Execution context with given id not found.");
     
    167166    ASSERT(securityOrigin || isPageContext);
    168167
    169     InjectedScript result = injectedScriptManager()->injectedScriptFor(scriptState);
     168    InjectedScript result = injectedScriptManager().injectedScriptFor(scriptState);
    170169    if (result.hasNoValue())
    171170        return;
    172171
    173     int executionContextId = injectedScriptManager()->injectedScriptIdFor(scriptState);
     172    int executionContextId = injectedScriptManager().injectedScriptIdFor(scriptState);
    174173    String name = securityOrigin ? securityOrigin->toRawString() : String();
    175174    m_frontendDispatcher->executionContextCreated(ExecutionContextDescription::create()
  • trunk/Source/WebCore/inspector/PageRuntimeAgent.h

    r180116 r189218  
    5454    WTF_MAKE_FAST_ALLOCATED;
    5555public:
    56     PageRuntimeAgent(Inspector::InjectedScriptManager*, Page*, InspectorPageAgent*);
     56    PageRuntimeAgent(Inspector::InjectedScriptManager&, Page*, InspectorPageAgent*);
    5757    virtual ~PageRuntimeAgent() { }
    5858
     
    7373    void notifyContextCreated(const String& frameId, JSC::ExecState*, SecurityOrigin*, bool isPageContext);
    7474
    75     Page* m_inspectedPage;
    76     InspectorPageAgent* m_pageAgent;
    7775    std::unique_ptr<Inspector::RuntimeFrontendDispatcher> m_frontendDispatcher;
    7876    RefPtr<Inspector::RuntimeBackendDispatcher> m_backendDispatcher;
    79     bool m_mainWorldContextCreated;
     77    InspectorPageAgent* m_pageAgent;
     78
     79    Page* m_inspectedPage;
     80
     81    bool m_mainWorldContextCreated { false };
    8082};
    8183
  • trunk/Source/WebCore/inspector/WebConsoleAgent.cpp

    r178820 r189218  
    11/*
    2  * Copyright (C) 2014 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
    33 * Copyright (C) 2011 Google Inc. All rights reserved.
    44 *
     
    4242namespace WebCore {
    4343
    44 WebConsoleAgent::WebConsoleAgent(WebInjectedScriptManager* injectedScriptManager)
     44WebConsoleAgent::WebConsoleAgent(WebInjectedScriptManager& injectedScriptManager)
    4545    : InspectorConsoleAgent(injectedScriptManager)
    46     , m_monitoringXHREnabled(false)
    4746{
    4847}
     
    6564    }
    6665
    67     static_cast<WebInjectedScriptManager*>(m_injectedScriptManager)->discardInjectedScriptsFor(window);
     66    static_cast<WebInjectedScriptManager&>(m_injectedScriptManager).discardInjectedScriptsFor(window);
    6867}
    6968
    7069void WebConsoleAgent::didFinishXHRLoading(unsigned long requestIdentifier, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)
    7170{
    72     if (!m_injectedScriptManager->inspectorEnvironment().developerExtrasEnabled())
     71    if (!m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled())
    7372        return;
    7473
     
    8180void WebConsoleAgent::didReceiveResponse(unsigned long requestIdentifier, const ResourceResponse& response)
    8281{
    83     if (!m_injectedScriptManager->inspectorEnvironment().developerExtrasEnabled())
     82    if (!m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled())
    8483        return;
    8584
     
    9291void WebConsoleAgent::didFailLoading(unsigned long requestIdentifier, const ResourceError& error)
    9392{
    94     if (!m_injectedScriptManager->inspectorEnvironment().developerExtrasEnabled())
     93    if (!m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled())
    9594        return;
    9695
  • trunk/Source/WebCore/inspector/WebConsoleAgent.h

    r178820 r189218  
    11/*
    2  * Copyright (C) 2014 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
    33 * Copyright (C) 2011 Google Inc. All rights reserved.
    44 *
     
    4141    WTF_MAKE_FAST_ALLOCATED;
    4242public:
    43     WebConsoleAgent(WebInjectedScriptManager*);
     43    WebConsoleAgent(WebInjectedScriptManager&);
    4444    virtual ~WebConsoleAgent() { }
    4545
     
    5353
    5454protected:
    55     bool m_monitoringXHREnabled;
     55    bool m_monitoringXHREnabled { false };
    5656};
    5757
  • trunk/Source/WebCore/inspector/WebDebuggerAgent.cpp

    r178820 r189218  
    11/*
    2  * Copyright (C) 2014 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3333namespace WebCore {
    3434
    35 WebDebuggerAgent::WebDebuggerAgent(InjectedScriptManager* injectedScriptManager, InstrumentingAgents* instrumentingAgents)
     35WebDebuggerAgent::WebDebuggerAgent(InjectedScriptManager& injectedScriptManager, InstrumentingAgents& instrumentingAgents)
    3636    : InspectorDebuggerAgent(injectedScriptManager)
    3737    , m_instrumentingAgents(instrumentingAgents)
     
    4242{
    4343    InspectorDebuggerAgent::enable();
    44     m_instrumentingAgents->setInspectorDebuggerAgent(this);
     44    m_instrumentingAgents.setInspectorDebuggerAgent(this);
    4545}
    4646
     
    4848{
    4949    InspectorDebuggerAgent::disable(isBeingDestroyed);
    50     m_instrumentingAgents->setInspectorDebuggerAgent(nullptr);
     50    m_instrumentingAgents.setInspectorDebuggerAgent(nullptr);
    5151}
    5252
  • trunk/Source/WebCore/inspector/WebDebuggerAgent.h

    r178820 r189218  
    11/*
    2  * Copyright (C) 2014 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3838    WTF_MAKE_FAST_ALLOCATED;
    3939public:
    40     WebDebuggerAgent(Inspector::InjectedScriptManager*, InstrumentingAgents*);
     40    WebDebuggerAgent(Inspector::InjectedScriptManager&, InstrumentingAgents&);
    4141    virtual ~WebDebuggerAgent() { }
    4242
     
    4545    virtual void disable(bool isBeingDestroyed) override;
    4646
    47     InstrumentingAgents* m_instrumentingAgents;
     47    InstrumentingAgents& m_instrumentingAgents;
    4848};
    4949
  • trunk/Source/WebCore/inspector/WorkerConsoleAgent.cpp

    r178820 r189218  
    11/*
    22 * Copyright (C) 2011 Google Inc. All rights reserved.
     3 * Copyright (C) 2015 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3637namespace WebCore {
    3738
    38 WorkerConsoleAgent::WorkerConsoleAgent(WebInjectedScriptManager* injectedScriptManager)
     39WorkerConsoleAgent::WorkerConsoleAgent(WebInjectedScriptManager& injectedScriptManager)
    3940    : WebConsoleAgent(injectedScriptManager)
    4041{
  • trunk/Source/WebCore/inspector/WorkerConsoleAgent.h

    r178820 r189218  
    11/*
    22 * Copyright (C) 2011 Google Inc. All rights reserved.
     3 * Copyright (C) 2015 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    4041    WTF_MAKE_FAST_ALLOCATED;
    4142public:
    42     WorkerConsoleAgent(WebInjectedScriptManager*);
     43    WorkerConsoleAgent(WebInjectedScriptManager&);
    4344    virtual ~WorkerConsoleAgent() { }
    4445
  • trunk/Source/WebCore/inspector/WorkerDebuggerAgent.cpp

    r188642 r189218  
    11/*
    22 * Copyright (C) 2011 Google Inc. All rights reserved.
     3 * Copyright (C) 2015 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    8182const char* WorkerDebuggerAgent::debuggerTaskMode = "debugger";
    8283
    83 WorkerDebuggerAgent::WorkerDebuggerAgent(InjectedScriptManager* injectedScriptManager, InstrumentingAgents* instrumentingAgents, WorkerGlobalScope* inspectedWorkerGlobalScope)
     84WorkerDebuggerAgent::WorkerDebuggerAgent(InjectedScriptManager& injectedScriptManager, InstrumentingAgents& instrumentingAgents, WorkerGlobalScope* inspectedWorkerGlobalScope)
    8485    : WebDebuggerAgent(injectedScriptManager, instrumentingAgents)
    8586    , m_scriptDebugServer(inspectedWorkerGlobalScope, WorkerDebuggerAgent::debuggerTaskMode)
     
    134135
    135136    JSC::ExecState* scriptState = execStateFromWorkerGlobalScope(m_inspectedWorkerGlobalScope);
    136     return injectedScriptManager()->injectedScriptFor(scriptState);
     137    return injectedScriptManager().injectedScriptFor(scriptState);
    137138}
    138139
  • trunk/Source/WebCore/inspector/WorkerDebuggerAgent.h

    r178820 r189218  
    11/*
    22 * Copyright (C) 2011 Google Inc. All rights reserved.
     3 * Copyright (C) 2015 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    4445    WTF_MAKE_FAST_ALLOCATED;
    4546public:
    46     WorkerDebuggerAgent(Inspector::InjectedScriptManager*, InstrumentingAgents*, WorkerGlobalScope*);
     47    WorkerDebuggerAgent(Inspector::InjectedScriptManager&, InstrumentingAgents&, WorkerGlobalScope*);
    4748    virtual ~WorkerDebuggerAgent();
    4849
     
    6162private:
    6263    WorkerScriptDebugServer m_scriptDebugServer;
    63     WorkerGlobalScope* m_inspectedWorkerGlobalScope;
     64    WorkerGlobalScope* m_inspectedWorkerGlobalScope { nullptr };
    6465};
    6566
  • trunk/Source/WebCore/inspector/WorkerInspectorController.cpp

    r189034 r189218  
    8080    , m_instrumentingAgents(InstrumentingAgents::create(*this))
    8181    , m_injectedScriptManager(std::make_unique<WebInjectedScriptManager>(*this, WebInjectedScriptHost::create()))
    82     , m_runtimeAgent(nullptr)
    8382    , m_executionStopwatch(Stopwatch::create())
    8483{
    85     auto runtimeAgent = std::make_unique<WorkerRuntimeAgent>(m_injectedScriptManager.get(), &workerGlobalScope);
     84    auto runtimeAgent = std::make_unique<WorkerRuntimeAgent>(*m_injectedScriptManager, &workerGlobalScope);
    8685    m_runtimeAgent = runtimeAgent.get();
    8786    m_instrumentingAgents->setWorkerRuntimeAgent(m_runtimeAgent);
    8887    m_agents.append(WTF::move(runtimeAgent));
    8988
    90     auto consoleAgent = std::make_unique<WorkerConsoleAgent>(m_injectedScriptManager.get());
     89    auto consoleAgent = std::make_unique<WorkerConsoleAgent>(*m_injectedScriptManager);
    9190    m_instrumentingAgents->setWebConsoleAgent(consoleAgent.get());
    9291
    93     auto debuggerAgent = std::make_unique<WorkerDebuggerAgent>(m_injectedScriptManager.get(), m_instrumentingAgents.get(), &workerGlobalScope);
     92    auto debuggerAgent = std::make_unique<WorkerDebuggerAgent>(*m_injectedScriptManager, m_instrumentingAgents.get(), &workerGlobalScope);
    9493    m_runtimeAgent->setScriptDebugServer(&debuggerAgent->scriptDebugServer());
    9594    m_agents.append(WTF::move(debuggerAgent));
  • trunk/Source/WebCore/inspector/WorkerInspectorController.h

    r180116 r189218  
    7575
    7676    WorkerGlobalScope& m_workerGlobalScope;
    77     RefPtr<InstrumentingAgents> m_instrumentingAgents;
     77    Ref<InstrumentingAgents> m_instrumentingAgents;
    7878    std::unique_ptr<WebInjectedScriptManager> m_injectedScriptManager;
    79     WorkerRuntimeAgent* m_runtimeAgent;
     79    WorkerRuntimeAgent* m_runtimeAgent { nullptr };
    8080    Inspector::AgentRegistry m_agents;
    8181    std::unique_ptr<Inspector::FrontendChannel> m_frontendChannel;
  • trunk/Source/WebCore/inspector/WorkerRuntimeAgent.cpp

    r186279 r189218  
    4747namespace WebCore {
    4848
    49 WorkerRuntimeAgent::WorkerRuntimeAgent(InjectedScriptManager* injectedScriptManager, WorkerGlobalScope* workerGlobalScope)
     49WorkerRuntimeAgent::WorkerRuntimeAgent(InjectedScriptManager& injectedScriptManager, WorkerGlobalScope* workerGlobalScope)
    5050    : InspectorRuntimeAgent(injectedScriptManager)
    5151    , m_workerGlobalScope(workerGlobalScope)
    52     , m_paused(false)
    5352{
    5453}
     
    7473
    7574    JSC::ExecState* scriptState = execStateFromWorkerGlobalScope(m_workerGlobalScope);
    76     return injectedScriptManager()->injectedScriptFor(scriptState);
     75    return injectedScriptManager().injectedScriptFor(scriptState);
    7776}
    7877
  • trunk/Source/WebCore/inspector/WorkerRuntimeAgent.h

    r180116 r189218  
    4141class WorkerRuntimeAgent final : public Inspector::InspectorRuntimeAgent {
    4242public:
    43     WorkerRuntimeAgent(Inspector::InjectedScriptManager*, WorkerGlobalScope*);
     43    WorkerRuntimeAgent(Inspector::InjectedScriptManager&, WorkerGlobalScope*);
    4444    virtual ~WorkerRuntimeAgent() { }
    4545
     
    5656    virtual void muteConsole() override;
    5757    virtual void unmuteConsole() override;
    58     WorkerGlobalScope* m_workerGlobalScope;
    5958    RefPtr<Inspector::RuntimeBackendDispatcher> m_backendDispatcher;
    60     bool m_paused;
     59
     60    WorkerGlobalScope* m_workerGlobalScope { nullptr };
     61    bool m_paused { false };
    6162};
    6263
Note: See TracChangeset for help on using the changeset viewer.