Index: Source/core/inspector/PageRuntimeAgent.cpp |
diff --git a/Source/core/inspector/PageRuntimeAgent.cpp b/Source/core/inspector/PageRuntimeAgent.cpp |
index c6e81e5e446df4a218d40de6f29b1fc639d78474..67f94a87112742da8661046f22f94d3f723b208d 100644 |
--- a/Source/core/inspector/PageRuntimeAgent.cpp |
+++ b/Source/core/inspector/PageRuntimeAgent.cpp |
@@ -31,6 +31,7 @@ |
#include "config.h" |
#include "core/inspector/PageRuntimeAgent.h" |
+#include "bindings/dart/DartController.h" |
#include "bindings/v8/DOMWrapperWorld.h" |
#include "bindings/v8/ScriptController.h" |
#include "core/inspector/InjectedScript.h" |
@@ -168,6 +169,8 @@ void PageRuntimeAgent::reportExecutionContextCreation() |
ScriptState* scriptState = mainWorldScriptState(frame); |
notifyContextCreated(frameId, scriptState, 0, true); |
+ notifyDartContextCreated(frameId, scriptState); |
+ |
frame->script()->collectIsolatedContexts(isolatedContexts); |
if (isolatedContexts.isEmpty()) |
continue; |
@@ -177,11 +180,25 @@ void PageRuntimeAgent::reportExecutionContextCreation() |
} |
} |
+void PageRuntimeAgent::notifyDartContextCreated(const String& frameId, ScriptState* v8ScriptState) |
+{ |
vsm
2013/10/03 17:59:31
Is the runtime type of v8ScriptState a ScriptState
jacob314
2013/10/03 20:43:15
Unfortunately the runtime type of v8ScriptState is
|
+ ScriptExecutionContext* scriptExecutionContext = v8ScriptState->scriptExecutionContext(); |
+ DartController* dartController = DartController::retrieve(scriptExecutionContext); |
+ if (dartController) { |
+ Vector<ScriptState*> scriptStates; |
+ dartController->collectScriptStates(v8ScriptState, scriptStates); |
+ for (size_t i = 0; i< scriptStates.size(); i++) |
+ notifyContextCreated(frameId, scriptStates[i], 0, false); |
+ } |
+} |
+ |
void PageRuntimeAgent::notifyContextCreated(const String& frameId, ScriptState* scriptState, SecurityOrigin* securityOrigin, bool isPageContext) |
{ |
- ASSERT(securityOrigin || isPageContext); |
+ // FIXME: should Dart scripts have a security origin? |
vsm
2013/10/03 17:59:31
I think so. Can you file a bug on this?
jacob314
2013/10/03 20:43:15
updated comment and filed a bug.
dartbug.com/13801
|
+ ASSERT(securityOrigin || isPageContext || !scriptState->isJavaScript()); |
int executionContextId = injectedScriptManager()->injectedScriptIdFor(scriptState); |
- String name = securityOrigin ? securityOrigin->toRawString() : ""; |
+ String name = scriptState->name() ? *scriptState->name() : (securityOrigin ? securityOrigin->toRawString() : ""); |
+ |
m_frontend->executionContextCreated(ExecutionContextDescription::create() |
.setId(executionContextId) |
.setIsPageContext(isPageContext) |