Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: Source/core/inspector/PageDebuggerAgent.cpp

Issue 1286343003: DevTools: make InspectorDebuggerAgent aggregate V8DebuggerAgent instead of inheriting (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed presubmit errors Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 void PageDebuggerAgent::overlaySteppedOver() 130 void PageDebuggerAgent::overlaySteppedOver()
131 { 131 {
132 ErrorString error; 132 ErrorString error;
133 stepOver(&error); 133 stepOver(&error);
134 } 134 }
135 135
136 InjectedScript PageDebuggerAgent::defaultInjectedScript() 136 InjectedScript PageDebuggerAgent::defaultInjectedScript()
137 { 137 {
138 ScriptState* scriptState = ScriptState::forMainWorld(m_pageAgent->inspectedF rame()); 138 ScriptState* scriptState = ScriptState::forMainWorld(m_pageAgent->inspectedF rame());
139 return injectedScriptManager()->injectedScriptFor(scriptState); 139 return m_debuggerAgent->injectedScriptManager()->injectedScriptFor(scriptSta te);
140 } 140 }
141 141
142 void PageDebuggerAgent::didStartProvisionalLoad(LocalFrame* frame) 142 void PageDebuggerAgent::didStartProvisionalLoad(LocalFrame* frame)
143 { 143 {
144 if (frame == m_pageAgent->inspectedFrame()) { 144 if (frame == m_pageAgent->inspectedFrame()) {
145 ErrorString error; 145 ErrorString error;
146 resume(&error); 146 resume(&error);
147 } 147 }
148 } 148 }
149 149
150 void PageDebuggerAgent::didClearDocumentOfWindowObject(LocalFrame* frame) 150 void PageDebuggerAgent::didClearDocumentOfWindowObject(LocalFrame* frame)
151 { 151 {
152 // FIXME: what about nested objects? 152 // FIXME: what about nested objects?
153 if (frame != m_pageAgent->inspectedFrame()) 153 if (frame != m_pageAgent->inspectedFrame())
154 return; 154 return;
155 reset(); 155 m_debuggerAgent->reset();
156 } 156 }
157 157
158 void PageDebuggerAgent::didCommitLoadForLocalFrame(LocalFrame*) 158 void PageDebuggerAgent::didCommitLoadForLocalFrame(LocalFrame*)
159 { 159 {
160 resetModifiedSources(); 160 m_debuggerAgent->resetModifiedSources();
161 } 161 }
162 162
163 void PageDebuggerAgent::compileScript(ErrorString* errorString, const String& ex pression, const String& sourceURL, bool persistScript, const int* executionConte xtId, TypeBuilder::OptOutput<ScriptId>* scriptId, RefPtr<ExceptionDetails>& exce ptionDetails) 163 void PageDebuggerAgent::compileScript(ErrorString* errorString, const String& ex pression, const String& sourceURL, bool persistScript, const int* executionConte xtId, TypeBuilder::OptOutput<ScriptId>* scriptId, RefPtr<ExceptionDetails>& exce ptionDetails)
164 { 164 {
165 InjectedScript injectedScript = injectedScriptForEval(errorString, execution ContextId); 165 InjectedScript injectedScript = m_debuggerAgent->injectedScriptForEval(error String, executionContextId);
166 if (injectedScript.isEmpty()) { 166 if (injectedScript.isEmpty()) {
167 *errorString = "Inspected frame has gone"; 167 *errorString = "Inspected frame has gone";
168 return; 168 return;
169 } 169 }
170 ExecutionContext* executionContext = injectedScript.scriptState()->execution Context(); 170 ExecutionContext* executionContext = injectedScript.scriptState()->execution Context();
171 RefPtrWillBeRawPtr<LocalFrame> protect(toDocument(executionContext)->frame() ); 171 RefPtrWillBeRawPtr<LocalFrame> protect(toDocument(executionContext)->frame() );
172 InspectorDebuggerAgent::compileScript(errorString, expression, sourceURL, pe rsistScript, executionContextId, scriptId, exceptionDetails); 172 InspectorDebuggerAgent::compileScript(errorString, expression, sourceURL, pe rsistScript, executionContextId, scriptId, exceptionDetails);
173 if (!scriptId->isAssigned()) 173 if (!scriptId->isAssigned())
174 return; 174 return;
175 175
176 String scriptIdValue = scriptId->getValue(); 176 String scriptIdValue = scriptId->getValue();
177 if (!scriptIdValue.isEmpty()) 177 if (!scriptIdValue.isEmpty())
178 m_compiledScriptURLs.set(scriptId->getValue(), sourceURL); 178 m_compiledScriptURLs.set(scriptId->getValue(), sourceURL);
179 } 179 }
180 180
181 void PageDebuggerAgent::runScript(ErrorString* errorString, const ScriptId& scri ptId, const int* executionContextId, const String* const objectGroup, const bool * const doNotPauseOnExceptionsAndMuteConsole, RefPtr<RemoteObject>& result, RefP tr<ExceptionDetails>& exceptionDetails) 181 void PageDebuggerAgent::runScript(ErrorString* errorString, const ScriptId& scri ptId, const int* executionContextId, const String* const objectGroup, const bool * const doNotPauseOnExceptionsAndMuteConsole, RefPtr<RemoteObject>& result, RefP tr<ExceptionDetails>& exceptionDetails)
182 { 182 {
183 InjectedScript injectedScript = injectedScriptForEval(errorString, execution ContextId); 183 InjectedScript injectedScript = m_debuggerAgent->injectedScriptForEval(error String, executionContextId);
184 if (injectedScript.isEmpty()) { 184 if (injectedScript.isEmpty()) {
185 *errorString = "Inspected frame has gone"; 185 *errorString = "Inspected frame has gone";
186 return; 186 return;
187 } 187 }
188 ExecutionContext* executionContext = injectedScript.scriptState()->execution Context(); 188 ExecutionContext* executionContext = injectedScript.scriptState()->execution Context();
189 189
190 String sourceURL = m_compiledScriptURLs.take(scriptId); 190 String sourceURL = m_compiledScriptURLs.take(scriptId);
191 LocalFrame* frame = toDocument(executionContext)->frame(); 191 LocalFrame* frame = toDocument(executionContext)->frame();
192 TRACE_EVENT1("devtools.timeline", "EvaluateScript", "data", InspectorEvaluat eScriptEvent::data(frame, sourceURL, TextPosition::minimumPosition().m_line.oneB asedInt())); 192 TRACE_EVENT1("devtools.timeline", "EvaluateScript", "data", InspectorEvaluat eScriptEvent::data(frame, sourceURL, TextPosition::minimumPosition().m_line.oneB asedInt()));
193 InspectorInstrumentationCookie cookie; 193 InspectorInstrumentationCookie cookie;
194 if (frame) 194 if (frame)
195 cookie = InspectorInstrumentation::willEvaluateScript(frame, sourceURL, TextPosition::minimumPosition().m_line.oneBasedInt()); 195 cookie = InspectorInstrumentation::willEvaluateScript(frame);
196 196
197 RefPtrWillBeRawPtr<LocalFrame> protect(frame); 197 RefPtrWillBeRawPtr<LocalFrame> protect(frame);
198 InspectorDebuggerAgent::runScript(errorString, scriptId, executionContextId, objectGroup, doNotPauseOnExceptionsAndMuteConsole, result, exceptionDetails); 198 InspectorDebuggerAgent::runScript(errorString, scriptId, executionContextId, objectGroup, doNotPauseOnExceptionsAndMuteConsole, result, exceptionDetails);
199 199
200 if (frame) 200 if (frame)
201 InspectorInstrumentation::didEvaluateScript(cookie); 201 InspectorInstrumentation::didEvaluateScript(cookie);
202 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Update Counters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::data( )); 202 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Update Counters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::data( ));
203 203
204 } 204 }
205 205
206 } // namespace blink 206 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698