Changeset 86327 in webkit
- Timestamp:
- May 12, 2011 3:48:09 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86326 r86327 1 2011-05-06 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: move agents from InspectorAgent to InspectorController 6 https://bugs.webkit.org/show_bug.cgi?id=60359 7 8 All inspector agents are now created and owned by InspectorController which 9 in turned is owned by the inspected Page. InspectorInstrumentation gets access 10 to the instrumenting agents by means of InspectorAgent::instrumentingAgents(). 11 12 In addition to managing inspector agents lifetime InspectorController sets 13 InspectorFronted on the agents when the front-end is connected. 14 15 * inspector/InspectorAgent.cpp: 16 (WebCore::InspectorAgent::InspectorAgent): 17 (WebCore::InspectorAgent::~InspectorAgent): 18 (WebCore::InspectorAgent::inspectedPageDestroyed): 19 (WebCore::InspectorAgent::restore): 20 (WebCore::InspectorAgent::setFrontend): 21 (WebCore::InspectorAgent::clearFrontend): 22 * inspector/InspectorAgent.h: all accessors to other agents were removed along with 23 the agents themselves from InspectorAgent. Every agent that depends on some other agents 24 receives pointers to them explicitely in its constructor. All access to the agents 25 from WebCore should go through InspectorInstrumentation which retrieves corresponding 26 agents using InstrumentingAgents structure which represents the set of active agents. 27 (WebCore::InspectorAgent::instrumentingAgents): 28 * inspector/InspectorController.cpp: 29 (WebCore::InspectorController::InspectorController): 30 (WebCore::InspectorController::~InspectorController): 31 (WebCore::InspectorController::inspectedPageDestroyed): 32 (WebCore::InspectorController::startTimelineProfiler): 33 (WebCore::InspectorController::stopTimelineProfiler): 34 (WebCore::InspectorController::connectFrontend): 35 (WebCore::InspectorController::disconnectFrontend): 36 (WebCore::InspectorController::restoreInspectorStateFromCookie): 37 (WebCore::InspectorController::drawNodeHighlight): 38 (WebCore::InspectorController::inspect): 39 (WebCore::InspectorController::timelineProfilerEnabled): 40 (WebCore::InspectorController::hideHighlight): 41 (WebCore::InspectorController::highlightedNode): 42 (WebCore::InspectorController::enableProfiler): 43 (WebCore::InspectorController::disableProfiler): 44 (WebCore::InspectorController::profilerEnabled): 45 (WebCore::InspectorController::debuggerEnabled): 46 (WebCore::InspectorController::disableDebugger): 47 (WebCore::InspectorController::startUserInitiatedProfiling): 48 (WebCore::InspectorController::stopUserInitiatedProfiling): 49 (WebCore::InspectorController::isRecordingUserInitiatedProfile): 50 (WebCore::InspectorController::resume): 51 * inspector/InspectorController.h: 52 * inspector/InspectorInstrumentation.cpp: 53 (WebCore::InspectorInstrumentation::didInsertDOMNodeImpl): 54 (WebCore::InspectorInstrumentation::didRemoveDOMNodeImpl): 55 (WebCore::InspectorInstrumentation::didModifyDOMAttrImpl): 56 (WebCore::InspectorInstrumentation::didInvalidateStyleAttrImpl): 57 (WebCore::InspectorInstrumentation::characterDataModifiedImpl): 58 (WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl): 59 (WebCore::InspectorInstrumentation::didFailLoadingImpl): 60 (WebCore::InspectorInstrumentation::resourceRetrievedByXMLHttpRequestImpl): 61 (WebCore::InspectorInstrumentation::addMessageToConsoleImpl): 62 (WebCore::InspectorInstrumentation::consoleCountImpl): 63 (WebCore::InspectorInstrumentation::startConsoleTimingImpl): 64 (WebCore::InspectorInstrumentation::stopConsoleTimingImpl): 65 (WebCore::InspectorInstrumentation::addStartProfilingMessageToConsoleImpl): 66 (WebCore::InspectorInstrumentation::addProfileImpl): 67 (WebCore::InspectorInstrumentation::getCurrentUserInitiatedProfileNameImpl): 68 (WebCore::InspectorInstrumentation::profilerEnabledImpl): 69 (WebCore::InspectorInstrumentation::cancelPauseOnNativeEvent): 70 * page/Page.cpp: 71 (WebCore::Page::~Page): we send two notifications when inspected Page is being 72 destroyed: one to the inspector instrumentation and another one to the InspectorController 73 which is owned by the Page. 74 1 75 2011-05-12 Tony Gentilcore <tonyg@chromium.org> 2 76 -
trunk/Source/WebCore/inspector/InjectedScriptHost.h
r86251 r86327 47 47 class InspectorFrontend; 48 48 class InspectorObject; 49 class InspectorValue; 49 50 class Node; 50 51 class ScriptObject; -
trunk/Source/WebCore/inspector/InspectorAgent.cpp
r85850 r86327 40 40 #include "InjectedScriptHost.h" 41 41 #include "InjectedScriptManager.h" 42 #include "InspectorDOMDebuggerAgent.h"43 #include "InspectorCSSAgent.h"44 #include "InspectorClient.h"45 #include "InspectorConsoleAgent.h"46 42 #include "InspectorController.h" 47 #include "InspectorDOMAgent.h"48 43 #include "InspectorFrontend.h" 49 44 #include "InspectorInstrumentation.h" 50 #include "InspectorPageAgent.h"51 #include "InspectorProfilerAgent.h"52 #include "InspectorResourceAgent.h"53 #include "InspectorRuntimeAgent.h"54 #include "InspectorState.h"55 #include "InspectorTimelineAgent.h"56 45 #include "InspectorValues.h" 57 #include "InspectorWorkerAgent.h"58 46 #include "InspectorWorkerResource.h" 59 47 #include "InstrumentingAgents.h" 60 48 #include "Page.h" 61 #include "PageDebuggerAgent.h"62 49 #include "ResourceRequest.h" 63 50 #include "ScriptFunctionCall.h" 64 51 #include "ScriptObject.h" 65 #include "ScriptState.h"66 52 #include "Settings.h" 67 68 #if ENABLE(DATABASE) 69 #include "InspectorDatabaseAgent.h" 70 #endif 71 72 #if ENABLE(DOM_STORAGE) 73 #include "InspectorDOMStorageAgent.h" 74 #endif 75 76 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 77 #include "InspectorApplicationCacheAgent.h" 78 #endif 53 #include <wtf/PassRefPtr.h> 54 #include <wtf/RefPtr.h> 79 55 80 56 using namespace std; 81 57 82 58 namespace WebCore { 83 84 namespace InspectorAgentState {85 static const char timelineProfilerEnabled[] = "timelineProfilerEnabled";86 static const char debuggerEnabled[] = "debuggerEnabled";87 }88 59 89 60 static const char scriptsPanelName[] = "scripts"; … … 91 62 static const char profilesPanelName[] = "profiles"; 92 63 93 namespace { 94 95 class PageRuntimeAgent : public InspectorRuntimeAgent { 96 public: 97 PageRuntimeAgent(InjectedScriptManager* injectedScriptManager, Page* page) 98 : InspectorRuntimeAgent(injectedScriptManager) 99 , m_inspectedPage(page) { } 100 virtual ~PageRuntimeAgent() { } 101 102 private: 103 virtual ScriptState* getDefaultInspectedState() { return mainWorldScriptState(m_inspectedPage->mainFrame()); } 104 Page* m_inspectedPage; 105 }; 106 107 } 108 109 InspectorAgent::InspectorAgent(Page* page, InspectorClient* client, InjectedScriptManager* injectedScriptManager) 64 InspectorAgent::InspectorAgent(Page* page, InjectedScriptManager* injectedScriptManager, InstrumentingAgents* instrumentingAgents) 110 65 : m_inspectedPage(page) 111 , m_client(client)112 66 , m_frontend(0) 113 , m_instrumentingAgents( adoptPtr(new InstrumentingAgents))67 , m_instrumentingAgents(instrumentingAgents) 114 68 , m_injectedScriptManager(injectedScriptManager) 115 , m_state(adoptPtr(new InspectorState(client)))116 , m_pageAgent(InspectorPageAgent::create(m_instrumentingAgents.get(), page, injectedScriptManager))117 , m_domAgent(InspectorDOMAgent::create(m_instrumentingAgents.get(), m_pageAgent.get(), m_client, m_state.get(), injectedScriptManager))118 , m_cssAgent(adoptPtr(new InspectorCSSAgent(m_instrumentingAgents.get(), m_domAgent.get())))119 #if ENABLE(DATABASE)120 , m_databaseAgent(InspectorDatabaseAgent::create(m_instrumentingAgents.get(), m_state.get()))121 #endif122 #if ENABLE(DOM_STORAGE)123 , m_domStorageAgent(InspectorDOMStorageAgent::create(m_instrumentingAgents.get(), m_state.get()))124 #endif125 , m_timelineAgent(InspectorTimelineAgent::create(m_instrumentingAgents.get(), m_state.get()))126 #if ENABLE(OFFLINE_WEB_APPLICATIONS)127 , m_applicationCacheAgent(adoptPtr(new InspectorApplicationCacheAgent(m_instrumentingAgents.get(), page)))128 #endif129 , m_resourceAgent(InspectorResourceAgent::create(m_instrumentingAgents.get(), m_pageAgent.get(), m_state.get()))130 , m_runtimeAgent(adoptPtr(new PageRuntimeAgent(m_injectedScriptManager, page)))131 , m_consoleAgent(adoptPtr(new InspectorConsoleAgent(m_instrumentingAgents.get(), this, m_state.get(), injectedScriptManager, m_domAgent.get())))132 #if ENABLE(JAVASCRIPT_DEBUGGER)133 , m_debuggerAgent(PageDebuggerAgent::create(m_instrumentingAgents.get(), m_state.get(), page, injectedScriptManager))134 , m_domDebuggerAgent(InspectorDOMDebuggerAgent::create(m_instrumentingAgents.get(), m_state.get(), m_domAgent.get(), m_debuggerAgent.get(), this))135 , m_profilerAgent(InspectorProfilerAgent::create(m_instrumentingAgents.get(), m_consoleAgent.get(), page, m_state.get()))136 #endif137 #if ENABLE(WORKERS)138 , m_workerAgent(InspectorWorkerAgent::create(m_instrumentingAgents.get()))139 #endif140 69 , m_canIssueEvaluateForTestInFrontend(false) 141 70 { 142 71 ASSERT_ARG(page, page); 143 ASSERT_ARG(client, client);144 72 InspectorInstrumentation::bindInspectorAgent(m_inspectedPage, this); 145 73 m_instrumentingAgents->setInspectorAgent(this); 146 147 m_injectedScriptManager->injectedScriptHost()->init(this148 , m_consoleAgent.get()149 #if ENABLE(DATABASE)150 , m_databaseAgent.get()151 #endif152 #if ENABLE(DOM_STORAGE)153 , m_domStorageAgent.get()154 #endif155 );156 74 } 157 75 … … 161 79 162 80 // These should have been cleared in inspectedPageDestroyed(). 163 ASSERT(!m_client);164 81 ASSERT(!m_inspectedPage); 165 82 } … … 167 84 void InspectorAgent::inspectedPageDestroyed() 168 85 { 169 if (m_frontend) {86 if (m_frontend) 170 87 m_frontend->inspector()->disconnectFromBackend(); 171 disconnectFrontend();172 }173 174 #if ENABLE(JAVASCRIPT_DEBUGGER)175 m_domDebuggerAgent.clear();176 m_debuggerAgent.clear();177 #endif178 179 88 ASSERT(m_inspectedPage); 180 89 InspectorInstrumentation::unbindInspectorAgent(m_inspectedPage); 181 90 m_inspectedPage = 0; 182 183 m_injectedScriptManager->disconnect(); 184 185 m_client->inspectorDestroyed(); 186 m_client = 0; 187 } 188 189 void InspectorAgent::restoreInspectorStateFromCookie(const String& inspectorStateCookie) 190 { 191 m_state->loadFromCookie(inspectorStateCookie); 192 91 } 92 93 void InspectorAgent::restore() 94 { 193 95 m_frontend->inspector()->frontendReused(); 194 195 m_domAgent->restore();196 m_resourceAgent->restore();197 m_timelineAgent->restore();198 199 #if ENABLE(DATABASE)200 m_databaseAgent->restore();201 #endif202 203 #if ENABLE(DOM_STORAGE)204 m_domStorageAgent->restore();205 #endif206 207 #if ENABLE(JAVASCRIPT_DEBUGGER)208 m_debuggerAgent->restore();209 m_profilerAgent->restore();210 #endif211 96 } 212 97 … … 222 107 void InspectorAgent::setFrontend(InspectorFrontend* inspectorFrontend) 223 108 { 224 // We can reconnect to existing front-end -> unmute state.225 m_state->unmute();226 227 109 m_frontend = inspectorFrontend; 228 229 #if ENABLE(OFFLINE_WEB_APPLICATIONS)230 m_applicationCacheAgent->setFrontend(m_frontend);231 #endif232 m_pageAgent->setFrontend(m_frontend);233 m_domAgent->setFrontend(m_frontend);234 m_consoleAgent->setFrontend(m_frontend);235 m_timelineAgent->setFrontend(m_frontend);236 m_resourceAgent->setFrontend(m_frontend);237 #if ENABLE(JAVASCRIPT_DEBUGGER)238 m_debuggerAgent->setFrontend(m_frontend);239 m_profilerAgent->setFrontend(m_frontend);240 #endif241 #if ENABLE(DATABASE)242 m_databaseAgent->setFrontend(m_frontend);243 #endif244 #if ENABLE(DOM_STORAGE)245 m_domStorageAgent->setFrontend(m_frontend);246 #endif247 110 248 111 if (!m_showPanelAfterVisible.isEmpty()) { … … 257 120 } 258 121 #endif 259 #if ENABLE(WORKERS)260 m_workerAgent->setFrontend(m_frontend);261 #endif262 122 263 123 // Dispatch pending frontend commands … … 265 125 } 266 126 267 void InspectorAgent::disconnectFrontend() 268 { 269 if (!m_frontend) 270 return; 271 127 void InspectorAgent::clearFrontend() 128 { 272 129 m_canIssueEvaluateForTestInFrontend = false; 273 130 m_pendingEvaluateTestCommands.clear(); 274 275 // Destroying agents would change the state, but we don't want that.276 // Pre-disconnect state will be used to restore inspector agents.277 m_state->mute();278 279 131 m_frontend = 0; 280 281 #if ENABLE(JAVASCRIPT_DEBUGGER)282 m_debuggerAgent->clearFrontend();283 m_domDebuggerAgent->clearFrontend();284 m_profilerAgent->clearFrontend();285 #endif286 287 #if ENABLE(OFFLINE_WEB_APPLICATIONS)288 m_applicationCacheAgent->clearFrontend();289 #endif290 291 m_consoleAgent->clearFrontend();292 m_domAgent->clearFrontend();293 m_timelineAgent->clearFrontend();294 m_resourceAgent->clearFrontend();295 #if ENABLE(DATABASE)296 m_databaseAgent->clearFrontend();297 #endif298 #if ENABLE(DOM_STORAGE)299 m_domStorageAgent->clearFrontend();300 #endif301 m_pageAgent->clearFrontend();302 #if ENABLE(WORKERS)303 m_workerAgent->clearFrontend();304 #endif305 132 } 306 133 -
trunk/Source/WebCore/inspector/InspectorAgent.h
r86251 r86327 1 1 /* 2 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 30 31 #define InspectorAgent_h 31 32 32 #include "CharacterData.h"33 #include "ConsoleTypes.h"34 #include "Page.h"35 33 #include "PlatformString.h" 34 #include <wtf/Forward.h> 36 35 #include <wtf/HashMap.h> 37 #include <wtf/RefCounted.h>38 36 #include <wtf/Vector.h> 39 #include <wtf/text/StringHash.h>40 37 41 38 namespace WebCore { 42 39 43 class CharacterData;44 class Database;45 40 class DOMWrapperWorld; 46 class Document;47 41 class DocumentLoader; 48 class FloatRect; 49 class HTTPHeaderMap; 50 class InjectedScript; 42 class Frame; 51 43 class InjectedScriptManager; 52 class InspectorArray;53 class InspectorDOMDebuggerAgent;54 class InspectorClient;55 class InspectorConsoleAgent;56 class InspectorCSSAgent;57 class InspectorDOMAgent;58 class InspectorDOMStorageAgent;59 class InspectorDatabaseAgent;60 class InspectorDatabaseResource;61 class InspectorDebuggerAgent;62 44 class InspectorFrontend; 63 class InspectorFrontendClient;64 45 class InspectorObject; 65 class InspectorPageAgent;66 class InspectorProfilerAgent;67 class InspectorResourceAgent;68 class InspectorRuntimeAgent;69 class InspectorState;70 class InspectorStorageAgent;71 class InspectorTimelineAgent;72 class InspectorValue;73 class InspectorWorkerAgent;74 46 class InspectorWorkerResource; 75 47 class InstrumentingAgents; 76 class IntRect;77 48 class KURL; 78 class Node;79 49 class Page; 80 class ResourceRequest;81 class ResourceResponse;82 class ResourceError;83 class ScriptArguments;84 class ScriptCallStack;85 class ScriptProfile;86 class SharedBuffer;87 class StorageArea;88 89 #if ENABLE(OFFLINE_WEB_APPLICATIONS)90 class InspectorApplicationCacheAgent;91 #endif92 50 93 51 typedef String ErrorString; … … 97 55 WTF_MAKE_FAST_ALLOCATED; 98 56 public: 99 InspectorAgent(Page*, In spectorClient*, InjectedScriptManager*);57 InspectorAgent(Page*, InjectedScriptManager*, InstrumentingAgents*); 100 58 virtual ~InspectorAgent(); 101 102 InspectorClient* inspectorClient() { return m_client; }103 59 104 60 void inspectedPageDestroyed(); … … 112 68 void showConsole(); 113 69 114 void restoreInspectorStateFromCookie(const String& inspectorCookie);115 116 70 void setFrontend(InspectorFrontend*); 117 71 InspectorFrontend* frontend() const { return m_frontend; } 118 void disconnectFrontend(); 72 void clearFrontend(); 73 void restore(); 119 74 120 InstrumentingAgents* instrumentingAgents() const { return m_instrumentingAgents.get(); } 121 122 InspectorPageAgent* pageAgent() { return m_pageAgent.get(); } 123 InspectorConsoleAgent* consoleAgent() { return m_consoleAgent.get(); } 124 InspectorCSSAgent* cssAgent() { return m_cssAgent.get(); } 125 InspectorDOMAgent* domAgent() { return m_domAgent.get(); } 126 InspectorRuntimeAgent* runtimeAgent() { return m_runtimeAgent.get(); } 127 InspectorTimelineAgent* timelineAgent() { return m_timelineAgent.get(); } 128 InspectorResourceAgent* resourceAgent() { return m_resourceAgent.get(); } 129 #if ENABLE(DATABASE) 130 InspectorDatabaseAgent* databaseAgent() { return m_databaseAgent.get(); } 131 #endif 132 #if ENABLE(DOM_STORAGE) 133 InspectorDOMStorageAgent* domStorageAgent() { return m_domStorageAgent.get(); } 134 #endif 135 #if ENABLE(JAVASCRIPT_DEBUGGER) 136 InspectorDOMDebuggerAgent* domDebuggerAgent() const { return m_domDebuggerAgent.get(); } 137 InspectorDebuggerAgent* debuggerAgent() const { return m_debuggerAgent.get(); } 138 InspectorProfilerAgent* profilerAgent() const { return m_profilerAgent.get(); } 139 #endif 140 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 141 InspectorApplicationCacheAgent* applicationCacheAgent() { return m_applicationCacheAgent.get(); } 142 #endif 143 #if ENABLE(WORKERS) 144 InspectorWorkerAgent* workerAgent() { return m_workerAgent.get(); } 145 #endif 75 InstrumentingAgents* instrumentingAgents() const { return m_instrumentingAgents; } 146 76 147 77 void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*); … … 170 100 void setInspectorExtensionAPI(const String& source); 171 101 172 InspectorState* state() { return m_state.get(); }173 174 102 // InspectorAgent API 175 103 void getInspectorState(RefPtr<InspectorObject>* state); … … 188 116 189 117 Page* m_inspectedPage; 190 InspectorClient* m_client;191 118 InspectorFrontend* m_frontend; 192 OwnPtr<InstrumentingAgents>m_instrumentingAgents;119 InstrumentingAgents* m_instrumentingAgents; 193 120 InjectedScriptManager* m_injectedScriptManager; 194 OwnPtr<InspectorState> m_state;195 OwnPtr<InspectorPageAgent> m_pageAgent;196 OwnPtr<InspectorDOMAgent> m_domAgent;197 OwnPtr<InspectorCSSAgent> m_cssAgent;198 199 #if ENABLE(DATABASE)200 OwnPtr<InspectorDatabaseAgent> m_databaseAgent;201 #endif202 203 #if ENABLE(DOM_STORAGE)204 OwnPtr<InspectorDOMStorageAgent> m_domStorageAgent;205 #endif206 207 OwnPtr<InspectorTimelineAgent> m_timelineAgent;208 209 #if ENABLE(OFFLINE_WEB_APPLICATIONS)210 OwnPtr<InspectorApplicationCacheAgent> m_applicationCacheAgent;211 #endif212 213 RefPtr<InspectorResourceAgent> m_resourceAgent;214 OwnPtr<InspectorRuntimeAgent> m_runtimeAgent;215 216 OwnPtr<InspectorConsoleAgent> m_consoleAgent;217 121 218 122 Vector<pair<long, String> > m_pendingEvaluateTestCommands; 219 123 String m_showPanelAfterVisible; 220 124 String m_inspectorExtensionAPI; 221 #if ENABLE(JAVASCRIPT_DEBUGGER)222 OwnPtr<InspectorDebuggerAgent> m_debuggerAgent;223 OwnPtr<InspectorDOMDebuggerAgent> m_domDebuggerAgent;224 OwnPtr<InspectorProfilerAgent> m_profilerAgent;225 #endif226 125 #if ENABLE(WORKERS) 227 126 typedef HashMap<intptr_t, RefPtr<InspectorWorkerResource> > WorkersMap; 228 127 WorkersMap m_workers; 229 OwnPtr<InspectorWorkerAgent> m_workerAgent;230 128 #endif 231 129 bool m_canIssueEvaluateForTestInFrontend; -
trunk/Source/WebCore/inspector/InspectorController.cpp
r85850 r86327 39 39 #include "InjectedScriptManager.h" 40 40 #include "InspectorAgent.h" 41 #include "InspectorApplicationCacheAgent.h" 41 42 #include "InspectorBackendDispatcher.h" 43 #include "InspectorCSSAgent.h" 44 #include "InspectorClient.h" 45 #include "InspectorConsoleAgent.h" 46 #include "InspectorDOMAgent.h" 47 #include "InspectorDOMDebuggerAgent.h" 48 #include "InspectorDOMStorageAgent.h" 49 #include "InspectorDatabaseAgent.h" 42 50 #include "InspectorDebuggerAgent.h" 43 #include "InspectorClient.h"44 #include "InspectorDOMAgent.h"45 51 #include "InspectorFrontend.h" 46 52 #include "InspectorFrontendClient.h" 47 53 #include "InspectorInstrumentation.h" 54 #include "InspectorPageAgent.h" 48 55 #include "InspectorProfilerAgent.h" 56 #include "InspectorResourceAgent.h" 57 #include "InspectorRuntimeAgent.h" 58 #include "InspectorState.h" 49 59 #include "InspectorTimelineAgent.h" 50 60 #include "InspectorWorkerAgent.h" 61 #include "InstrumentingAgents.h" 62 #include "PageDebuggerAgent.h" 51 63 #include "Page.h" 52 64 #include "ScriptObject.h" … … 56 68 namespace WebCore { 57 69 70 namespace { 71 72 class PageRuntimeAgent : public InspectorRuntimeAgent { 73 public: 74 PageRuntimeAgent(InjectedScriptManager* injectedScriptManager, Page* page) 75 : InspectorRuntimeAgent(injectedScriptManager) 76 , m_inspectedPage(page) { } 77 virtual ~PageRuntimeAgent() { } 78 79 private: 80 virtual ScriptState* getDefaultInspectedState() { return mainWorldScriptState(m_inspectedPage->mainFrame()); } 81 Page* m_inspectedPage; 82 }; 83 84 } 85 58 86 InspectorController::InspectorController(Page* page, InspectorClient* inspectorClient) 59 : m_injectedScriptManager(InjectedScriptManager::createForPage()) 60 , m_inspectorAgent(adoptPtr(new InspectorAgent(page, inspectorClient, m_injectedScriptManager.get()))) 87 : m_instrumentingAgents(adoptPtr(new InstrumentingAgents())) 88 , m_injectedScriptManager(InjectedScriptManager::createForPage()) 89 , m_state(adoptPtr(new InspectorState(inspectorClient))) 90 , m_inspectorAgent(adoptPtr(new InspectorAgent(page, m_injectedScriptManager.get(), m_instrumentingAgents.get()))) 91 , m_pageAgent(InspectorPageAgent::create(m_instrumentingAgents.get(), page, m_injectedScriptManager.get())) 92 , m_domAgent(InspectorDOMAgent::create(m_instrumentingAgents.get(), m_pageAgent.get(), inspectorClient, m_state.get(), m_injectedScriptManager.get())) 93 , m_cssAgent(adoptPtr(new InspectorCSSAgent(m_instrumentingAgents.get(), m_domAgent.get()))) 94 #if ENABLE(DATABASE) 95 , m_databaseAgent(InspectorDatabaseAgent::create(m_instrumentingAgents.get(), m_state.get())) 96 #endif 97 #if ENABLE(DOM_STORAGE) 98 , m_domStorageAgent(InspectorDOMStorageAgent::create(m_instrumentingAgents.get(), m_state.get())) 99 #endif 100 , m_timelineAgent(InspectorTimelineAgent::create(m_instrumentingAgents.get(), m_state.get())) 101 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 102 , m_applicationCacheAgent(adoptPtr(new InspectorApplicationCacheAgent(m_instrumentingAgents.get(), page))) 103 #endif 104 , m_resourceAgent(InspectorResourceAgent::create(m_instrumentingAgents.get(), m_pageAgent.get(), m_state.get())) 105 , m_runtimeAgent(adoptPtr(new PageRuntimeAgent(m_injectedScriptManager.get(), page))) 106 , m_consoleAgent(adoptPtr(new InspectorConsoleAgent(m_instrumentingAgents.get(), m_inspectorAgent.get(), m_state.get(), m_injectedScriptManager.get(), m_domAgent.get()))) 107 #if ENABLE(JAVASCRIPT_DEBUGGER) 108 , m_debuggerAgent(PageDebuggerAgent::create(m_instrumentingAgents.get(), m_state.get(), page, m_injectedScriptManager.get())) 109 , m_domDebuggerAgent(InspectorDOMDebuggerAgent::create(m_instrumentingAgents.get(), m_state.get(), m_domAgent.get(), m_debuggerAgent.get(), m_inspectorAgent.get())) 110 , m_profilerAgent(InspectorProfilerAgent::create(m_instrumentingAgents.get(), m_consoleAgent.get(), page, m_state.get())) 111 #endif 112 #if ENABLE(WORKERS) 113 , m_workerAgent(InspectorWorkerAgent::create(m_instrumentingAgents.get())) 114 #endif 61 115 , m_inspectorClient(inspectorClient) 62 116 , m_openingFrontend(false) 63 117 , m_startUserInitiatedDebuggingWhenFrontedIsConnected(false) 64 118 { 119 ASSERT_ARG(inspectorClient, inspectorClient); 120 m_injectedScriptManager->injectedScriptHost()->init(m_inspectorAgent.get() 121 , m_consoleAgent.get() 122 #if ENABLE(DATABASE) 123 , m_databaseAgent.get() 124 #endif 125 #if ENABLE(DOM_STORAGE) 126 , m_domStorageAgent.get() 127 #endif 128 ); 65 129 } 66 130 67 131 InspectorController::~InspectorController() 68 132 { 133 ASSERT(!m_inspectorClient); 134 } 135 136 void InspectorController::inspectedPageDestroyed() 137 { 138 disconnectFrontend(); 139 #if ENABLE(JAVASCRIPT_DEBUGGER) 140 m_domDebuggerAgent.clear(); 141 m_debuggerAgent.clear(); 142 #endif 143 m_injectedScriptManager->disconnect(); 144 m_inspectorClient->inspectorDestroyed(); 145 m_inspectorClient = 0; 69 146 } 70 147 … … 93 170 { 94 171 ErrorString error; 95 m_ inspectorAgent->timelineAgent()->start(&error);172 m_timelineAgent->start(&error); 96 173 } 97 174 … … 99 176 { 100 177 ErrorString error; 101 m_ inspectorAgent->timelineAgent()->stop(&error);178 m_timelineAgent->stop(&error); 102 179 } 103 180 … … 107 184 m_inspectorFrontend = adoptPtr(new InspectorFrontend(m_inspectorClient)); 108 185 m_injectedScriptManager->injectedScriptHost()->setFrontend(m_inspectorFrontend.get()); 186 // We can reconnect to existing front-end -> unmute state. 187 m_state->unmute(); 188 189 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 190 m_applicationCacheAgent->setFrontend(m_inspectorFrontend.get()); 191 #endif 192 m_pageAgent->setFrontend(m_inspectorFrontend.get()); 193 m_domAgent->setFrontend(m_inspectorFrontend.get()); 194 m_consoleAgent->setFrontend(m_inspectorFrontend.get()); 195 m_timelineAgent->setFrontend(m_inspectorFrontend.get()); 196 m_resourceAgent->setFrontend(m_inspectorFrontend.get()); 197 #if ENABLE(JAVASCRIPT_DEBUGGER) 198 m_debuggerAgent->setFrontend(m_inspectorFrontend.get()); 199 m_profilerAgent->setFrontend(m_inspectorFrontend.get()); 200 #endif 201 #if ENABLE(DATABASE) 202 m_databaseAgent->setFrontend(m_inspectorFrontend.get()); 203 #endif 204 #if ENABLE(DOM_STORAGE) 205 m_domStorageAgent->setFrontend(m_inspectorFrontend.get()); 206 #endif 207 #if ENABLE(WORKERS) 208 m_workerAgent->setFrontend(m_inspectorFrontend.get()); 209 #endif 109 210 m_inspectorAgent->setFrontend(m_inspectorFrontend.get()); 110 211 … … 117 218 m_inspectorClient, 118 219 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 119 m_ inspectorAgent->applicationCacheAgent(),120 #endif 121 m_ inspectorAgent->cssAgent(),122 m_ inspectorAgent->consoleAgent(),123 m_ inspectorAgent->domAgent(),124 #if ENABLE(JAVASCRIPT_DEBUGGER) 125 m_ inspectorAgent->domDebuggerAgent(),126 #endif 127 #if ENABLE(DOM_STORAGE) 128 m_ inspectorAgent->domStorageAgent(),129 #endif 130 #if ENABLE(DATABASE) 131 m_ inspectorAgent->databaseAgent(),132 #endif 133 #if ENABLE(JAVASCRIPT_DEBUGGER) 134 m_ inspectorAgent->debuggerAgent(),135 #endif 136 m_ inspectorAgent->resourceAgent(),137 m_ inspectorAgent->pageAgent(),138 #if ENABLE(JAVASCRIPT_DEBUGGER) 139 m_ inspectorAgent->profilerAgent(),140 #endif 141 m_ inspectorAgent->runtimeAgent(),142 m_ inspectorAgent->timelineAgent()220 m_applicationCacheAgent.get(), 221 #endif 222 m_cssAgent.get(), 223 m_consoleAgent.get(), 224 m_domAgent.get(), 225 #if ENABLE(JAVASCRIPT_DEBUGGER) 226 m_domDebuggerAgent.get(), 227 #endif 228 #if ENABLE(DOM_STORAGE) 229 m_domStorageAgent.get(), 230 #endif 231 #if ENABLE(DATABASE) 232 m_databaseAgent.get(), 233 #endif 234 #if ENABLE(JAVASCRIPT_DEBUGGER) 235 m_debuggerAgent.get(), 236 #endif 237 m_resourceAgent.get(), 238 m_pageAgent.get(), 239 #if ENABLE(JAVASCRIPT_DEBUGGER) 240 m_profilerAgent.get(), 241 #endif 242 m_runtimeAgent.get(), 243 m_timelineAgent.get() 143 244 #if ENABLE(WORKERS) 144 , m_ inspectorAgent->workerAgent()245 , m_workerAgent.get() 145 246 #endif 146 247 )); … … 158 259 m_inspectorBackendDispatcher.clear(); 159 260 160 m_inspectorAgent->disconnectFrontend(); 261 // Destroying agents would change the state, but we don't want that. 262 // Pre-disconnect state will be used to restore inspector agents. 263 m_state->mute(); 264 265 m_inspectorAgent->clearFrontend(); 266 #if ENABLE(JAVASCRIPT_DEBUGGER) 267 m_debuggerAgent->clearFrontend(); 268 m_domDebuggerAgent->clearFrontend(); 269 m_profilerAgent->clearFrontend(); 270 #endif 271 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 272 m_applicationCacheAgent->clearFrontend(); 273 #endif 274 m_consoleAgent->clearFrontend(); 275 m_domAgent->clearFrontend(); 276 m_timelineAgent->clearFrontend(); 277 m_resourceAgent->clearFrontend(); 278 #if ENABLE(DATABASE) 279 m_databaseAgent->clearFrontend(); 280 #endif 281 #if ENABLE(DOM_STORAGE) 282 m_domStorageAgent->clearFrontend(); 283 #endif 284 m_pageAgent->clearFrontend(); 285 #if ENABLE(WORKERS) 286 m_workerAgent->clearFrontend(); 287 #endif 161 288 m_injectedScriptManager->injectedScriptHost()->clearFrontend(); 162 289 … … 196 323 ASSERT(!m_inspectorFrontend); 197 324 connectFrontend(); 198 m_inspectorAgent->restoreInspectorStateFromCookie(inspectorStateCookie); 325 m_state->loadFromCookie(inspectorStateCookie); 326 327 m_domAgent->restore(); 328 m_resourceAgent->restore(); 329 m_timelineAgent->restore(); 330 #if ENABLE(DATABASE) 331 m_databaseAgent->restore(); 332 #endif 333 #if ENABLE(DOM_STORAGE) 334 m_domStorageAgent->restore(); 335 #endif 336 #if ENABLE(JAVASCRIPT_DEBUGGER) 337 m_debuggerAgent->restore(); 338 m_profilerAgent->restore(); 339 #endif 340 m_inspectorAgent->restore(); 199 341 } 200 342 … … 206 348 void InspectorController::drawNodeHighlight(GraphicsContext& context) const 207 349 { 208 m_ inspectorAgent->domAgent()->drawNodeHighlight(context);350 m_domAgent->drawNodeHighlight(context); 209 351 } 210 352 … … 224 366 show(); 225 367 226 m_ inspectorAgent->domAgent()->inspect(node);368 m_domAgent->inspect(node); 227 369 } 228 370 … … 239 381 bool InspectorController::timelineProfilerEnabled() 240 382 { 241 return m_ inspectorAgent->timelineAgent()->started();383 return m_timelineAgent->started(); 242 384 } 243 385 … … 256 398 { 257 399 ErrorString error; 258 m_ inspectorAgent->domAgent()->hideHighlight(&error);400 m_domAgent->hideHighlight(&error); 259 401 } 260 402 261 403 Node* InspectorController::highlightedNode() const 262 404 { 263 return m_ inspectorAgent->domAgent()->highlightedNode();405 return m_domAgent->highlightedNode(); 264 406 } 265 407 … … 268 410 { 269 411 ErrorString error; 270 m_ inspectorAgent->profilerAgent()->enable(&error);412 m_profilerAgent->enable(&error); 271 413 } 272 414 … … 274 416 { 275 417 ErrorString error; 276 m_ inspectorAgent->profilerAgent()->disable(&error);418 m_profilerAgent->disable(&error); 277 419 } 278 420 279 421 bool InspectorController::profilerEnabled() 280 422 { 281 return m_ inspectorAgent->profilerAgent()->enabled();423 return m_profilerAgent->enabled(); 282 424 } 283 425 284 426 bool InspectorController::debuggerEnabled() 285 427 { 286 return m_ inspectorAgent->debuggerAgent()->enabled();428 return m_debuggerAgent->enabled(); 287 429 } 288 430 … … 301 443 void InspectorController::disableDebugger() 302 444 { 303 m_ inspectorAgent->debuggerAgent()->disable();445 m_debuggerAgent->disable(); 304 446 } 305 447 306 448 void InspectorController::startUserInitiatedProfiling() 307 449 { 308 m_ inspectorAgent->profilerAgent()->startUserInitiatedProfiling();450 m_profilerAgent->startUserInitiatedProfiling(); 309 451 } 310 452 … … 314 456 return; 315 457 show(); 316 m_ inspectorAgent->profilerAgent()->stopUserInitiatedProfiling();458 m_profilerAgent->stopUserInitiatedProfiling(); 317 459 m_inspectorAgent->showProfilesPanel(); 318 460 } … … 320 462 bool InspectorController::isRecordingUserInitiatedProfile() const 321 463 { 322 return m_ inspectorAgent->profilerAgent()->isRecordingUserInitiatedProfile();464 return m_profilerAgent->isRecordingUserInitiatedProfile(); 323 465 } 324 466 325 467 void InspectorController::resume() 326 468 { 327 if ( InspectorDebuggerAgent* debuggerAgent = m_inspectorAgent->debuggerAgent()) {469 if (m_debuggerAgent) { 328 470 ErrorString error; 329 debuggerAgent->resume(&error);471 m_debuggerAgent->resume(&error); 330 472 } 331 473 } -
trunk/Source/WebCore/inspector/InspectorController.h
r83892 r86327 44 44 class InjectedScriptManager; 45 45 class InspectorAgent; 46 class InspectorApplicationCacheAgent; 46 47 class InspectorBackendDispatcher; 48 class InspectorCSSAgent; 47 49 class InspectorClient; 50 class InspectorConsoleAgent; 51 class InspectorDOMAgent; 52 class InspectorDOMDebuggerAgent; 53 class InspectorDOMStorageAgent; 54 class InspectorDatabaseAgent; 55 class InspectorDebuggerAgent; 48 56 class InspectorFrontend; 49 57 class InspectorFrontendClient; 58 class InspectorPageAgent; 59 class InspectorProfilerAgent; 60 class InspectorResourceAgent; 61 class InspectorRuntimeAgent; 62 class InspectorState; 63 class InspectorStorageAgent; 64 class InspectorTimelineAgent; 65 class InspectorWorkerAgent; 66 class InstrumentingAgents; 50 67 class Page; 51 68 class PostWorkerNotificationToFrontendTask; … … 58 75 InspectorController(Page*, InspectorClient*); 59 76 ~InspectorController(); 77 void inspectedPageDestroyed(); 60 78 61 79 bool enabled() const; … … 105 123 friend class PostWorkerNotificationToFrontendTask; 106 124 125 OwnPtr<InstrumentingAgents> m_instrumentingAgents; 107 126 OwnPtr<InjectedScriptManager> m_injectedScriptManager; 127 OwnPtr<InspectorState> m_state; 108 128 OwnPtr<InspectorAgent> m_inspectorAgent; 129 130 OwnPtr<InspectorPageAgent> m_pageAgent; 131 OwnPtr<InspectorDOMAgent> m_domAgent; 132 OwnPtr<InspectorCSSAgent> m_cssAgent; 133 #if ENABLE(DATABASE) 134 OwnPtr<InspectorDatabaseAgent> m_databaseAgent; 135 #endif 136 #if ENABLE(DOM_STORAGE) 137 OwnPtr<InspectorDOMStorageAgent> m_domStorageAgent; 138 #endif 139 OwnPtr<InspectorTimelineAgent> m_timelineAgent; 140 #if ENABLE(OFFLINE_WEB_APPLICATIONS) 141 OwnPtr<InspectorApplicationCacheAgent> m_applicationCacheAgent; 142 #endif 143 RefPtr<InspectorResourceAgent> m_resourceAgent; 144 OwnPtr<InspectorRuntimeAgent> m_runtimeAgent; 145 OwnPtr<InspectorConsoleAgent> m_consoleAgent; 146 #if ENABLE(JAVASCRIPT_DEBUGGER) 147 OwnPtr<InspectorDebuggerAgent> m_debuggerAgent; 148 OwnPtr<InspectorDOMDebuggerAgent> m_domDebuggerAgent; 149 OwnPtr<InspectorProfilerAgent> m_profilerAgent; 150 #endif 151 #if ENABLE(WORKERS) 152 OwnPtr<InspectorWorkerAgent> m_workerAgent; 153 #endif 154 109 155 OwnPtr<InspectorBackendDispatcher> m_inspectorBackendDispatcher; 110 156 OwnPtr<InspectorFrontendClient> m_inspectorFrontendClient; -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r86251 r86327 116 116 void InspectorInstrumentation::didInsertDOMNodeImpl(InspectorAgent* inspectorAgent, Node* node) 117 117 { 118 if (InspectorDOMAgent* domAgent = inspectorAgent-> domAgent())118 if (InspectorDOMAgent* domAgent = inspectorAgent->instrumentingAgents()->inspectorDOMAgent()) 119 119 domAgent->didInsertDOMNode(node); 120 120 #if ENABLE(JAVASCRIPT_DEBUGGER) … … 138 138 domDebuggerAgent->didRemoveDOMNode(node); 139 139 #endif 140 if (InspectorDOMAgent* domAgent = inspectorAgent-> domAgent())140 if (InspectorDOMAgent* domAgent = inspectorAgent->instrumentingAgents()->inspectorDOMAgent()) 141 141 domAgent->didRemoveDOMNode(node); 142 142 } … … 152 152 void InspectorInstrumentation::didModifyDOMAttrImpl(InspectorAgent* inspectorAgent, Element* element) 153 153 { 154 if (InspectorDOMAgent* domAgent = inspectorAgent-> domAgent())154 if (InspectorDOMAgent* domAgent = inspectorAgent->instrumentingAgents()->inspectorDOMAgent()) 155 155 domAgent->didModifyDOMAttr(element); 156 156 } … … 158 158 void InspectorInstrumentation::didInvalidateStyleAttrImpl(InspectorAgent* inspectorAgent, Node* node) 159 159 { 160 if (InspectorDOMAgent* domAgent = inspectorAgent-> domAgent())160 if (InspectorDOMAgent* domAgent = inspectorAgent->instrumentingAgents()->inspectorDOMAgent()) 161 161 domAgent->didInvalidateStyleAttr(node); 162 162 } … … 177 177 void InspectorInstrumentation::characterDataModifiedImpl(InspectorAgent* inspectorAgent, CharacterData* characterData) 178 178 { 179 if (InspectorDOMAgent* domAgent = inspectorAgent-> domAgent())179 if (InspectorDOMAgent* domAgent = inspectorAgent->instrumentingAgents()->inspectorDOMAgent()) 180 180 domAgent->characterDataModified(characterData); 181 181 } … … 461 461 if (InspectorResourceAgent* resourceAgent = retrieveResourceAgent(inspectorAgent)) 462 462 resourceAgent->didReceiveResponse(identifier, loader, response); 463 inspectorAgent->consoleAgent()->didReceiveResponse(identifier, response); // This should come AFTER resource notification, front-end relies on this. 463 if (InspectorConsoleAgent* consoleAgent = inspectorAgent->instrumentingAgents()->inspectorConsoleAgent()) 464 consoleAgent->didReceiveResponse(identifier, response); // This should come AFTER resource notification, front-end relies on this. 464 465 } 465 466 } … … 506 507 if (InspectorResourceAgent* resourceAgent = retrieveResourceAgent(inspectorAgent)) 507 508 resourceAgent->didFailLoading(identifier, error); 508 inspectorAgent->consoleAgent()->didFailLoading(identifier, error); // This should come AFTER resource notification, front-end relies on this. 509 if (InspectorConsoleAgent* consoleAgent = inspectorAgent->instrumentingAgents()->inspectorConsoleAgent()) 510 consoleAgent->didFailLoading(identifier, error); // This should come AFTER resource notification, front-end relies on this. 509 511 } 510 512 511 513 void InspectorInstrumentation::resourceRetrievedByXMLHttpRequestImpl(InspectorAgent* inspectorAgent, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber) 512 514 { 513 inspectorAgent->consoleAgent()->resourceRetrievedByXMLHttpRequest(url, sendURL, sendLineNumber); 515 if (InspectorConsoleAgent* consoleAgent = inspectorAgent->instrumentingAgents()->inspectorConsoleAgent()) 516 consoleAgent->resourceRetrievedByXMLHttpRequest(url, sendURL, sendLineNumber); 514 517 if (InspectorResourceAgent* resourceAgent = retrieveResourceAgent(inspectorAgent)) 515 518 resourceAgent->setInitialXHRContent(identifier, sourceString); … … 629 632 void InspectorInstrumentation::addMessageToConsoleImpl(InspectorAgent* inspectorAgent, MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> callStack) 630 633 { 631 inspectorAgent->consoleAgent()->addMessageToConsole(source, type, level, message, arguments, callStack); 634 if (InspectorConsoleAgent* consoleAgent = inspectorAgent->instrumentingAgents()->inspectorConsoleAgent()) 635 consoleAgent->addMessageToConsole(source, type, level, message, arguments, callStack); 632 636 } 633 637 634 638 void InspectorInstrumentation::addMessageToConsoleImpl(InspectorAgent* inspectorAgent, MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID) 635 639 { 636 inspectorAgent->consoleAgent()->addMessageToConsole(source, type, level, message, lineNumber, sourceID); 640 if (InspectorConsoleAgent* consoleAgent = inspectorAgent->instrumentingAgents()->inspectorConsoleAgent()) 641 consoleAgent->addMessageToConsole(source, type, level, message, lineNumber, sourceID); 637 642 } 638 643 639 644 void InspectorInstrumentation::consoleCountImpl(InspectorAgent* inspectorAgent, PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> stack) 640 645 { 641 inspectorAgent->consoleAgent()->count(arguments, stack); 646 if (InspectorConsoleAgent* consoleAgent = inspectorAgent->instrumentingAgents()->inspectorConsoleAgent()) 647 consoleAgent->count(arguments, stack); 642 648 } 643 649 644 650 void InspectorInstrumentation::startConsoleTimingImpl(InspectorAgent* inspectorAgent, const String& title) 645 651 { 646 inspectorAgent->consoleAgent()->startTiming(title); 652 if (InspectorConsoleAgent* consoleAgent = inspectorAgent->instrumentingAgents()->inspectorConsoleAgent()) 653 consoleAgent->startTiming(title); 647 654 } 648 655 649 656 void InspectorInstrumentation::stopConsoleTimingImpl(InspectorAgent* inspectorAgent, const String& title, PassRefPtr<ScriptCallStack> stack) 650 657 { 651 inspectorAgent->consoleAgent()->stopTiming(title, stack); 658 if (InspectorConsoleAgent* consoleAgent = inspectorAgent->instrumentingAgents()->inspectorConsoleAgent()) 659 consoleAgent->stopTiming(title, stack); 652 660 } 653 661 … … 664 672 void InspectorInstrumentation::addStartProfilingMessageToConsoleImpl(InspectorAgent* inspectorAgent, const String& title, unsigned lineNumber, const String& sourceURL) 665 673 { 666 if (InspectorProfilerAgent* profilerAgent = inspectorAgent-> profilerAgent())674 if (InspectorProfilerAgent* profilerAgent = inspectorAgent->instrumentingAgents()->inspectorProfilerAgent()) 667 675 profilerAgent->addStartProfilingMessageToConsole(title, lineNumber, sourceURL); 668 676 } … … 670 678 void InspectorInstrumentation::addProfileImpl(InspectorAgent* inspectorAgent, RefPtr<ScriptProfile> profile, PassRefPtr<ScriptCallStack> callStack) 671 679 { 672 if (InspectorProfilerAgent* profilerAgent = inspectorAgent-> profilerAgent()) {680 if (InspectorProfilerAgent* profilerAgent = inspectorAgent->instrumentingAgents()->inspectorProfilerAgent()) { 673 681 const ScriptCallFrame& lastCaller = callStack->at(0); 674 682 profilerAgent->addProfile(profile, lastCaller.lineNumber(), lastCaller.sourceURL()); … … 678 686 String InspectorInstrumentation::getCurrentUserInitiatedProfileNameImpl(InspectorAgent* inspectorAgent, bool incrementProfileNumber) 679 687 { 680 if (InspectorProfilerAgent* profilerAgent = inspectorAgent-> profilerAgent())688 if (InspectorProfilerAgent* profilerAgent = inspectorAgent->instrumentingAgents()->inspectorProfilerAgent()) 681 689 return profilerAgent->getCurrentUserInitiatedProfileName(incrementProfileNumber); 682 690 return ""; … … 685 693 bool InspectorInstrumentation::profilerEnabledImpl(InspectorAgent* inspectorAgent) 686 694 { 687 return inspectorAgent->instrumentingAgents()->inspectorProfilerAgent()->enabled(); 695 if (InspectorProfilerAgent* profilerAgent = inspectorAgent->instrumentingAgents()->inspectorProfilerAgent()) 696 return profilerAgent->enabled(); 697 return false; 688 698 } 689 699 #endif … … 785 795 { 786 796 #if ENABLE(JAVASCRIPT_DEBUGGER) 787 if (InspectorDebuggerAgent* debuggerAgent = inspectorAgent-> debuggerAgent())797 if (InspectorDebuggerAgent* debuggerAgent = inspectorAgent->instrumentingAgents()->inspectorDebuggerAgent()) 788 798 debuggerAgent->cancelPauseOnNextStatement(); 789 799 #endif -
trunk/Source/WebCore/page/Page.cpp
r86047 r86327 205 205 206 206 InspectorInstrumentation::inspectedPageDestroyed(this); 207 #if ENABLE(INSPECTOR) 208 m_inspectorController->inspectedPageDestroyed(); 209 #endif 207 210 208 211 backForward()->close();
Note: See TracChangeset
for help on using the changeset viewer.