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

Unified Diff: Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp

Issue 1532413002: Added Dartium changes onto 45.0.2454.104 (Closed) Base URL: http://src.chromium.org/blink/branches/chromium/2454
Patch Set: Created 5 years 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/bindings/core/dart/shared_lib/DartNativeExtensionsWin.cpp ('k') | Source/bindings/dart/.gitignore » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp
diff --git a/Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp b/Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp
index 62eb9617eb42a65560c8cb1c59fdf374b6ecc670..32cd50b5fdb35a9413d65352e5f5d4c7f4e9c15c 100644
--- a/Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp
+++ b/Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp
@@ -58,6 +58,13 @@ ScriptValue InjectedScriptManager::createInjectedScript(const String& scriptSour
if (scriptHostWrapper.IsEmpty())
return ScriptValue();
+ // Store the inspectedScriptState on the scriptHostWrapper if it is
+ // different from the ScriptState associated with the context.
+ // This is needed to support Dart as Dart does not create a separate V8
+ // context for every Dart library.
+ if (inspectedScriptState != ScriptState::from(inspectedScriptState->context()))
+ V8HiddenValue::setHiddenValue(isolate, scriptHostWrapper, V8HiddenValue::scriptState(isolate), v8::External::New(isolate, inspectedScriptState));
+
injectedScriptNative->setOnInjectedScriptHost(scriptHostWrapper);
// Inject javascript into the context. The compiled script is supposed to evaluate into
« no previous file with comments | « Source/bindings/core/dart/shared_lib/DartNativeExtensionsWin.cpp ('k') | Source/bindings/dart/.gitignore » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698