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

Unified Diff: Source/core/inspector/PageDebuggerAgent.cpp

Issue 1291613002: DevTools: make V8DebuggerAgent call Client instead of overriden methods (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changed Client to only return defaultInjectedScript 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/inspector/PageDebuggerAgent.cpp
diff --git a/Source/core/inspector/PageDebuggerAgent.cpp b/Source/core/inspector/PageDebuggerAgent.cpp
index 20cbb83a282229bf108059170e0bb0ce6f5b5873..d0128a6ab072357de514eb6f50c7477f265fed49 100644
--- a/Source/core/inspector/PageDebuggerAgent.cpp
+++ b/Source/core/inspector/PageDebuggerAgent.cpp
@@ -98,28 +98,20 @@ void PageDebuggerAgent::restore()
InspectorDebuggerAgent::restore();
}
-void PageDebuggerAgent::enable()
-{
- ASSERT(canExecuteScripts());
- InspectorDebuggerAgent::enable();
- m_instrumentingAgents->setPageDebuggerAgent(this);
-}
-
-void PageDebuggerAgent::disable()
-{
- InspectorDebuggerAgent::disable();
- m_instrumentingAgents->setPageDebuggerAgent(0);
- m_compiledScriptURLs.clear();
-}
-
void PageDebuggerAgent::startListeningV8Debugger()
{
+ ASSERT(canExecuteScripts());
m_mainThreadDebugger->addListener(this, m_pageAgent->inspectedFrame());
+ m_instrumentingAgents->setPageDebuggerAgent(this);
+ InspectorDebuggerAgent::startListeningV8Debugger();
}
void PageDebuggerAgent::stopListeningV8Debugger()
{
m_mainThreadDebugger->removeListener(this, m_pageAgent->inspectedFrame());
+ m_instrumentingAgents->setPageDebuggerAgent(nullptr);
+ m_compiledScriptURLs.clear();
+ InspectorDebuggerAgent::stopListeningV8Debugger();
}
void PageDebuggerAgent::muteConsole()
@@ -144,19 +136,10 @@ void PageDebuggerAgent::overlaySteppedOver()
stepOver(&error);
}
-InjectedScript PageDebuggerAgent::injectedScriptForEval(ErrorString* errorString, const int* executionContextId)
+InjectedScript PageDebuggerAgent::defaultInjectedScript()
{
- if (!executionContextId) {
- ScriptState* scriptState = ScriptState::forMainWorld(m_pageAgent->inspectedFrame());
- InjectedScript result = injectedScriptManager()->injectedScriptFor(scriptState);
- if (result.isEmpty())
- *errorString = "Internal error: main world execution context not found.";
- return result;
- }
- InjectedScript injectedScript = injectedScriptManager()->injectedScriptForId(*executionContextId);
- if (injectedScript.isEmpty())
- *errorString = "Execution context with given id not found.";
- return injectedScript;
+ ScriptState* scriptState = ScriptState::forMainWorld(m_pageAgent->inspectedFrame());
+ return injectedScriptManager()->injectedScriptFor(scriptState);
}
void PageDebuggerAgent::didStartProvisionalLoad(LocalFrame* frame)

Powered by Google App Engine
This is Rietveld 408576698