Chromium Code Reviews| 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..fc2bd7b308be6da73a29ba92f9273d4c32a3dbad 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 + 10, |
|
pfeldman
2017/05/05 15:40:24
10 worlds should be enough for everyone? :) Can we
caseq
2017/05/05 16:36:02
+1, I can imagine an easy scenario for leaking the
alex clarke (OOO till 29th)
2017/05/05 19:29:44
Done.
alex clarke (OOO till 29th)
2017/05/05 19:29:44
Done.
|
| 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 id in the range |
| + // [kDevToolsFirstIsolatedWorldId, kDevToolsLastIsolatedWorldId] or |
| + // kInvalidWorldId if that range has been exhausted. |
| + static int GetNextDevToolsIsolatedWorldId(); |
| + |
| private: |
| class DOMObjectHolderBase { |
| USING_FAST_MALLOC(DOMObjectHolderBase); |