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

Unified Diff: third_party/WebKit/Source/platform/bindings/DOMWrapperWorld.h

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/platform/bindings/DOMWrapperWorld.h
diff --git a/third_party/WebKit/Source/platform/bindings/DOMWrapperWorld.h b/third_party/WebKit/Source/platform/bindings/DOMWrapperWorld.h
index a8cff87dc798b3ec1f43831f7f32448ffc6a5d39..fece5d71420841009c4097248af9c83586345dd5 100644
--- a/third_party/WebKit/Source/platform/bindings/DOMWrapperWorld.h
+++ b/third_party/WebKit/Source/platform/bindings/DOMWrapperWorld.h
@@ -59,6 +59,8 @@ class PLATFORM_EXPORT DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
// Embedder isolated worlds can use IDs in [1, 1<<29).
kEmbedderWorldIdLimit = (1 << 29),
kDocumentXMLTreeViewerWorldId,
+ kDevToolsFirstIsolatedWorldId,
+ kDevToolsLastIsolatedWorldId = kDevToolsFirstIsolatedWorldId + 100,
kIsolatedWorldIdLimit,
// Other worlds can use IDs after this. Don't manually pick up an ID from
@@ -69,13 +71,15 @@ class PLATFORM_EXPORT DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
enum class WorldType {
kMain,
kIsolated,
+ kInspectorIsolated,
kGarbageCollector,
kRegExp,
kTesting,
kWorker,
};
- // Creates a world other than IsolatedWorld.
+ // Creates a world other than IsolatedWorld. Note this can return nullptr if
+ // GenerateWorldIdForType fails to allocate a valid id.
static PassRefPtr<DOMWrapperWorld> Create(v8::Isolate*, WorldType);
// Ensures an IsolatedWorld for |worldId|.
@@ -128,7 +132,10 @@ class PLATFORM_EXPORT DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
bool IsMainWorld() const { return world_type_ == WorldType::kMain; }
bool IsWorkerWorld() const { return world_type_ == WorldType::kWorker; }
- bool IsIsolatedWorld() const { return world_type_ == WorldType::kIsolated; }
+ bool IsIsolatedWorld() const {
+ return world_type_ == WorldType::kIsolated ||
+ world_type_ == WorldType::kInspectorIsolated;
+ }
int GetWorldId() const { return world_id_; }
DOMDataStore& DomDataStore() const { return *dom_data_store_; }

Powered by Google App Engine
This is Rietveld 408576698