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

Unified Diff: sky/engine/v8_inspector/PageScriptDebugServer.cpp

Issue 764573002: Parametrize PageScriptDebugServer with v8::Context -> InspectorHost resolver (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Removed Page::m_inspectorHost Created 6 years, 1 month 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
« no previous file with comments | « sky/engine/v8_inspector/PageScriptDebugServer.h ('k') | sky/engine/v8_inspector/inspector_backend_mojo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/v8_inspector/PageScriptDebugServer.cpp
diff --git a/sky/engine/v8_inspector/PageScriptDebugServer.cpp b/sky/engine/v8_inspector/PageScriptDebugServer.cpp
index 2b549d812a73f1656e36db0286a476ea332f9a5d..f52dfc7492539dc348708ed2942c9dc82a6099f0 100644
--- a/sky/engine/v8_inspector/PageScriptDebugServer.cpp
+++ b/sky/engine/v8_inspector/PageScriptDebugServer.cpp
@@ -161,6 +161,11 @@ void PageScriptDebugServer::setClientMessageLoop(PassOwnPtr<ClientMessageLoop> c
m_clientMessageLoop = clientMessageLoop;
}
+void PageScriptDebugServer::setInspectorHostResolver(PassOwnPtr<InspectorHostResolver> resolver)
+{
+ m_inspectorHostResolver = resolver;
+}
+
void PageScriptDebugServer::compileScript(ScriptState* scriptState, const String& expression, const String& sourceURL, String* scriptId, String* exceptionDetailsText, int* lineNumber, int* columnNumber, RefPtr<ScriptCallStack>* stackTrace)
{
ExecutionContext* executionContext = scriptState->executionContext();
@@ -193,18 +198,16 @@ void PageScriptDebugServer::runScript(ScriptState* scriptState, const String& sc
ScriptDebugListener* PageScriptDebugServer::getDebugListenerForContext(v8::Handle<v8::Context> context)
{
- v8::HandleScope scope(m_isolate);
- LocalFrame* frame = retrieveFrameWithGlobalObjectCheck(context);
- if (!frame)
+ inspector::InspectorHost* inspectorHost = m_inspectorHostResolver->inspectorHostFor(context);
+ if (!inspectorHost)
return 0;
- return m_listenersMap.get(frame->page()->inspectorHost());
+ return m_listenersMap.get(inspectorHost);
}
void PageScriptDebugServer::runMessageLoopOnPause(v8::Handle<v8::Context> context)
{
- v8::HandleScope scope(m_isolate);
- LocalFrame* frame = retrieveFrameWithGlobalObjectCheck(context);
- m_pausedHost = frame->page()->inspectorHost();
+ m_pausedHost = m_inspectorHostResolver->inspectorHostFor(context);
+ ASSERT(m_pausedHost);
// Wait for continue or step command.
m_clientMessageLoop->run(m_pausedHost);
« no previous file with comments | « sky/engine/v8_inspector/PageScriptDebugServer.h ('k') | sky/engine/v8_inspector/inspector_backend_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698