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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp

Issue 2848653003: Add a DevTools command to create an isolated world for a given frame (Closed)
Patch Set: Changed so we don't pass in the id Created 3 years, 8 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/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..bc96fc0ed5c92fac9e34167e14c1bb6db5c36feb 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
@@ -901,6 +901,26 @@ Response InspectorPageAgent::getLayoutMetrics(
return Response::OK();
}
+protocol::Response InspectorPageAgent::createIsolatedWorld(
+ const String& frame_id,
+ const String& world_name,
+ Maybe<bool> grant_universal_access) {
+ LocalFrame* frame =
+ IdentifiersFactory::FrameById(inspected_frames_, frame_id);
+ if (!frame)
+ return Response::Error("No frame for given id found");
+
+ int world_id =
+ frame->GetScriptController().CreateNewIsolatedWorld(world_name);
+ if (grant_universal_access.fromMaybe(false)) {
+ RefPtr<SecurityOrigin> security_origin =
+ frame->GetSecurityContext()->GetSecurityOrigin()->IsolatedCopy();
+ security_origin->GrantUniversalAccess();
+ DOMWrapperWorld::SetIsolatedWorldSecurityOrigin(world_id, security_origin);
+ }
+ return Response::OK();
+}
+
DEFINE_TRACE(InspectorPageAgent) {
visitor->Trace(inspected_frames_);
visitor->Trace(inspector_resource_content_loader_);

Powered by Google App Engine
This is Rietveld 408576698