Index: third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp |
diff --git a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp |
index 2e2a503fdbf466bfff7842f56f5207405c426db9..51961dfbe12472a4a9851940227f546c66b804d4 100644 |
--- a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp |
+++ b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp |
@@ -901,6 +901,34 @@ Response InspectorPageAgent::getLayoutMetrics( |
return Response::OK(); |
} |
+protocol::Response InspectorPageAgent::ensureIsolatedWorld( |
+ const String& frame_id, |
+ int world_id, |
+ Maybe<String> security_origin, |
+ Maybe<String> content_security_policy) { |
+ LocalFrame* frame = |
+ IdentifiersFactory::FrameById(inspected_frames_, frame_id); |
+ if (!frame) |
+ return Response::Error("No frame for given id found"); |
+ |
+ if (world_id <= DOMWrapperWorld::kMainWorldId || |
+ world_id >= DOMWrapperWorld::kEmbedderWorldIdLimit) { |
+ return Response::Error("Invalid worldId"); |
+ } |
+ |
+ frame->GetScriptController().EnsureIsolatedWorld(world_id); |
+ if (security_origin.isJust()) { |
+ DOMWrapperWorld::SetIsolatedWorldSecurityOrigin( |
+ world_id, SecurityOrigin::CreateFromString(security_origin.fromJust())); |
+ } |
+ |
+ if (content_security_policy.isJust()) { |
+ DOMWrapperWorld::SetIsolatedWorldContentSecurityPolicy( |
+ world_id, content_security_policy.fromJust()); |
+ } |
+ return Response::OK(); |
+} |
+ |
DEFINE_TRACE(InspectorPageAgent) { |
visitor->Trace(inspected_frames_); |
visitor->Trace(inspector_resource_content_loader_); |