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

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

Issue 24989007: Model each Dart library as its own ScriptState when devtools are enabled. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 7 years, 2 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
« no previous file with comments | « Source/core/inspector/PageRuntimeAgent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/PageRuntimeAgent.cpp
diff --git a/Source/core/inspector/PageRuntimeAgent.cpp b/Source/core/inspector/PageRuntimeAgent.cpp
index c6e81e5e446df4a218d40de6f29b1fc639d78474..23a69c2262ed1000f81f5efc233c3158242aed6d 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,27 @@ void PageRuntimeAgent::reportExecutionContextCreation()
}
}
+void PageRuntimeAgent::notifyDartContextCreated(const String& frameId, ScriptState* v8ScriptState)
+{
+ 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(dartbug.com/13801): remove the check for
+ // !scriptState->isJavaScript() once Dart scripts have correct security
+ // origins.
+ 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)
« no previous file with comments | « Source/core/inspector/PageRuntimeAgent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698