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..e420210dd9ac8cde6949acf79090fae3da368a84 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp |
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp |
@@ -359,4 +359,19 @@ void ScriptController::ExecuteScriptInIsolatedWorld( |
} |
} |
+int ScriptController::CreateNewDevToolsIsolatedWorld(const String& world_name) { |
+ int world_id = DOMWrapperWorld::GetNextDevToolsIsolatedWorldId(); |
+ // Bail out if we could not allocate an id. |
+ if (world_id == DOMWrapperWorld::kInvalidWorldId) |
+ return DOMWrapperWorld::kInvalidWorldId; |
+ |
+ RefPtr<DOMWrapperWorld> world = |
+ DOMWrapperWorld::EnsureIsolatedWorld(GetIsolate(), world_id); |
+ |
+ DOMWrapperWorld::SetIsolatedWorldHumanReadableName(world_id, world_name); |
+ // Make sure the execution context exists. |
+ WindowProxy(*world); |
+ return world_id; |
+} |
+ |
} // namespace blink |