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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp

Issue 2848653003: Add a DevTools command to create an isolated world for a given frame (Closed)
Patch Set: Rebased Created 3 years, 7 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: third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
index f1c65dacf7115aa064e955e5310a1a05aaa39b28..c938a080b95f9d17ebd0ed5b1b4a36b16ac286a9 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
@@ -359,4 +359,20 @@ void ScriptController::ExecuteScriptInIsolatedWorld(
}
}
+int ScriptController::CreateNewDInspectorIsolatedWorld(
+ const String& world_name) {
+ RefPtr<DOMWrapperWorld> world = DOMWrapperWorld::Create(
+ GetIsolate(), DOMWrapperWorld::WorldType::kInspectorIsolated);
+ // Bail out if we could not create an isolated world.
+ if (!world)
+ return DOMWrapperWorld::kInvalidWorldId;
+ if (!world_name.IsEmpty()) {
+ DOMWrapperWorld::SetIsolatedWorldHumanReadableName(world->GetWorldId(),
+ world_name);
+ }
+ // Make sure the execution context exists.
+ WindowProxy(*world);
+ return world->GetWorldId();
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698