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|. |
// |