Changeset 189218 in webkit
- Timestamp:
- Sep 1, 2015 10:52:15 AM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 71 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r189201 r189218 1 2015-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 1 62 2015-08-31 Yusuke Suzuki <utatane.tea@gmail.com> 2 63 -
trunk/Source/JavaScriptCore/inspector/ConsoleMessage.cpp
r186279 r189218 1 1 /* 2 * Copyright (C) 2007, 2008, 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2007, 2008, 2014, 2015 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 4 4 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. … … 50 50 , m_message(message) 51 51 , m_url() 52 , m_line(0)53 , m_column(0)54 , m_repeatCount(1)55 52 , m_requestId(IdentifiersFactory::requestId(requestIdentifier)) 56 53 { … … 65 62 , m_line(line) 66 63 , m_column(column) 67 , m_repeatCount(1)68 64 , m_requestId(IdentifiersFactory::requestId(requestIdentifier)) 69 65 { … … 77 73 , m_message(message) 78 74 , m_url() 79 , m_line(0)80 , m_column(0)81 , m_repeatCount(1)82 75 , m_requestId(IdentifiersFactory::requestId(requestIdentifier)) 83 76 { … … 99 92 , m_arguments(arguments) 100 93 , m_url() 101 , m_line(0)102 , m_column(0)103 , m_repeatCount(1)104 94 , m_requestId(IdentifiersFactory::requestId(requestIdentifier)) 105 95 { … … 180 170 } 181 171 182 void ConsoleMessage::addToFrontend(ConsoleFrontendDispatcher * consoleFrontendDispatcher, InjectedScriptManager*injectedScriptManager, bool generatePreview)172 void ConsoleMessage::addToFrontend(ConsoleFrontendDispatcher& consoleFrontendDispatcher, InjectedScriptManager& injectedScriptManager, bool generatePreview) 183 173 { 184 174 Ref<Inspector::Protocol::Console::ConsoleMessage> jsonObj = Inspector::Protocol::Console::ConsoleMessage::create() … … 199 189 200 190 if (m_arguments && m_arguments->argumentCount()) { 201 InjectedScript injectedScript = injectedScriptManager ->injectedScriptFor(m_arguments->globalState());191 InjectedScript injectedScript = injectedScriptManager.injectedScriptFor(m_arguments->globalState()); 202 192 if (!injectedScript.hasNoValue()) { 203 193 Ref<Inspector::Protocol::Array<Inspector::Protocol::Runtime::RemoteObject>> jsonArgs = Inspector::Protocol::Array<Inspector::Protocol::Runtime::RemoteObject>::create(); … … 230 220 jsonObj->setStackTrace(m_callStack->buildInspectorArray()); 231 221 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 225 void ConsoleMessage::updateRepeatCountInConsole(ConsoleFrontendDispatcher& consoleFrontendDispatcher) 226 { 227 consoleFrontendDispatcher.messageRepeatCountUpdated(m_repeatCount); 238 228 } 239 229 -
trunk/Source/JavaScriptCore/inspector/ConsoleMessage.h
r180116 r189218 1 1 /* 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2007, 2008, 2015 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 4 4 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. … … 56 56 ~ConsoleMessage(); 57 57 58 void addToFrontend(ConsoleFrontendDispatcher *, InjectedScriptManager*, bool generatePreview);59 void updateRepeatCountInConsole(ConsoleFrontendDispatcher *);58 void addToFrontend(ConsoleFrontendDispatcher&, InjectedScriptManager&, bool generatePreview); 59 void updateRepeatCountInConsole(ConsoleFrontendDispatcher&); 60 60 61 61 MessageSource source() const { return m_source; } … … 85 85 RefPtr<ScriptCallStack> m_callStack; 86 86 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 }; 90 90 String m_requestId; 91 91 }; -
trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp
r186279 r189218 73 73 { 74 74 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()); 78 78 79 79 m_inspectorAgent = inspectorAgent.get(); -
trunk/Source/JavaScriptCore/inspector/agents/InspectorAgent.cpp
r186279 r189218 1 1 /* 2 * Copyright (C) 2007 , 2008, 2009, 2010Apple Inc. All rights reserved.2 * Copyright (C) 2007-2010, 2015 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 4 4 * Copyright (C) 2011 Google Inc. All rights reserved. … … 41 41 : InspectorAgentBase(ASCIILiteral("Inspector")) 42 42 , m_environment(environment) 43 , m_enabled(false)44 43 { 45 44 } -
trunk/Source/JavaScriptCore/inspector/agents/InspectorAgent.h
r180116 r189218 76 76 RefPtr<Inspector::Protocol::Array<String>> m_pendingExtraDomainsData; 77 77 #endif 78 bool m_enabled ;78 bool m_enabled { false }; 79 79 }; 80 80 -
trunk/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp
r186279 r189218 43 43 static const int expireConsoleMessagesStep = 100; 44 44 45 InspectorConsoleAgent::InspectorConsoleAgent(InjectedScriptManager *injectedScriptManager)45 InspectorConsoleAgent::InspectorConsoleAgent(InjectedScriptManager& injectedScriptManager) 46 46 : InspectorAgentBase(ASCIILiteral("Console")) 47 47 , m_injectedScriptManager(injectedScriptManager) 48 , m_previousMessage(nullptr)49 , m_expiredConsoleMessageCount(0)50 , m_enabled(false)51 48 { 52 49 } … … 80 77 if (m_expiredConsoleMessageCount) { 81 78 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); 83 80 } 84 81 85 82 size_t messageCount = m_consoleMessages.size(); 86 83 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); 88 85 } 89 86 … … 102 99 m_previousMessage = nullptr; 103 100 104 m_injectedScriptManager ->releaseObjectGroup(ASCIILiteral("console"));101 m_injectedScriptManager.releaseObjectGroup(ASCIILiteral("console")); 105 102 106 103 if (m_frontendDispatcher && m_enabled) … … 119 116 void InspectorConsoleAgent::addMessageToConsole(std::unique_ptr<ConsoleMessage> message) 120 117 { 121 if (!m_injectedScriptManager ->inspectorEnvironment().developerExtrasEnabled())118 if (!m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled()) 122 119 return; 123 120 … … 201 198 void InspectorConsoleAgent::addConsoleMessage(std::unique_ptr<ConsoleMessage> consoleMessage) 202 199 { 203 ASSERT(m_injectedScriptManager ->inspectorEnvironment().developerExtrasEnabled());200 ASSERT(m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled()); 204 201 ASSERT_ARG(consoleMessage, consoleMessage); 205 202 … … 207 204 m_previousMessage->incrementCount(); 208 205 if (m_frontendDispatcher && m_enabled) 209 m_previousMessage->updateRepeatCountInConsole( m_frontendDispatcher.get());206 m_previousMessage->updateRepeatCountInConsole(*m_frontendDispatcher); 210 207 } else { 211 208 m_previousMessage = consoleMessage.get(); 212 209 m_consoleMessages.append(WTF::move(consoleMessage)); 213 210 if (m_frontendDispatcher && m_enabled) 214 m_previousMessage->addToFrontend( m_frontendDispatcher.get(), m_injectedScriptManager, true);211 m_previousMessage->addToFrontend(*m_frontendDispatcher, m_injectedScriptManager, true); 215 212 } 216 213 -
trunk/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.h
r180116 r189218 53 53 WTF_MAKE_FAST_ALLOCATED; 54 54 public: 55 InspectorConsoleAgent(InjectedScriptManager *);55 InspectorConsoleAgent(InjectedScriptManager&); 56 56 virtual ~InspectorConsoleAgent(); 57 57 … … 81 81 void addConsoleMessage(std::unique_ptr<ConsoleMessage>); 82 82 83 InjectedScriptManager *m_injectedScriptManager;83 InjectedScriptManager& m_injectedScriptManager; 84 84 std::unique_ptr<ConsoleFrontendDispatcher> m_frontendDispatcher; 85 85 RefPtr<ConsoleBackendDispatcher> m_backendDispatcher; 86 ConsoleMessage* m_previousMessage ;86 ConsoleMessage* m_previousMessage { nullptr }; 87 87 Vector<std::unique_ptr<ConsoleMessage>> m_consoleMessages; 88 int m_expiredConsoleMessageCount ;88 int m_expiredConsoleMessageCount { 0 }; 89 89 HashMap<String, unsigned> m_counts; 90 90 HashMap<String, double> m_times; 91 bool m_enabled ;91 bool m_enabled { false }; 92 92 }; 93 93 -
trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp
r186279 r189218 56 56 } 57 57 58 InspectorDebuggerAgent::InspectorDebuggerAgent(InjectedScriptManager *injectedScriptManager)58 InspectorDebuggerAgent::InspectorDebuggerAgent(InjectedScriptManager& injectedScriptManager) 59 59 : InspectorAgentBase(ASCIILiteral("Debugger")) 60 60 , m_injectedScriptManager(injectedScriptManager) … … 383 383 const BreakpointActions& breakpointActions = scriptDebugServer().getActionsForBreakpoint(breakpointID); 384 384 for (auto& action : breakpointActions) 385 m_injectedScriptManager ->releaseObjectGroup(objectGroupForBreakpointAction(action));385 m_injectedScriptManager.releaseObjectGroup(objectGroupForBreakpointAction(action)); 386 386 387 387 scriptDebugServer().removeBreakpoint(breakpointID); … … 463 463 void InspectorDebuggerAgent::getFunctionDetails(ErrorString& errorString, const String& functionId, RefPtr<Inspector::Protocol::Debugger::FunctionDetails>& details) 464 464 { 465 InjectedScript injectedScript = m_injectedScriptManager ->injectedScriptForObjectId(functionId);465 InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(functionId); 466 466 if (injectedScript.hasNoValue()) { 467 467 errorString = ASCIILiteral("Function object id is obsolete"); … … 554 554 void 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) 555 555 { 556 InjectedScript injectedScript = m_injectedScriptManager ->injectedScriptForObjectId(callFrameId);556 InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(callFrameId); 557 557 if (injectedScript.hasNoValue()) { 558 558 errorString = ASCIILiteral("Inspected frame has gone"); … … 662 662 m_currentCallStack = callFrames; 663 663 664 InjectedScript injectedScript = m_injectedScriptManager ->injectedScriptFor(scriptState);664 InjectedScript injectedScript = m_injectedScriptManager.injectedScriptFor(scriptState); 665 665 666 666 // If a high level pause pause reason is not already set, try to infer a reason from the debugger. … … 713 713 m_listener->didPause(); 714 714 715 RefPtr<Stopwatch> stopwatch = m_injectedScriptManager ->inspectorEnvironment().executionStopwatch();715 RefPtr<Stopwatch> stopwatch = m_injectedScriptManager.inspectorEnvironment().executionStopwatch(); 716 716 if (stopwatch && stopwatch->isActive()) { 717 717 stopwatch->stop(); … … 727 727 void InspectorDebuggerAgent::breakpointActionProbe(JSC::ExecState* scriptState, const ScriptBreakpointAction& action, unsigned batchId, unsigned sampleId, const Deprecated::ScriptValue& sample) 728 728 { 729 InjectedScript injectedScript = m_injectedScriptManager ->injectedScriptFor(scriptState);729 InjectedScript injectedScript = m_injectedScriptManager.injectedScriptFor(scriptState); 730 730 RefPtr<Protocol::Runtime::RemoteObject> payload = injectedScript.wrapObject(sample, objectGroupForBreakpointAction(action), true); 731 731 auto result = Protocol::Debugger::ProbeSample::create() … … 733 733 .setBatchId(batchId) 734 734 .setSampleId(sampleId) 735 .setTimestamp(m_injectedScriptManager ->inspectorEnvironment().executionStopwatch()->elapsedTime())735 .setTimestamp(m_injectedScriptManager.inspectorEnvironment().executionStopwatch()->elapsedTime()) 736 736 .setPayload(payload.release()) 737 737 .release(); … … 744 744 if (m_didPauseStopwatch) { 745 745 m_didPauseStopwatch = false; 746 m_injectedScriptManager ->inspectorEnvironment().executionStopwatch()->start();746 m_injectedScriptManager.inspectorEnvironment().executionStopwatch()->start(); 747 747 } 748 748 749 749 m_pausedScriptState = nullptr; 750 750 m_currentCallStack = Deprecated::ScriptValue(); 751 m_injectedScriptManager ->releaseObjectGroup(InspectorDebuggerAgent::backtraceObjectGroup);751 m_injectedScriptManager.releaseObjectGroup(InspectorDebuggerAgent::backtraceObjectGroup); 752 752 clearBreakDetails(); 753 753 clearExceptionValue(); … … 822 822 { 823 823 if (m_hasExceptionValue) { 824 m_injectedScriptManager ->clearExceptionValue();824 m_injectedScriptManager.clearExceptionValue(); 825 825 m_hasExceptionValue = false; 826 826 } -
trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h
r185722 r189218 110 110 111 111 protected: 112 InspectorDebuggerAgent(InjectedScriptManager *);112 InspectorDebuggerAgent(InjectedScriptManager&); 113 113 114 InjectedScriptManager *injectedScriptManager() const { return m_injectedScriptManager; }114 InjectedScriptManager& injectedScriptManager() const { return m_injectedScriptManager; } 115 115 virtual InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId) = 0; 116 116 … … 155 155 typedef HashMap<JSC::BreakpointID, String> DebugServerBreakpointIDToBreakpointIdentifier; 156 156 157 InjectedScriptManager *m_injectedScriptManager;157 InjectedScriptManager& m_injectedScriptManager; 158 158 std::unique_ptr<DebuggerFrontendDispatcher> m_frontendDispatcher; 159 159 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 }; 162 162 Deprecated::ScriptValue m_currentCallStack; 163 163 ScriptsMap m_scripts; … … 168 168 DebuggerFrontendDispatcher::Reason m_breakReason; 169 169 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 }; 174 174 RefPtr<WTF::Stopwatch> m_stopwatch; 175 175 }; -
trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp
r188846 r189218 1 1 /* 2 * Copyright (C) 2013 , 2014Apple Inc. All rights reserved.2 * Copyright (C) 2013-2015 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2011 Google Inc. All rights reserved. 4 4 * … … 57 57 } 58 58 59 InspectorRuntimeAgent::InspectorRuntimeAgent(InjectedScriptManager *injectedScriptManager)59 InspectorRuntimeAgent::InspectorRuntimeAgent(InjectedScriptManager& injectedScriptManager) 60 60 : InspectorAgentBase(ASCIILiteral("Runtime")) 61 61 , m_injectedScriptManager(injectedScriptManager) 62 , m_scriptDebugServer(nullptr)63 , m_enabled(false)64 , m_isTypeProfilingEnabled(false)65 62 { 66 63 } … … 138 135 void 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) 139 136 { 140 InjectedScript injectedScript = m_injectedScriptManager ->injectedScriptForObjectId(objectId);137 InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId); 141 138 if (injectedScript.hasNoValue()) { 142 139 errorString = ASCIILiteral("Inspected frame has gone"); … … 164 161 void 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) 165 162 { 166 InjectedScript injectedScript = m_injectedScriptManager ->injectedScriptForObjectId(objectId);163 InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId); 167 164 if (injectedScript.hasNoValue()) { 168 165 errorString = ASCIILiteral("Inspected frame has gone"); … … 182 179 void 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) 183 180 { 184 InjectedScript injectedScript = m_injectedScriptManager ->injectedScriptForObjectId(objectId);181 InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId); 185 182 if (injectedScript.hasNoValue()) { 186 183 errorString = ASCIILiteral("Inspected frame has gone"); … … 200 197 void 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) 201 198 { 202 InjectedScript injectedScript = m_injectedScriptManager ->injectedScriptForObjectId(objectId);199 InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId); 203 200 if (injectedScript.hasNoValue()) { 204 201 errorString = ASCIILiteral("Inspected frame has gone"); … … 218 215 String objectId; 219 216 if (callArgument.getString(ASCIILiteral("objectId"), objectId)) { 220 injectedScript = m_injectedScriptManager ->injectedScriptForObjectId(objectId);217 injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId); 221 218 if (injectedScript.hasNoValue()) { 222 219 errorString = ASCIILiteral("Inspected frame has gone"); … … 234 231 void InspectorRuntimeAgent::releaseObject(ErrorString&, const String& objectId) 235 232 { 236 InjectedScript injectedScript = m_injectedScriptManager ->injectedScriptForObjectId(objectId);233 InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId); 237 234 if (!injectedScript.hasNoValue()) 238 235 injectedScript.releaseObject(objectId); … … 241 238 void InspectorRuntimeAgent::releaseObjectGroup(ErrorString&, const String& objectGroup) 242 239 { 243 m_injectedScriptManager ->releaseObjectGroup(objectGroup);240 m_injectedScriptManager.releaseObjectGroup(objectGroup); 244 241 } 245 242 -
trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h
r185722 r189218 1 1 /* 2 * Copyright (C) 2013 Apple Inc. All rights reserved.2 * Copyright (C) 2013, 2015 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2011 Google Inc. All rights reserved. 4 4 * … … 80 80 81 81 protected: 82 InspectorRuntimeAgent(InjectedScriptManager *);82 InspectorRuntimeAgent(InjectedScriptManager&); 83 83 84 InjectedScriptManager *injectedScriptManager() { return m_injectedScriptManager; }84 InjectedScriptManager& injectedScriptManager() { return m_injectedScriptManager; } 85 85 86 86 virtual JSC::VM& globalVM() = 0; … … 93 93 void setTypeProfilerEnabledState(bool); 94 94 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 }; 99 99 }; 100 100 -
trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectConsoleAgent.cpp
r178820 r189218 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 29 29 namespace Inspector { 30 30 31 JSGlobalObjectConsoleAgent::JSGlobalObjectConsoleAgent(InjectedScriptManager *injectedScriptManager)31 JSGlobalObjectConsoleAgent::JSGlobalObjectConsoleAgent(InjectedScriptManager& injectedScriptManager) 32 32 : InspectorConsoleAgent(injectedScriptManager) 33 33 { -
trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectConsoleAgent.h
r178820 r189218 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 36 36 WTF_MAKE_FAST_ALLOCATED; 37 37 public: 38 JSGlobalObjectConsoleAgent(InjectedScriptManager *);38 JSGlobalObjectConsoleAgent(InjectedScriptManager&); 39 39 virtual ~JSGlobalObjectConsoleAgent() { } 40 40 -
trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.cpp
r178820 r189218 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 39 39 namespace Inspector { 40 40 41 JSGlobalObjectDebuggerAgent::JSGlobalObjectDebuggerAgent(InjectedScriptManager *injectedScriptManager, JSC::JSGlobalObject& globalObject, InspectorConsoleAgent* consoleAgent)41 JSGlobalObjectDebuggerAgent::JSGlobalObjectDebuggerAgent(InjectedScriptManager& injectedScriptManager, JSC::JSGlobalObject& globalObject, InspectorConsoleAgent* consoleAgent) 42 42 : InspectorDebuggerAgent(injectedScriptManager) 43 43 , m_scriptDebugServer(globalObject) … … 64 64 65 65 ExecState* exec = m_scriptDebugServer.globalObject().globalExec(); 66 return injectedScriptManager() ->injectedScriptFor(exec);66 return injectedScriptManager().injectedScriptFor(exec); 67 67 } 68 68 -
trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectDebuggerAgent.h
r178820 r189218 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 38 38 WTF_MAKE_FAST_ALLOCATED; 39 39 public: 40 JSGlobalObjectDebuggerAgent(InjectedScriptManager *, JSC::JSGlobalObject&, InspectorConsoleAgent*);40 JSGlobalObjectDebuggerAgent(InjectedScriptManager&, JSC::JSGlobalObject&, InspectorConsoleAgent*); 41 41 virtual ~JSGlobalObjectDebuggerAgent() { } 42 42 … … 56 56 private: 57 57 JSGlobalObjectScriptDebugServer m_scriptDebugServer; 58 InspectorConsoleAgent* m_consoleAgent ;58 InspectorConsoleAgent* m_consoleAgent { nullptr }; 59 59 }; 60 60 -
trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.cpp
r186279 r189218 35 35 namespace Inspector { 36 36 37 JSGlobalObjectRuntimeAgent::JSGlobalObjectRuntimeAgent(InjectedScriptManager *injectedScriptManager, JSGlobalObject& globalObject)37 JSGlobalObjectRuntimeAgent::JSGlobalObjectRuntimeAgent(InjectedScriptManager& injectedScriptManager, JSGlobalObject& globalObject) 38 38 : InspectorRuntimeAgent(injectedScriptManager) 39 39 , m_globalObject(globalObject) … … 65 65 66 66 JSC::ExecState* scriptState = m_globalObject.globalExec(); 67 InjectedScript injectedScript = injectedScriptManager() ->injectedScriptFor(scriptState);67 InjectedScript injectedScript = injectedScriptManager().injectedScriptFor(scriptState); 68 68 if (injectedScript.hasNoValue()) 69 69 errorString = ASCIILiteral("Internal error: main world execution context not found."); -
trunk/Source/JavaScriptCore/inspector/agents/JSGlobalObjectRuntimeAgent.h
r180116 r189218 37 37 class JSGlobalObjectRuntimeAgent final : public InspectorRuntimeAgent { 38 38 public: 39 JSGlobalObjectRuntimeAgent(InjectedScriptManager *, JSC::JSGlobalObject&);39 JSGlobalObjectRuntimeAgent(InjectedScriptManager&, JSC::JSGlobalObject&); 40 40 41 41 virtual void didCreateFrontendAndBackend(FrontendChannel*, BackendDispatcher*) override; -
trunk/Source/WebCore/ChangeLog
r189216 r189218 1 2015-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 1 179 2015-09-01 Jinyoung Hur <hur.ims@navercorp.com> 2 180 -
trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp
r186279 r189218 44 44 namespace WebCore { 45 45 46 InspectorApplicationCacheAgent::InspectorApplicationCacheAgent(InstrumentingAgents *instrumentingAgents, InspectorPageAgent* pageAgent)46 InspectorApplicationCacheAgent::InspectorApplicationCacheAgent(InstrumentingAgents& instrumentingAgents, InspectorPageAgent* pageAgent) 47 47 : InspectorAgentBase(ASCIILiteral("ApplicationCache"), instrumentingAgents) 48 48 , m_pageAgent(pageAgent) … … 61 61 m_backendDispatcher = nullptr; 62 62 63 m_instrumentingAgents ->setInspectorApplicationCacheAgent(nullptr);63 m_instrumentingAgents.setInspectorApplicationCacheAgent(nullptr); 64 64 } 65 65 66 66 void InspectorApplicationCacheAgent::enable(ErrorString&) 67 67 { 68 m_instrumentingAgents ->setInspectorApplicationCacheAgent(this);68 m_instrumentingAgents.setInspectorApplicationCacheAgent(this); 69 69 70 70 // We need to pass initial navigator.onOnline. -
trunk/Source/WebCore/inspector/InspectorApplicationCacheAgent.h
r184291 r189218 51 51 WTF_MAKE_NONCOPYABLE(InspectorApplicationCacheAgent); WTF_MAKE_FAST_ALLOCATED; 52 52 public: 53 InspectorApplicationCacheAgent(InstrumentingAgents *, InspectorPageAgent*);53 InspectorApplicationCacheAgent(InstrumentingAgents&, InspectorPageAgent*); 54 54 virtual ~InspectorApplicationCacheAgent() { } 55 55 … … 72 72 DocumentLoader* assertFrameWithDocumentLoader(ErrorString&, const String& frameId); 73 73 74 InspectorPageAgent* m_pageAgent;75 74 std::unique_ptr<Inspector::ApplicationCacheFrontendDispatcher> m_frontendDispatcher; 76 75 RefPtr<Inspector::ApplicationCacheBackendDispatcher> m_backendDispatcher; 76 InspectorPageAgent* m_pageAgent { nullptr }; 77 77 }; 78 78 -
trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp
r189104 r189218 1 1 /* 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. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 341 342 } 342 343 343 InspectorCSSAgent::InspectorCSSAgent(InstrumentingAgents *instrumentingAgents, InspectorDOMAgent* domAgent)344 InspectorCSSAgent::InspectorCSSAgent(InstrumentingAgents& instrumentingAgents, InspectorDOMAgent* domAgent) 344 345 : InspectorAgentBase(ASCIILiteral("CSS"), instrumentingAgents) 345 346 , m_domAgent(domAgent) 346 , m_lastStyleSheetId(1)347 347 { 348 348 m_domAgent->setDOMListener(this); … … 396 396 void InspectorCSSAgent::enable(ErrorString&) 397 397 { 398 m_instrumentingAgents ->setInspectorCSSAgent(this);398 m_instrumentingAgents.setInspectorCSSAgent(this); 399 399 400 400 for (auto* document : m_domAgent->documents()) … … 404 404 void InspectorCSSAgent::disable(ErrorString&) 405 405 { 406 m_instrumentingAgents ->setInspectorCSSAgent(nullptr);406 m_instrumentingAgents.setInspectorCSSAgent(nullptr); 407 407 } 408 408 -
trunk/Source/WebCore/inspector/InspectorCSSAgent.h
r189104 r189218 1 1 /* 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. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 82 83 }; 83 84 84 InspectorCSSAgent(InstrumentingAgents *, InspectorDOMAgent*);85 InspectorCSSAgent(InstrumentingAgents&, InspectorDOMAgent*); 85 86 virtual ~InspectorCSSAgent(); 86 87 … … 170 171 std::unique_ptr<Inspector::CSSFrontendDispatcher> m_frontendDispatcher; 171 172 RefPtr<Inspector::CSSBackendDispatcher> m_backendDispatcher; 172 InspectorDOMAgent* m_domAgent ;173 InspectorDOMAgent* m_domAgent { nullptr }; 173 174 174 175 IdToInspectorStyleSheet m_idToInspectorStyleSheet; … … 181 182 std::unique_ptr<ChangeRegionOversetTask> m_changeRegionOversetTask; 182 183 183 int m_lastStyleSheetId ;184 int m_lastStyleSheetId { 1 }; 184 185 bool m_creatingViaInspectorStyleSheet { false }; 185 186 }; -
trunk/Source/WebCore/inspector/InspectorConsoleInstrumentation.h
r178820 r189218 1 1 /* 2 2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2015 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 41 42 inline void InspectorInstrumentation::addMessageToConsole(Page& page, std::unique_ptr<Inspector::ConsoleMessage> message) 42 43 { 43 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page)) 44 addMessageToConsoleImpl(*instrumentingAgents, WTF::move(message)); 44 addMessageToConsoleImpl(instrumentingAgentsForPage(page), WTF::move(message)); 45 45 } 46 46 … … 53 53 inline void InspectorInstrumentation::consoleCount(Page& page, JSC::ExecState* state, RefPtr<Inspector::ScriptArguments>&& arguments) 54 54 { 55 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page)) 56 consoleCountImpl(*instrumentingAgents, state, WTF::move(arguments)); 55 consoleCountImpl(instrumentingAgentsForPage(page), state, WTF::move(arguments)); 57 56 } 58 57 … … 78 77 inline void InspectorInstrumentation::startProfiling(Page& page, JSC::ExecState* exec, const String &title) 79 78 { 80 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page)) 81 startProfilingImpl(*instrumentingAgents, exec, title); 79 startProfilingImpl(instrumentingAgentsForPage(page), exec, title); 82 80 } 83 81 84 82 inline RefPtr<JSC::Profile> InspectorInstrumentation::stopProfiling(Page& page, JSC::ExecState* exec, const String &title) 85 83 { 86 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page)) 87 return stopProfilingImpl(*instrumentingAgents, exec, title); 88 return nullptr; 84 return stopProfilingImpl(instrumentingAgentsForPage(page), exec, title); 89 85 } 90 86 -
trunk/Source/WebCore/inspector/InspectorController.cpp
r189034 r189218 103 103 m_agents.append(WTF::move(pageAgentPtr)); 104 104 105 auto runtimeAgentPtr = std::make_unique<PageRuntimeAgent>( m_injectedScriptManager.get(), &page, pageAgent);105 auto runtimeAgentPtr = std::make_unique<PageRuntimeAgent>(*m_injectedScriptManager, &page, pageAgent); 106 106 PageRuntimeAgent* runtimeAgent = runtimeAgentPtr.get(); 107 107 m_instrumentingAgents->setPageRuntimeAgent(runtimeAgent); 108 108 m_agents.append(WTF::move(runtimeAgentPtr)); 109 109 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()); 111 111 m_domAgent = domAgentPtr.get(); 112 112 m_agents.append(WTF::move(domAgentPtr)); … … 119 119 120 120 #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)); 122 122 #endif 123 123 … … 138 138 m_agents.append(WTF::move(resourceAgentPtr)); 139 139 140 auto consoleAgentPtr = std::make_unique<PageConsoleAgent>( m_injectedScriptManager.get(), m_domAgent);140 auto consoleAgentPtr = std::make_unique<PageConsoleAgent>(*m_injectedScriptManager, m_domAgent); 141 141 WebConsoleAgent* consoleAgent = consoleAgentPtr.get(); 142 142 m_instrumentingAgents->setWebConsoleAgent(consoleAgentPtr.get()); 143 143 m_agents.append(WTF::move(consoleAgentPtr)); 144 144 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()); 146 146 m_debuggerAgent = debuggerAgentPtr.get(); 147 147 m_agents.append(WTF::move(debuggerAgentPtr)); … … 232 232 m_agents.didCreateFrontendAndBackend(frontendChannel, m_backendDispatcher.get()); 233 233 234 InspectorInstrumentation::registerInstrumentingAgents( *m_instrumentingAgents);234 InspectorInstrumentation::registerInstrumentingAgents(m_instrumentingAgents.get()); 235 235 InspectorInstrumentation::frontendCreated(); 236 236 … … 262 262 m_overlay->freePage(); 263 263 InspectorInstrumentation::frontendDeleted(); 264 InspectorInstrumentation::unregisterInstrumentingAgents( *m_instrumentingAgents);264 InspectorInstrumentation::unregisterInstrumentingAgents(m_instrumentingAgents.get()); 265 265 } 266 266 -
trunk/Source/WebCore/inspector/InspectorController.h
r189034 r189218 1 1 /* 2 2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2015 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 138 139 friend class InspectorInstrumentation; 139 140 140 Ref Ptr<InstrumentingAgents> m_instrumentingAgents;141 Ref<InstrumentingAgents> m_instrumentingAgents; 141 142 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 152 143 RefPtr<Inspector::BackendDispatcher> m_backendDispatcher; 153 144 Inspector::FrontendChannel* m_frontendChannel { nullptr }; 145 std::unique_ptr<InspectorOverlay> m_overlay; 154 146 Ref<WTF::Stopwatch> m_executionStopwatch; 147 Inspector::AgentRegistry m_agents; 148 155 149 Page& m_page; 156 150 InspectorClient* m_inspectorClient; 157 151 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 159 161 Vector<InspectorInstrumentationCookie, 2> m_injectedScriptInstrumentationCookies; 160 162 bool m_isUnderTest { false }; -
trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp
r187496 r189218 202 202 } 203 203 204 InspectorDOMAgent::InspectorDOMAgent(InstrumentingAgents * instrumentingAgents, InspectorPageAgent* pageAgent, InjectedScriptManager*injectedScriptManager, InspectorOverlay* overlay)204 InspectorDOMAgent::InspectorDOMAgent(InstrumentingAgents& instrumentingAgents, InspectorPageAgent* pageAgent, InjectedScriptManager& injectedScriptManager, InspectorOverlay* overlay) 205 205 : InspectorAgentBase(ASCIILiteral("DOM"), instrumentingAgents) 206 , m_injectedScriptManager(injectedScriptManager) 206 207 , m_pageAgent(pageAgent) 207 , m_injectedScriptManager(injectedScriptManager)208 208 , 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)215 209 { 216 210 } … … 230 224 m_domEditor = std::make_unique<DOMEditor>(m_history.get()); 231 225 232 m_instrumentingAgents ->setInspectorDOMAgent(this);226 m_instrumentingAgents.setInspectorDOMAgent(this); 233 227 m_document = m_pageAgent->mainFrame()->document(); 234 228 … … 249 243 hideHighlight(unused); 250 244 251 m_instrumentingAgents ->setInspectorDOMAgent(0);245 m_instrumentingAgents.setInspectorDOMAgent(0); 252 246 m_documentRequested = false; 253 247 reset(); … … 1007 1001 1008 1002 JSC::ExecState* scriptState = mainWorldExecState(frame); 1009 InjectedScript injectedScript = m_injectedScriptManager ->injectedScriptFor(scriptState);1003 InjectedScript injectedScript = m_injectedScriptManager.injectedScriptFor(scriptState); 1010 1004 if (injectedScript.hasNoValue()) 1011 1005 return; … … 1483 1477 .release(); 1484 1478 if (objectGroupId && handler && state) { 1485 InjectedScript injectedScript = m_injectedScriptManager ->injectedScriptFor(state);1479 InjectedScript injectedScript = m_injectedScriptManager.injectedScriptFor(state); 1486 1480 if (!injectedScript.hasNoValue()) 1487 1481 value->setHandler(injectedScript.wrapObject(Deprecated::ScriptValue(state->vm(), handler), *objectGroupId)); … … 2073 2067 Node* InspectorDOMAgent::nodeForObjectId(const String& objectId) 2074 2068 { 2075 InjectedScript injectedScript = m_injectedScriptManager ->injectedScriptForObjectId(objectId);2069 InjectedScript injectedScript = m_injectedScriptManager.injectedScriptForObjectId(objectId); 2076 2070 if (injectedScript.hasNoValue()) 2077 2071 return nullptr; … … 2113 2107 2114 2108 JSC::ExecState* scriptState = mainWorldExecState(frame); 2115 InjectedScript injectedScript = m_injectedScriptManager ->injectedScriptFor(scriptState);2109 InjectedScript injectedScript = m_injectedScriptManager.injectedScriptFor(scriptState); 2116 2110 if (injectedScript.hasNoValue()) 2117 2111 return 0; -
trunk/Source/WebCore/inspector/InspectorDOMAgent.h
r187496 r189218 105 105 }; 106 106 107 InspectorDOMAgent(InstrumentingAgents *, InspectorPageAgent*, Inspector::InjectedScriptManager*, InspectorOverlay*);107 InspectorDOMAgent(InstrumentingAgents&, InspectorPageAgent*, Inspector::InjectedScriptManager&, InspectorOverlay*); 108 108 virtual ~InspectorDOMAgent(); 109 109 … … 248 248 void innerHighlightQuad(std::unique_ptr<FloatQuad>, const Inspector::InspectorObject* color, const Inspector::InspectorObject* outlineColor, const bool* usePageCoordinates); 249 249 250 InspectorPageAgent* m_pageAgent;251 Inspector::InjectedScriptManager* m_injectedScriptManager;252 InspectorOverlay* m_overlay;253 250 std::unique_ptr<Inspector::DOMFrontendDispatcher> m_frontendDispatcher; 254 251 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 }; 256 257 NodeToIdMap m_documentNodeToIdMap; 257 258 typedef HashMap<RefPtr<Node>, BackendNodeId> NodeToBackendIdMap; … … 263 264 HashSet<int> m_childrenRequested; 264 265 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 }; 267 268 RefPtr<Document> m_document; 268 269 typedef HashMap<String, Vector<RefPtr<Node>>> SearchResults; … … 270 271 std::unique_ptr<RevalidateStyleAttributeTask> m_revalidateStyleAttrTask; 271 272 RefPtr<Node> m_nodeToFocus; 272 bool m_searchingForNode ;273 bool m_searchingForNode { false }; 273 274 std::unique_ptr<HighlightConfig> m_inspectModeHighlightConfig; 274 275 std::unique_ptr<InspectorHistory> m_history; 275 276 std::unique_ptr<DOMEditor> m_domEditor; 276 bool m_suppressAttributeModifiedEvent ;277 bool m_documentRequested ;277 bool m_suppressAttributeModifiedEvent { false }; 278 bool m_documentRequested { false }; 278 279 }; 279 280 -
trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp
r186279 r189218 60 60 namespace WebCore { 61 61 62 InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent(InstrumentingAgents *instrumentingAgents, InspectorDOMAgent* domAgent, InspectorDebuggerAgent* debuggerAgent)62 InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent(InstrumentingAgents& instrumentingAgents, InspectorDOMAgent* domAgent, InspectorDebuggerAgent* debuggerAgent) 63 63 : InspectorAgentBase(ASCIILiteral("DOMDebugger"), instrumentingAgents) 64 64 , m_domAgent(domAgent) 65 65 , m_debuggerAgent(debuggerAgent) 66 , m_pauseInNextEventListener(false)67 , m_pauseOnAllXHRsEnabled(false)68 66 { 69 67 m_debuggerAgent->setListener(this); … … 73 71 { 74 72 ASSERT(!m_debuggerAgent); 75 ASSERT(!m_instrumentingAgents ->inspectorDOMDebuggerAgent());73 ASSERT(!m_instrumentingAgents.inspectorDOMDebuggerAgent()); 76 74 } 77 75 … … 79 77 void InspectorDOMDebuggerAgent::debuggerWasEnabled() 80 78 { 81 m_instrumentingAgents ->setInspectorDOMDebuggerAgent(this);79 m_instrumentingAgents.setInspectorDOMDebuggerAgent(this); 82 80 } 83 81 … … 99 97 void InspectorDOMDebuggerAgent::disable() 100 98 { 101 m_instrumentingAgents ->setInspectorDOMDebuggerAgent(nullptr);99 m_instrumentingAgents.setInspectorDOMDebuggerAgent(nullptr); 102 100 clear(); 103 101 } -
trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.h
r180116 r189218 56 56 WTF_MAKE_FAST_ALLOCATED; 57 57 public: 58 InspectorDOMDebuggerAgent(InstrumentingAgents *, InspectorDOMAgent*, Inspector::InspectorDebuggerAgent*);58 InspectorDOMDebuggerAgent(InstrumentingAgents&, InspectorDOMAgent*, Inspector::InspectorDebuggerAgent*); 59 59 virtual ~InspectorDOMDebuggerAgent(); 60 60 … … 100 100 void clear(); 101 101 102 InspectorDOMAgent* m_domAgent;103 Inspector::InspectorDebuggerAgent* m_debuggerAgent;104 102 RefPtr<Inspector::DOMDebuggerBackendDispatcher> m_backendDispatcher; 103 InspectorDOMAgent* m_domAgent { nullptr }; 104 Inspector::InspectorDebuggerAgent* m_debuggerAgent { nullptr }; 105 105 106 HashMap<Node*, uint32_t> m_domBreakpoints; 106 107 HashSet<String> m_eventListenerBreakpoints; 107 108 HashSet<String> m_xhrBreakpoints; 108 bool m_pauseInNextEventListener ;109 bool m_pauseOnAllXHRsEnabled ;109 bool m_pauseInNextEventListener { false }; 110 bool m_pauseOnAllXHRsEnabled { false }; 110 111 }; 111 112 -
trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp
r186279 r189218 54 54 namespace WebCore { 55 55 56 InspectorDOMStorageAgent::InspectorDOMStorageAgent(InstrumentingAgents *instrumentingAgents, InspectorPageAgent* pageAgent)56 InspectorDOMStorageAgent::InspectorDOMStorageAgent(InstrumentingAgents& instrumentingAgents, InspectorPageAgent* pageAgent) 57 57 : InspectorAgentBase(ASCIILiteral("DOMStorage"), instrumentingAgents) 58 58 , m_pageAgent(pageAgent) 59 , m_enabled(false) 60 { 61 m_instrumentingAgents->setInspectorDOMStorageAgent(this); 59 { 60 m_instrumentingAgents.setInspectorDOMStorageAgent(this); 62 61 } 63 62 64 63 InspectorDOMStorageAgent::~InspectorDOMStorageAgent() 65 64 { 66 m_instrumentingAgents->setInspectorDOMStorageAgent(nullptr); 67 m_instrumentingAgents = nullptr; 65 m_instrumentingAgents.setInspectorDOMStorageAgent(nullptr); 68 66 } 69 67 -
trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.h
r185722 r189218 55 55 WTF_MAKE_FAST_ALLOCATED; 56 56 public: 57 InspectorDOMStorageAgent(InstrumentingAgents *, InspectorPageAgent*);57 InspectorDOMStorageAgent(InstrumentingAgents&, InspectorPageAgent*); 58 58 virtual ~InspectorDOMStorageAgent(); 59 59 … … 78 78 RefPtr<StorageArea> findStorageArea(ErrorString&, const Inspector::InspectorObject&, Frame*&); 79 79 80 InspectorPageAgent* m_pageAgent;81 80 std::unique_ptr<Inspector::DOMStorageFrontendDispatcher> m_frontendDispatcher; 82 81 RefPtr<Inspector::DOMStorageBackendDispatcher> m_backendDispatcher; 83 bool m_enabled; 82 InspectorPageAgent* m_pageAgent { nullptr }; 83 84 bool m_enabled { false }; 84 85 }; 85 86 -
trunk/Source/WebCore/inspector/InspectorDatabaseAgent.cpp
r186279 r189218 211 211 } 212 212 213 InspectorDatabaseAgent::InspectorDatabaseAgent(InstrumentingAgents *instrumentingAgents)213 InspectorDatabaseAgent::InspectorDatabaseAgent(InstrumentingAgents& instrumentingAgents) 214 214 : InspectorAgentBase(ASCIILiteral("Database"), instrumentingAgents) 215 , m_enabled(false) 216 { 217 m_instrumentingAgents->setInspectorDatabaseAgent(this); 215 { 216 m_instrumentingAgents.setInspectorDatabaseAgent(this); 218 217 } 219 218 220 219 InspectorDatabaseAgent::~InspectorDatabaseAgent() 221 220 { 222 m_instrumentingAgents ->setInspectorDatabaseAgent(nullptr);221 m_instrumentingAgents.setInspectorDatabaseAgent(nullptr); 223 222 } 224 223 -
trunk/Source/WebCore/inspector/InspectorDatabaseAgent.h
r180116 r189218 51 51 WTF_MAKE_FAST_ALLOCATED; 52 52 public: 53 explicit InspectorDatabaseAgent(InstrumentingAgents *);53 explicit InspectorDatabaseAgent(InstrumentingAgents&); 54 54 virtual ~InspectorDatabaseAgent(); 55 55 … … 75 75 std::unique_ptr<Inspector::DatabaseFrontendDispatcher> m_frontendDispatcher; 76 76 RefPtr<Inspector::DatabaseBackendDispatcher> m_backendDispatcher; 77 77 78 typedef HashMap<String, RefPtr<InspectorDatabaseResource>> DatabaseResourcesMap; 78 79 DatabaseResourcesMap m_resources; 79 bool m_enabled ;80 bool m_enabled { false }; 80 81 }; 81 82 -
trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
r186279 r189218 565 565 } // namespace 566 566 567 InspectorIndexedDBAgent::InspectorIndexedDBAgent(InstrumentingAgents * instrumentingAgents, InjectedScriptManager*injectedScriptManager, InspectorPageAgent* pageAgent)567 InspectorIndexedDBAgent::InspectorIndexedDBAgent(InstrumentingAgents& instrumentingAgents, InjectedScriptManager& injectedScriptManager, InspectorPageAgent* pageAgent) 568 568 : InspectorAgentBase(ASCIILiteral("IndexedDB"), instrumentingAgents) 569 569 , m_injectedScriptManager(injectedScriptManager) … … 667 667 return; 668 668 669 InjectedScript injectedScript = m_injectedScriptManager ->injectedScriptFor(mainWorldExecState(frame));669 InjectedScript injectedScript = m_injectedScriptManager.injectedScriptFor(mainWorldExecState(frame)); 670 670 671 671 RefPtr<IDBKeyRange> idbKeyRange = keyRange ? idbKeyRangeFromKeyRange(keyRange) : nullptr; -
trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.h
r185722 r189218 51 51 WTF_MAKE_FAST_ALLOCATED; 52 52 public: 53 InspectorIndexedDBAgent(InstrumentingAgents *, Inspector::InjectedScriptManager*, InspectorPageAgent*);53 InspectorIndexedDBAgent(InstrumentingAgents&, Inspector::InjectedScriptManager&, InspectorPageAgent*); 54 54 virtual ~InspectorIndexedDBAgent(); 55 55 … … 66 66 67 67 private: 68 Inspector::InjectedScriptManager* m_injectedScriptManager;69 InspectorPageAgent* m_pageAgent;70 68 RefPtr<Inspector::IndexedDBBackendDispatcher> m_backendDispatcher; 69 Inspector::InjectedScriptManager& m_injectedScriptManager; 70 InspectorPageAgent* m_pageAgent { nullptr }; 71 71 }; 72 72 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r189002 r189218 1 1 /* 2 2 * 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. 4 4 * 5 5 * Redistribution and use in source and binary forms, with or without … … 1262 1262 InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForPage(Page* page) 1263 1263 { 1264 return page ? instrumentingAgentsForPage(*page) : nullptr;1265 } 1266 1267 InstrumentingAgents *InspectorInstrumentation::instrumentingAgentsForPage(Page& page)1264 return page ? &instrumentingAgentsForPage(*page) : nullptr; 1265 } 1266 1267 InstrumentingAgents& InspectorInstrumentation::instrumentingAgentsForPage(Page& page) 1268 1268 { 1269 1269 ASSERT(isMainThread()); … … 1278 1278 InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope(WorkerGlobalScope* workerGlobalScope) 1279 1279 { 1280 return workerGlobalScope ? workerGlobalScope->workerInspectorController().m_instrumentingAgents.get() : nullptr;1280 return workerGlobalScope ? &workerGlobalScope->workerInspectorController().m_instrumentingAgents.get() : nullptr; 1281 1281 } 1282 1282 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r189002 r189218 1 1 /* 2 2 * 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. 4 4 * 5 5 * Redistribution and use in source and binary forms, with or without … … 458 458 static void renderLayerDestroyedImpl(InstrumentingAgents&, const RenderLayer&); 459 459 460 static InstrumentingAgents *instrumentingAgentsForPage(Page&);460 static InstrumentingAgents& instrumentingAgentsForPage(Page&); 461 461 static InstrumentingAgents* instrumentingAgentsForFrame(Frame&); 462 462 static InstrumentingAgents* instrumentingAgentsForFrame(Frame*); … … 640 640 { 641 641 FAST_RETURN_IF_NO_FRONTENDS(void()); 642 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page)) 643 mouseDidMoveOverElementImpl(*instrumentingAgents, result, modifierFlags); 642 mouseDidMoveOverElementImpl(instrumentingAgentsForPage(page), result, modifierFlags); 644 643 } 645 644 … … 790 789 { 791 790 FAST_RETURN_IF_NO_FRONTENDS(void()); 792 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page)) 793 return scriptsEnabledImpl(*instrumentingAgents, isEnabled); 791 return scriptsEnabledImpl(instrumentingAgentsForPage(page), isEnabled); 794 792 } 795 793 … … 834 832 { 835 833 FAST_RETURN_IF_NO_FRONTENDS(void()); 836 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page)) 837 didScrollImpl(*instrumentingAgents); 834 didScrollImpl(instrumentingAgentsForPage(page)); 838 835 } 839 836 … … 938 935 inline void InspectorInstrumentation::markResourceAsCached(Page& page, unsigned long identifier) 939 936 { 940 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page)) 941 markResourceAsCachedImpl(*instrumentingAgents, identifier); 937 markResourceAsCachedImpl(instrumentingAgentsForPage(page), identifier); 942 938 } 943 939 944 940 inline void InspectorInstrumentation::didLoadResourceFromMemoryCache(Page& page, DocumentLoader* loader, CachedResource* resource) 945 941 { 946 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page)) 947 didLoadResourceFromMemoryCacheImpl(*instrumentingAgents, loader, resource); 942 didLoadResourceFromMemoryCacheImpl(instrumentingAgentsForPage(page), loader, resource); 948 943 } 949 944 … … 1104 1099 { 1105 1100 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); 1109 1102 } 1110 1103 … … 1212 1205 { 1213 1206 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)); 1216 1208 } 1217 1209 … … 1219 1211 { 1220 1212 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)); 1223 1214 } 1224 1215 … … 1226 1217 { 1227 1218 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)); 1230 1220 } 1231 1221 … … 1233 1223 { 1234 1224 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)); 1237 1226 } 1238 1227 … … 1240 1229 { 1241 1230 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)); 1244 1232 } 1245 1233 … … 1247 1235 { 1248 1236 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)); 1251 1238 } 1252 1239 … … 1254 1241 { 1255 1242 FAST_RETURN_IF_NO_FRONTENDS(void()); 1256 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page)) 1257 segmentUnloadedImpl(*instrumentingAgents); 1243 segmentUnloadedImpl(instrumentingAgentsForPage(page)); 1258 1244 } 1259 1245 … … 1261 1247 { 1262 1248 FAST_RETURN_IF_NO_FRONTENDS(void()); 1263 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page)) 1264 captureStartedImpl(*instrumentingAgents); 1249 captureStartedImpl(instrumentingAgentsForPage(page)); 1265 1250 } 1266 1251 … … 1268 1253 { 1269 1254 FAST_RETURN_IF_NO_FRONTENDS(void()); 1270 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page)) 1271 captureStoppedImpl(*instrumentingAgents); 1255 captureStoppedImpl(instrumentingAgentsForPage(page)); 1272 1256 } 1273 1257 … … 1275 1259 { 1276 1260 FAST_RETURN_IF_NO_FRONTENDS(void()); 1277 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page)) 1278 playbackStartedImpl(*instrumentingAgents); 1261 playbackStartedImpl(instrumentingAgentsForPage(page)); 1279 1262 } 1280 1263 … … 1282 1265 { 1283 1266 FAST_RETURN_IF_NO_FRONTENDS(void()); 1284 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page)) 1285 playbackPausedImpl(*instrumentingAgents, position); 1267 playbackPausedImpl(instrumentingAgentsForPage(page), position); 1286 1268 } 1287 1269 … … 1289 1271 { 1290 1272 FAST_RETURN_IF_NO_FRONTENDS(void()); 1291 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page)) 1292 playbackFinishedImpl(*instrumentingAgents); 1273 playbackFinishedImpl(instrumentingAgentsForPage(page)); 1293 1274 } 1294 1275 … … 1296 1277 { 1297 1278 FAST_RETURN_IF_NO_FRONTENDS(void()); 1298 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page)) 1299 playbackHitPositionImpl(*instrumentingAgents, position); 1279 playbackHitPositionImpl(instrumentingAgentsForPage(page), position); 1300 1280 } 1301 1281 #endif // ENABLE(WEB_REPLAY) -
trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp
r188530 r189218 47 47 namespace WebCore { 48 48 49 InspectorLayerTreeAgent::InspectorLayerTreeAgent(InstrumentingAgents *instrumentingAgents)49 InspectorLayerTreeAgent::InspectorLayerTreeAgent(InstrumentingAgents& instrumentingAgents) 50 50 : InspectorAgentBase(ASCIILiteral("LayerTree"), instrumentingAgents) 51 51 { … … 82 82 void InspectorLayerTreeAgent::enable(ErrorString&) 83 83 { 84 m_instrumentingAgents ->setInspectorLayerTreeAgent(this);84 m_instrumentingAgents.setInspectorLayerTreeAgent(this); 85 85 } 86 86 87 87 void InspectorLayerTreeAgent::disable(ErrorString&) 88 88 { 89 m_instrumentingAgents ->setInspectorLayerTreeAgent(nullptr);89 m_instrumentingAgents.setInspectorLayerTreeAgent(nullptr); 90 90 } 91 91 … … 109 109 layers = Inspector::Protocol::Array<Inspector::Protocol::LayerTree::Layer>::create(); 110 110 111 Node* node = m_instrumentingAgents ->inspectorDOMAgent()->nodeForId(nodeId);111 Node* node = m_instrumentingAgents.inspectorDOMAgent()->nodeForId(nodeId); 112 112 if (!node) { 113 113 errorString = ASCIILiteral("Provided node id doesn't match any known node"); … … 208 208 return 0; 209 209 210 InspectorDOMAgent* domAgent = m_instrumentingAgents ->inspectorDOMAgent();210 InspectorDOMAgent* domAgent = m_instrumentingAgents.inspectorDOMAgent(); 211 211 212 212 int nodeId = domAgent->boundNodeId(node); -
trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.h
r180116 r189218 48 48 WTF_MAKE_FAST_ALLOCATED; 49 49 public: 50 explicit InspectorLayerTreeAgent(InstrumentingAgents *);50 explicit InspectorLayerTreeAgent(InstrumentingAgents&); 51 51 virtual ~InspectorLayerTreeAgent(); 52 52 -
trunk/Source/WebCore/inspector/InspectorPageAgent.cpp
r186372 r189218 326 326 } 327 327 328 InspectorPageAgent::InspectorPageAgent(InstrumentingAgents *instrumentingAgents, Page* page, InspectorClient* client, InspectorOverlay* overlay)328 InspectorPageAgent::InspectorPageAgent(InstrumentingAgents& instrumentingAgents, Page* page, InspectorClient* client, InspectorOverlay* overlay) 329 329 : InspectorAgentBase(ASCIILiteral("Page"), instrumentingAgents) 330 330 , m_page(page) 331 331 , m_client(client) 332 332 , 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)339 333 { 340 334 } … … 360 354 double InspectorPageAgent::timestamp() 361 355 { 362 return m_instrumentingAgents ->inspectorEnvironment().executionStopwatch()->elapsedTime();356 return m_instrumentingAgents.inspectorEnvironment().executionStopwatch()->elapsedTime(); 363 357 } 364 358 … … 366 360 { 367 361 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(); 371 365 stopwatch->reset(); 372 366 stopwatch->start(); … … 380 374 m_enabled = false; 381 375 m_scriptsToEvaluateOnLoad = nullptr; 382 m_instrumentingAgents ->setInspectorPageAgent(nullptr);376 m_instrumentingAgents.setInspectorPageAgent(nullptr); 383 377 384 378 ErrorString unused; … … 825 819 { 826 820 if (frame.isMainFrame()) { 827 auto stopwatch = m_instrumentingAgents ->inspectorEnvironment().executionStopwatch();821 auto stopwatch = m_instrumentingAgents.inspectorEnvironment().executionStopwatch(); 828 822 stopwatch->reset(); 829 823 stopwatch->start(); … … 1023 1017 ASSERT(frame); 1024 1018 1025 InspectorDOMAgent* domAgent = m_instrumentingAgents ->inspectorDOMAgent();1019 InspectorDOMAgent* domAgent = m_instrumentingAgents.inspectorDOMAgent(); 1026 1020 ASSERT(domAgent); 1027 1021 Node* node = domAgent->assertNode(errorString, nodeId); -
trunk/Source/WebCore/inspector/InspectorPageAgent.h
r180116 r189218 69 69 WTF_MAKE_FAST_ALLOCATED; 70 70 public: 71 InspectorPageAgent(InstrumentingAgents *, Page*, InspectorClient*, InspectorOverlay*);71 InspectorPageAgent(InstrumentingAgents&, Page*, InspectorClient*, InspectorOverlay*); 72 72 73 73 enum ResourceType { … … 167 167 Ref<Inspector::Protocol::Page::Frame> buildObjectForFrame(Frame*); 168 168 Ref<Inspector::Protocol::Page::FrameResourceTree> buildObjectForFrameTree(Frame*); 169 Page* m_page; 170 InspectorClient* m_client; 169 171 170 std::unique_ptr<Inspector::PageFrontendDispatcher> m_frontendDispatcher; 172 171 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 }; 175 178 String m_pendingScriptToEvaluateOnLoadOnce; 176 179 String m_scriptToEvaluateOnLoadOnce; … … 178 181 HashMap<String, Frame*> m_identifierToFrame; 179 182 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 }; 185 188 String m_emulatedMedia; 186 189 RefPtr<Inspector::InspectorObject> m_scriptsToEvaluateOnLoad; -
trunk/Source/WebCore/inspector/InspectorReplayAgent.cpp
r186279 r189218 157 157 } 158 158 159 InspectorReplayAgent::InspectorReplayAgent(InstrumentingAgents *instrumentingAgents, InspectorPageAgent* pageAgent)159 InspectorReplayAgent::InspectorReplayAgent(InstrumentingAgents& instrumentingAgents, InspectorPageAgent* pageAgent) 160 160 : InspectorAgentBase(ASCIILiteral("Replay"), instrumentingAgents) 161 161 , m_page(*pageAgent->page()) … … 179 179 m_backendDispatcher = Inspector::ReplayBackendDispatcher::create(backendDispatcher, this); 180 180 181 m_instrumentingAgents ->setInspectorReplayAgent(this);181 m_instrumentingAgents.setInspectorReplayAgent(this); 182 182 ASSERT(sessionState() == WebCore::SessionState::Inactive); 183 183 … … 196 196 m_backendDispatcher = nullptr; 197 197 198 m_instrumentingAgents ->setInspectorReplayAgent(nullptr);198 m_instrumentingAgents.setInspectorReplayAgent(nullptr); 199 199 200 200 // Drop references to all sessions and segments. -
trunk/Source/WebCore/inspector/InspectorReplayAgent.h
r185722 r189218 63 63 WTF_MAKE_NONCOPYABLE(InspectorReplayAgent); 64 64 public: 65 InspectorReplayAgent(InstrumentingAgents *, InspectorPageAgent*);65 InspectorReplayAgent(InstrumentingAgents&, InspectorPageAgent*); 66 66 virtual ~InspectorReplayAgent(); 67 67 -
trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp
r186279 r189218 161 161 } // namespace 162 162 163 InspectorResourceAgent::InspectorResourceAgent(InstrumentingAgents *instrumentingAgents, InspectorPageAgent* pageAgent, InspectorClient* client)163 InspectorResourceAgent::InspectorResourceAgent(InstrumentingAgents& instrumentingAgents, InspectorPageAgent* pageAgent, InspectorClient* client) 164 164 : InspectorAgentBase(ASCIILiteral("Network"), instrumentingAgents) 165 165 , m_pageAgent(pageAgent) 166 166 , m_client(client) 167 167 , m_resourcesData(std::make_unique<NetworkResourcesData>()) 168 , m_enabled(false)169 , m_cacheDisabled(false)170 , m_loadingXHRSynchronously(false)171 , m_isRecalculatingStyle(false)172 168 { 173 169 } … … 269 265 disable(unused); 270 266 } 271 ASSERT(!m_instrumentingAgents ->inspectorResourceAgent());267 ASSERT(!m_instrumentingAgents.inspectorResourceAgent()); 272 268 } 273 269 274 270 double InspectorResourceAgent::timestamp() 275 271 { 276 return m_instrumentingAgents ->inspectorEnvironment().executionStopwatch()->elapsedTime();272 return m_instrumentingAgents.inspectorEnvironment().executionStopwatch()->elapsedTime(); 277 273 } 278 274 … … 608 604 return; 609 605 m_enabled = true; 610 m_instrumentingAgents ->setInspectorResourceAgent(this);606 m_instrumentingAgents.setInspectorResourceAgent(this); 611 607 } 612 608 … … 614 610 { 615 611 m_enabled = false; 616 m_instrumentingAgents ->setInspectorResourceAgent(nullptr);612 m_instrumentingAgents.setInspectorResourceAgent(nullptr); 617 613 m_resourcesData->clear(); 618 614 m_extraRequestHeaders.clear(); -
trunk/Source/WebCore/inspector/InspectorResourceAgent.h
r185722 r189218 76 76 WTF_MAKE_FAST_ALLOCATED; 77 77 public: 78 InspectorResourceAgent(InstrumentingAgents *, InspectorPageAgent*, InspectorClient*);78 InspectorResourceAgent(InstrumentingAgents&, InspectorPageAgent*, InspectorClient*); 79 79 virtual ~InspectorResourceAgent(); 80 80 … … 132 132 double timestamp(); 133 133 134 InspectorPageAgent* m_pageAgent;135 InspectorClient* m_client;136 134 std::unique_ptr<Inspector::NetworkFrontendDispatcher> m_frontendDispatcher; 137 135 RefPtr<Inspector::NetworkBackendDispatcher> m_backendDispatcher; 136 InspectorPageAgent* m_pageAgent { nullptr }; 137 138 InspectorClient* m_client { nullptr }; 139 138 140 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 }; 142 144 HashMap<String, String> m_extraRequestHeaders; 143 144 145 HashSet<unsigned long> m_hiddenRequestIdentifiers; 145 146 146 // FIXME: InspectorResourceAgent should now be aware of style recalculation. 147 147 RefPtr<Inspector::Protocol::Network::Initiator> m_styleRecalculationInitiator; 148 bool m_isRecalculatingStyle ;148 bool m_isRecalculatingStyle { false }; 149 149 }; 150 150 -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp
r188163 r189218 95 95 m_backendDispatcher = Inspector::TimelineBackendDispatcher::create(backendDispatcher, this); 96 96 97 m_instrumentingAgents ->setPersistentInspectorTimelineAgent(this);97 m_instrumentingAgents.setPersistentInspectorTimelineAgent(this); 98 98 99 99 if (m_scriptDebugServer) … … 106 106 m_backendDispatcher = nullptr; 107 107 108 m_instrumentingAgents ->setPersistentInspectorTimelineAgent(nullptr);108 m_instrumentingAgents.setPersistentInspectorTimelineAgent(nullptr); 109 109 110 110 if (reason != Inspector::DisconnectReason::InspectedTargetDestroyed) { … … 141 141 m_maxCallStackDepth = 5; 142 142 143 m_instrumentingAgents ->setInspectorTimelineAgent(this);143 m_instrumentingAgents.setInspectorTimelineAgent(this); 144 144 145 145 if (m_scriptDebugServer) … … 194 194 return; 195 195 196 m_instrumentingAgents ->setInspectorTimelineAgent(nullptr);196 m_instrumentingAgents.setInspectorTimelineAgent(nullptr); 197 197 198 198 if (m_scriptDebugServer) … … 220 220 double InspectorTimelineAgent::timestamp() 221 221 { 222 return m_instrumentingAgents ->inspectorEnvironment().executionStopwatch()->elapsedTime();222 return m_instrumentingAgents.inspectorEnvironment().executionStopwatch()->elapsedTime(); 223 223 } 224 224 … … 267 267 internalStart(); 268 268 269 startProfiling(exec, title, m_instrumentingAgents ->inspectorEnvironment().executionStopwatch());269 startProfiling(exec, title, m_instrumentingAgents.inspectorEnvironment().executionStopwatch()); 270 270 271 271 m_pendingConsoleProfileRecords.append(createRecordEntry(TimelineRecordFactory::createConsoleProfileData(title), TimelineRecordType::ConsoleProfile, true, frameFromExecState(exec))); … … 306 306 307 307 if (frame && !m_callStackDepth) 308 startProfiling(frame, ASCIILiteral("Timeline FunctionCall"), m_instrumentingAgents ->inspectorEnvironment().executionStopwatch());308 startProfiling(frame, ASCIILiteral("Timeline FunctionCall"), m_instrumentingAgents.inspectorEnvironment().executionStopwatch()); 309 309 310 310 ++m_callStackDepth; … … 495 495 if (!m_callStackDepth) { 496 496 ++m_callStackDepth; 497 startProfiling(&frame, ASCIILiteral("Timeline EvaluateScript"), m_instrumentingAgents ->inspectorEnvironment().executionStopwatch());497 startProfiling(&frame, ASCIILiteral("Timeline EvaluateScript"), m_instrumentingAgents.inspectorEnvironment().executionStopwatch()); 498 498 } 499 499 } … … 730 730 } 731 731 732 InspectorTimelineAgent::InspectorTimelineAgent(InstrumentingAgents *instrumentingAgents, InspectorPageAgent* pageAgent, InspectorType type, InspectorClient* client)732 InspectorTimelineAgent::InspectorTimelineAgent(InstrumentingAgents& instrumentingAgents, InspectorPageAgent* pageAgent, InspectorType type, InspectorClient* client) 733 733 : InspectorAgentBase(ASCIILiteral("Timeline"), instrumentingAgents) 734 734 , m_pageAgent(pageAgent) 735 , m_client(client) 735 736 , m_inspectorType(type) 736 , m_client(client)737 737 { 738 738 } -
trunk/Source/WebCore/inspector/InspectorTimelineAgent.h
r186133 r189218 118 118 enum InspectorType { PageInspector, WorkerInspector }; 119 119 120 InspectorTimelineAgent(InstrumentingAgents *, InspectorPageAgent*, InspectorType, InspectorClient*);120 InspectorTimelineAgent(InstrumentingAgents&, InspectorPageAgent*, InspectorType, InspectorClient*); 121 121 virtual ~InspectorTimelineAgent(); 122 122 … … 232 232 Page* page(); 233 233 234 InspectorPageAgent* m_pageAgent;235 PageScriptDebugServer* m_scriptDebugServer { nullptr };236 237 234 std::unique_ptr<Inspector::TimelineFrontendDispatcher> m_frontendDispatcher; 238 235 RefPtr<Inspector::TimelineBackendDispatcher> m_backendDispatcher; 236 InspectorPageAgent* m_pageAgent; 237 238 PageScriptDebugServer* m_scriptDebugServer { nullptr }; 239 InspectorClient* m_client { nullptr }; 239 240 240 241 Vector<TimelineRecordEntry> m_recordStack; 241 242 242 int m_id { 1 }; 243 243 int m_callStackDepth { 0 }; 244 244 int m_maxCallStackDepth { 5 }; 245 245 InspectorType m_inspectorType; 246 InspectorClient* m_client;247 246 248 247 Vector<TimelineRecordEntry> m_pendingConsoleProfileRecords; -
trunk/Source/WebCore/inspector/InspectorWebAgentBase.h
r160457 r189218 38 38 class InspectorAgentBase : public Inspector::InspectorAgentBase { 39 39 protected: 40 InspectorAgentBase(const String& name, InstrumentingAgents *instrumentingAgents)40 InspectorAgentBase(const String& name, InstrumentingAgents& instrumentingAgents) 41 41 : Inspector::InspectorAgentBase(name) 42 42 , m_instrumentingAgents(instrumentingAgents) … … 44 44 } 45 45 46 InstrumentingAgents *m_instrumentingAgents;46 InstrumentingAgents& m_instrumentingAgents; 47 47 }; 48 48 -
trunk/Source/WebCore/inspector/InspectorWorkerAgent.cpp
r186279 r189218 102 102 int InspectorWorkerAgent::WorkerFrontendChannel::s_nextId = 1; 103 103 104 InspectorWorkerAgent::InspectorWorkerAgent(InstrumentingAgents *instrumentingAgents)104 InspectorWorkerAgent::InspectorWorkerAgent(InstrumentingAgents& instrumentingAgents) 105 105 : InspectorAgentBase(ASCIILiteral("Worker"), instrumentingAgents) 106 , m_enabled(false) 107 , m_shouldPauseDedicatedWorkerOnStart(false) 108 { 109 m_instrumentingAgents->setInspectorWorkerAgent(this); 106 { 107 m_instrumentingAgents.setInspectorWorkerAgent(this); 110 108 } 111 109 112 110 InspectorWorkerAgent::~InspectorWorkerAgent() 113 111 { 114 m_instrumentingAgents ->setInspectorWorkerAgent(nullptr);112 m_instrumentingAgents.setInspectorWorkerAgent(nullptr); 115 113 } 116 114 -
trunk/Source/WebCore/inspector/InspectorWorkerAgent.h
r185722 r189218 52 52 WTF_MAKE_FAST_ALLOCATED; 53 53 public: 54 explicit InspectorWorkerAgent(InstrumentingAgents *);54 explicit InspectorWorkerAgent(InstrumentingAgents&); 55 55 virtual ~InspectorWorkerAgent(); 56 56 … … 77 77 void destroyWorkerFrontendChannels(); 78 78 79 class WorkerFrontendChannel; 80 79 81 std::unique_ptr<Inspector::WorkerFrontendDispatcher> m_frontendDispatcher; 80 82 RefPtr<Inspector::WorkerBackendDispatcher> m_backendDispatcher; 81 bool m_enabled;82 bool m_shouldPauseDedicatedWorkerOnStart;83 83 84 class WorkerFrontendChannel; 84 bool m_enabled { false }; 85 bool m_shouldPauseDedicatedWorkerOnStart { false }; 86 85 87 typedef HashMap<int, WorkerFrontendChannel*> WorkerChannels; 86 88 WorkerChannels m_idToChannel; -
trunk/Source/WebCore/inspector/InstrumentingAgents.cpp
r182193 r189218 1 1 /* 2 2 * 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. 4 4 * 5 5 * Redistribution and use in source and binary forms, with or without … … 45 45 InstrumentingAgents::InstrumentingAgents(InspectorEnvironment& environment) 46 46 : 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 #endif62 , m_inspectorDatabaseAgent(nullptr)63 , m_inspectorApplicationCacheAgent(nullptr)64 , m_inspectorDebuggerAgent(nullptr)65 , m_pageDebuggerAgent(nullptr)66 , m_inspectorDOMDebuggerAgent(nullptr)67 , m_inspectorWorkerAgent(nullptr)68 47 { 69 48 } -
trunk/Source/WebCore/inspector/InstrumentingAgents.h
r182193 r189218 1 1 /* 2 2 * 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. 4 4 * 5 5 * Redistribution and use in source and binary forms, with or without … … 69 69 WTF_MAKE_FAST_ALLOCATED; 70 70 public: 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) 72 74 { 73 return adoptRef( new InstrumentingAgents(environment));75 return adoptRef(*new InstrumentingAgents(environment)); 74 76 } 75 77 ~InstrumentingAgents() { } … … 142 144 Inspector::InspectorEnvironment& m_environment; 143 145 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 }; 156 158 #if ENABLE(WEB_REPLAY) 157 InspectorReplayAgent* m_inspectorReplayAgent ;159 InspectorReplayAgent* m_inspectorReplayAgent { nullptr }; 158 160 #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 }; 165 167 }; 166 168 167 } 169 } // namespace WebCore 168 170 169 171 #endif // !defined(InstrumentingAgents_h) -
trunk/Source/WebCore/inspector/PageConsoleAgent.cpp
r178820 r189218 1 1 /* 2 2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2015 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 41 42 namespace WebCore { 42 43 43 PageConsoleAgent::PageConsoleAgent(WebInjectedScriptManager *injectedScriptManager, InspectorDOMAgent* domAgent)44 PageConsoleAgent::PageConsoleAgent(WebInjectedScriptManager& injectedScriptManager, InspectorDOMAgent* domAgent) 44 45 : WebConsoleAgent(injectedScriptManager) 45 46 , m_inspectorDOMAgent(domAgent) … … 73 74 } 74 75 75 if (CommandLineAPIHost* commandLineAPIHost = static_cast<WebInjectedScriptManager *>(m_injectedScriptManager)->commandLineAPIHost())76 if (CommandLineAPIHost* commandLineAPIHost = static_cast<WebInjectedScriptManager&>(m_injectedScriptManager).commandLineAPIHost()) 76 77 commandLineAPIHost->addInspectedObject(std::make_unique<InspectableNode>(node)); 77 78 } -
trunk/Source/WebCore/inspector/PageConsoleAgent.h
r178820 r189218 1 1 /* 2 2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2015 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 42 43 WTF_MAKE_FAST_ALLOCATED; 43 44 public: 44 PageConsoleAgent(WebInjectedScriptManager *, InspectorDOMAgent*);45 PageConsoleAgent(WebInjectedScriptManager&, InspectorDOMAgent*); 45 46 virtual ~PageConsoleAgent() { } 46 47 -
trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp
r180653 r189218 1 1 /* 2 2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2015 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 50 51 namespace WebCore { 51 52 52 PageDebuggerAgent::PageDebuggerAgent(InjectedScriptManager * injectedScriptManager, InstrumentingAgents*instrumentingAgents, InspectorPageAgent* pageAgent, InspectorOverlay* overlay)53 PageDebuggerAgent::PageDebuggerAgent(InjectedScriptManager& injectedScriptManager, InstrumentingAgents& instrumentingAgents, InspectorPageAgent* pageAgent, InspectorOverlay* overlay) 53 54 : WebDebuggerAgent(injectedScriptManager, instrumentingAgents) 54 55 , m_pageAgent(pageAgent) … … 61 62 { 62 63 WebDebuggerAgent::enable(); 63 m_instrumentingAgents ->setPageDebuggerAgent(this);64 m_instrumentingAgents.setPageDebuggerAgent(this); 64 65 } 65 66 … … 67 68 { 68 69 WebDebuggerAgent::disable(isBeingDestroyed); 69 m_instrumentingAgents ->setPageDebuggerAgent(nullptr);70 m_instrumentingAgents.setPageDebuggerAgent(nullptr); 70 71 } 71 72 … … 125 126 if (!executionContextId) { 126 127 JSC::ExecState* scriptState = mainWorldExecState(m_pageAgent->mainFrame()); 127 return injectedScriptManager() ->injectedScriptFor(scriptState);128 return injectedScriptManager().injectedScriptFor(scriptState); 128 129 } 129 130 130 InjectedScript injectedScript = injectedScriptManager() ->injectedScriptForId(*executionContextId);131 InjectedScript injectedScript = injectedScriptManager().injectedScriptForId(*executionContextId); 131 132 if (injectedScript.hasNoValue()) 132 133 errorString = ASCIILiteral("Execution context with given id not found."); -
trunk/Source/WebCore/inspector/PageDebuggerAgent.h
r178820 r189218 1 1 /* 2 2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2015 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 47 48 WTF_MAKE_FAST_ALLOCATED; 48 49 public: 49 PageDebuggerAgent(Inspector::InjectedScriptManager *, InstrumentingAgents*, InspectorPageAgent*, InspectorOverlay*);50 PageDebuggerAgent(Inspector::InjectedScriptManager&, InstrumentingAgents&, InspectorPageAgent*, InspectorOverlay*); 50 51 virtual ~PageDebuggerAgent() { } 51 52 … … 71 72 virtual void setOverlayMessage(ErrorString&, const String*) override; 72 73 73 InspectorPageAgent* m_pageAgent; 74 InspectorOverlay* m_overlay; 74 InspectorPageAgent* m_pageAgent { nullptr }; 75 76 InspectorOverlay* m_overlay { nullptr }; 75 77 PageScriptDebugServer m_scriptDebugServer; 76 78 }; -
trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp
r186279 r189218 53 53 namespace WebCore { 54 54 55 PageRuntimeAgent::PageRuntimeAgent(InjectedScriptManager *injectedScriptManager, Page* page, InspectorPageAgent* pageAgent)55 PageRuntimeAgent::PageRuntimeAgent(InjectedScriptManager& injectedScriptManager, Page* page, InspectorPageAgent* pageAgent) 56 56 : InspectorRuntimeAgent(injectedScriptManager) 57 , m_pageAgent(pageAgent) 57 58 , m_inspectedPage(page) 58 , m_pageAgent(pageAgent)59 , m_mainWorldContextCreated(false)60 59 { 61 60 } … … 122 121 if (!executionContextId) { 123 122 JSC::ExecState* scriptState = mainWorldExecState(&m_inspectedPage->mainFrame()); 124 InjectedScript result = injectedScriptManager() ->injectedScriptFor(scriptState);123 InjectedScript result = injectedScriptManager().injectedScriptFor(scriptState); 125 124 if (result.hasNoValue()) 126 125 errorString = ASCIILiteral("Internal error: main world execution context not found."); … … 128 127 } 129 128 130 InjectedScript injectedScript = injectedScriptManager() ->injectedScriptForId(*executionContextId);129 InjectedScript injectedScript = injectedScriptManager().injectedScriptForId(*executionContextId); 131 130 if (injectedScript.hasNoValue()) 132 131 errorString = ASCIILiteral("Execution context with given id not found."); … … 167 166 ASSERT(securityOrigin || isPageContext); 168 167 169 InjectedScript result = injectedScriptManager() ->injectedScriptFor(scriptState);168 InjectedScript result = injectedScriptManager().injectedScriptFor(scriptState); 170 169 if (result.hasNoValue()) 171 170 return; 172 171 173 int executionContextId = injectedScriptManager() ->injectedScriptIdFor(scriptState);172 int executionContextId = injectedScriptManager().injectedScriptIdFor(scriptState); 174 173 String name = securityOrigin ? securityOrigin->toRawString() : String(); 175 174 m_frontendDispatcher->executionContextCreated(ExecutionContextDescription::create() -
trunk/Source/WebCore/inspector/PageRuntimeAgent.h
r180116 r189218 54 54 WTF_MAKE_FAST_ALLOCATED; 55 55 public: 56 PageRuntimeAgent(Inspector::InjectedScriptManager *, Page*, InspectorPageAgent*);56 PageRuntimeAgent(Inspector::InjectedScriptManager&, Page*, InspectorPageAgent*); 57 57 virtual ~PageRuntimeAgent() { } 58 58 … … 73 73 void notifyContextCreated(const String& frameId, JSC::ExecState*, SecurityOrigin*, bool isPageContext); 74 74 75 Page* m_inspectedPage;76 InspectorPageAgent* m_pageAgent;77 75 std::unique_ptr<Inspector::RuntimeFrontendDispatcher> m_frontendDispatcher; 78 76 RefPtr<Inspector::RuntimeBackendDispatcher> m_backendDispatcher; 79 bool m_mainWorldContextCreated; 77 InspectorPageAgent* m_pageAgent; 78 79 Page* m_inspectedPage; 80 81 bool m_mainWorldContextCreated { false }; 80 82 }; 81 83 -
trunk/Source/WebCore/inspector/WebConsoleAgent.cpp
r178820 r189218 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2011 Google Inc. All rights reserved. 4 4 * … … 42 42 namespace WebCore { 43 43 44 WebConsoleAgent::WebConsoleAgent(WebInjectedScriptManager *injectedScriptManager)44 WebConsoleAgent::WebConsoleAgent(WebInjectedScriptManager& injectedScriptManager) 45 45 : InspectorConsoleAgent(injectedScriptManager) 46 , m_monitoringXHREnabled(false)47 46 { 48 47 } … … 65 64 } 66 65 67 static_cast<WebInjectedScriptManager *>(m_injectedScriptManager)->discardInjectedScriptsFor(window);66 static_cast<WebInjectedScriptManager&>(m_injectedScriptManager).discardInjectedScriptsFor(window); 68 67 } 69 68 70 69 void WebConsoleAgent::didFinishXHRLoading(unsigned long requestIdentifier, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber) 71 70 { 72 if (!m_injectedScriptManager ->inspectorEnvironment().developerExtrasEnabled())71 if (!m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled()) 73 72 return; 74 73 … … 81 80 void WebConsoleAgent::didReceiveResponse(unsigned long requestIdentifier, const ResourceResponse& response) 82 81 { 83 if (!m_injectedScriptManager ->inspectorEnvironment().developerExtrasEnabled())82 if (!m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled()) 84 83 return; 85 84 … … 92 91 void WebConsoleAgent::didFailLoading(unsigned long requestIdentifier, const ResourceError& error) 93 92 { 94 if (!m_injectedScriptManager ->inspectorEnvironment().developerExtrasEnabled())93 if (!m_injectedScriptManager.inspectorEnvironment().developerExtrasEnabled()) 95 94 return; 96 95 -
trunk/Source/WebCore/inspector/WebConsoleAgent.h
r178820 r189218 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2011 Google Inc. All rights reserved. 4 4 * … … 41 41 WTF_MAKE_FAST_ALLOCATED; 42 42 public: 43 WebConsoleAgent(WebInjectedScriptManager *);43 WebConsoleAgent(WebInjectedScriptManager&); 44 44 virtual ~WebConsoleAgent() { } 45 45 … … 53 53 54 54 protected: 55 bool m_monitoringXHREnabled ;55 bool m_monitoringXHREnabled { false }; 56 56 }; 57 57 -
trunk/Source/WebCore/inspector/WebDebuggerAgent.cpp
r178820 r189218 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 33 33 namespace WebCore { 34 34 35 WebDebuggerAgent::WebDebuggerAgent(InjectedScriptManager * injectedScriptManager, InstrumentingAgents*instrumentingAgents)35 WebDebuggerAgent::WebDebuggerAgent(InjectedScriptManager& injectedScriptManager, InstrumentingAgents& instrumentingAgents) 36 36 : InspectorDebuggerAgent(injectedScriptManager) 37 37 , m_instrumentingAgents(instrumentingAgents) … … 42 42 { 43 43 InspectorDebuggerAgent::enable(); 44 m_instrumentingAgents ->setInspectorDebuggerAgent(this);44 m_instrumentingAgents.setInspectorDebuggerAgent(this); 45 45 } 46 46 … … 48 48 { 49 49 InspectorDebuggerAgent::disable(isBeingDestroyed); 50 m_instrumentingAgents ->setInspectorDebuggerAgent(nullptr);50 m_instrumentingAgents.setInspectorDebuggerAgent(nullptr); 51 51 } 52 52 -
trunk/Source/WebCore/inspector/WebDebuggerAgent.h
r178820 r189218 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014, 2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 38 38 WTF_MAKE_FAST_ALLOCATED; 39 39 public: 40 WebDebuggerAgent(Inspector::InjectedScriptManager *, InstrumentingAgents*);40 WebDebuggerAgent(Inspector::InjectedScriptManager&, InstrumentingAgents&); 41 41 virtual ~WebDebuggerAgent() { } 42 42 … … 45 45 virtual void disable(bool isBeingDestroyed) override; 46 46 47 InstrumentingAgents *m_instrumentingAgents;47 InstrumentingAgents& m_instrumentingAgents; 48 48 }; 49 49 -
trunk/Source/WebCore/inspector/WorkerConsoleAgent.cpp
r178820 r189218 1 1 /* 2 2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2015 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 36 37 namespace WebCore { 37 38 38 WorkerConsoleAgent::WorkerConsoleAgent(WebInjectedScriptManager *injectedScriptManager)39 WorkerConsoleAgent::WorkerConsoleAgent(WebInjectedScriptManager& injectedScriptManager) 39 40 : WebConsoleAgent(injectedScriptManager) 40 41 { -
trunk/Source/WebCore/inspector/WorkerConsoleAgent.h
r178820 r189218 1 1 /* 2 2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2015 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 40 41 WTF_MAKE_FAST_ALLOCATED; 41 42 public: 42 WorkerConsoleAgent(WebInjectedScriptManager *);43 WorkerConsoleAgent(WebInjectedScriptManager&); 43 44 virtual ~WorkerConsoleAgent() { } 44 45 -
trunk/Source/WebCore/inspector/WorkerDebuggerAgent.cpp
r188642 r189218 1 1 /* 2 2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2015 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 81 82 const char* WorkerDebuggerAgent::debuggerTaskMode = "debugger"; 82 83 83 WorkerDebuggerAgent::WorkerDebuggerAgent(InjectedScriptManager * injectedScriptManager, InstrumentingAgents*instrumentingAgents, WorkerGlobalScope* inspectedWorkerGlobalScope)84 WorkerDebuggerAgent::WorkerDebuggerAgent(InjectedScriptManager& injectedScriptManager, InstrumentingAgents& instrumentingAgents, WorkerGlobalScope* inspectedWorkerGlobalScope) 84 85 : WebDebuggerAgent(injectedScriptManager, instrumentingAgents) 85 86 , m_scriptDebugServer(inspectedWorkerGlobalScope, WorkerDebuggerAgent::debuggerTaskMode) … … 134 135 135 136 JSC::ExecState* scriptState = execStateFromWorkerGlobalScope(m_inspectedWorkerGlobalScope); 136 return injectedScriptManager() ->injectedScriptFor(scriptState);137 return injectedScriptManager().injectedScriptFor(scriptState); 137 138 } 138 139 -
trunk/Source/WebCore/inspector/WorkerDebuggerAgent.h
r178820 r189218 1 1 /* 2 2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2015 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 44 45 WTF_MAKE_FAST_ALLOCATED; 45 46 public: 46 WorkerDebuggerAgent(Inspector::InjectedScriptManager *, InstrumentingAgents*, WorkerGlobalScope*);47 WorkerDebuggerAgent(Inspector::InjectedScriptManager&, InstrumentingAgents&, WorkerGlobalScope*); 47 48 virtual ~WorkerDebuggerAgent(); 48 49 … … 61 62 private: 62 63 WorkerScriptDebugServer m_scriptDebugServer; 63 WorkerGlobalScope* m_inspectedWorkerGlobalScope ;64 WorkerGlobalScope* m_inspectedWorkerGlobalScope { nullptr }; 64 65 }; 65 66 -
trunk/Source/WebCore/inspector/WorkerInspectorController.cpp
r189034 r189218 80 80 , m_instrumentingAgents(InstrumentingAgents::create(*this)) 81 81 , m_injectedScriptManager(std::make_unique<WebInjectedScriptManager>(*this, WebInjectedScriptHost::create())) 82 , m_runtimeAgent(nullptr)83 82 , m_executionStopwatch(Stopwatch::create()) 84 83 { 85 auto runtimeAgent = std::make_unique<WorkerRuntimeAgent>( m_injectedScriptManager.get(), &workerGlobalScope);84 auto runtimeAgent = std::make_unique<WorkerRuntimeAgent>(*m_injectedScriptManager, &workerGlobalScope); 86 85 m_runtimeAgent = runtimeAgent.get(); 87 86 m_instrumentingAgents->setWorkerRuntimeAgent(m_runtimeAgent); 88 87 m_agents.append(WTF::move(runtimeAgent)); 89 88 90 auto consoleAgent = std::make_unique<WorkerConsoleAgent>( m_injectedScriptManager.get());89 auto consoleAgent = std::make_unique<WorkerConsoleAgent>(*m_injectedScriptManager); 91 90 m_instrumentingAgents->setWebConsoleAgent(consoleAgent.get()); 92 91 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); 94 93 m_runtimeAgent->setScriptDebugServer(&debuggerAgent->scriptDebugServer()); 95 94 m_agents.append(WTF::move(debuggerAgent)); -
trunk/Source/WebCore/inspector/WorkerInspectorController.h
r180116 r189218 75 75 76 76 WorkerGlobalScope& m_workerGlobalScope; 77 Ref Ptr<InstrumentingAgents> m_instrumentingAgents;77 Ref<InstrumentingAgents> m_instrumentingAgents; 78 78 std::unique_ptr<WebInjectedScriptManager> m_injectedScriptManager; 79 WorkerRuntimeAgent* m_runtimeAgent ;79 WorkerRuntimeAgent* m_runtimeAgent { nullptr }; 80 80 Inspector::AgentRegistry m_agents; 81 81 std::unique_ptr<Inspector::FrontendChannel> m_frontendChannel; -
trunk/Source/WebCore/inspector/WorkerRuntimeAgent.cpp
r186279 r189218 47 47 namespace WebCore { 48 48 49 WorkerRuntimeAgent::WorkerRuntimeAgent(InjectedScriptManager *injectedScriptManager, WorkerGlobalScope* workerGlobalScope)49 WorkerRuntimeAgent::WorkerRuntimeAgent(InjectedScriptManager& injectedScriptManager, WorkerGlobalScope* workerGlobalScope) 50 50 : InspectorRuntimeAgent(injectedScriptManager) 51 51 , m_workerGlobalScope(workerGlobalScope) 52 , m_paused(false)53 52 { 54 53 } … … 74 73 75 74 JSC::ExecState* scriptState = execStateFromWorkerGlobalScope(m_workerGlobalScope); 76 return injectedScriptManager() ->injectedScriptFor(scriptState);75 return injectedScriptManager().injectedScriptFor(scriptState); 77 76 } 78 77 -
trunk/Source/WebCore/inspector/WorkerRuntimeAgent.h
r180116 r189218 41 41 class WorkerRuntimeAgent final : public Inspector::InspectorRuntimeAgent { 42 42 public: 43 WorkerRuntimeAgent(Inspector::InjectedScriptManager *, WorkerGlobalScope*);43 WorkerRuntimeAgent(Inspector::InjectedScriptManager&, WorkerGlobalScope*); 44 44 virtual ~WorkerRuntimeAgent() { } 45 45 … … 56 56 virtual void muteConsole() override; 57 57 virtual void unmuteConsole() override; 58 WorkerGlobalScope* m_workerGlobalScope;59 58 RefPtr<Inspector::RuntimeBackendDispatcher> m_backendDispatcher; 60 bool m_paused; 59 60 WorkerGlobalScope* m_workerGlobalScope { nullptr }; 61 bool m_paused { false }; 61 62 }; 62 63
Note: See TracChangeset
for help on using the changeset viewer.