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

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: Fix test 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..94e9ae8f32b869a484ae04672ff7e94b77c3106a 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
@@ -141,6 +143,11 @@ class PLATFORM_EXPORT DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
DOMObjectHolder<T>::Create(isolate, object, wrapper));
}
+ // Returns an identifier for a given world type. This must not be called for
+ // WorldType::IsolatedWorld because an identifier for the world is given from
+ // out of DOMWrapperWorld.
+ static int GenerateWorldIdForType(WorldType);
+
private:
class DOMObjectHolderBase {
USING_FAST_MALLOC(DOMObjectHolderBase);
@@ -187,10 +194,10 @@ class PLATFORM_EXPORT DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
static unsigned number_of_non_main_worlds_in_main_thread_;
- // Returns an identifier for a given world type. This must not be called for
- // WorldType::IsolatedWorld because an identifier for the world is given from
- // out of DOMWrapperWorld.
- static int GenerateWorldIdForType(WorldType);
+ // Returns an id in the range
+ // [kDevToolsFirstIsolatedWorldId, kDevToolsLastIsolatedWorldId] or
+ // kInvalidWorldId if that range has been exhausted.
+ static int GetNextDevToolsIsolatedWorldId();
pfeldman 2017/05/08 20:27:12 I would go all the way and introduce WorldType for
alex clarke (OOO till 29th) 2017/05/09 08:19:06 Done. I've also renamed all the DevTools reference
// Dissociates all wrappers in all worlds associated with |script_wrappable|.
//

Powered by Google App Engine
This is Rietveld 408576698