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

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: Changes for Sami 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..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);

Powered by Google App Engine
This is Rietveld 408576698