Index: third_party/WebKit/Source/platform/bindings/DOMWrapperWorld.cpp |
diff --git a/third_party/WebKit/Source/platform/bindings/DOMWrapperWorld.cpp b/third_party/WebKit/Source/platform/bindings/DOMWrapperWorld.cpp |
index 106f9d359a1550d98dddc8b8e51e0a908a22a18f..8be753948a9b43c242c2a82af4f63637bd113eb5 100644 |
--- a/third_party/WebKit/Source/platform/bindings/DOMWrapperWorld.cpp |
+++ b/third_party/WebKit/Source/platform/bindings/DOMWrapperWorld.cpp |
@@ -257,6 +257,7 @@ void DOMWrapperWorld::WeakCallbackForDOMObjectHolder( |
holder_base->World()->UnregisterDOMObjectHolder(holder_base); |
} |
+// static |
int DOMWrapperWorld::GenerateWorldIdForType(WorldType world_type) { |
DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<int>, next_world_id, |
new ThreadSpecific<int>); |
@@ -283,6 +284,21 @@ int DOMWrapperWorld::GenerateWorldIdForType(WorldType world_type) { |
return kInvalidWorldId; |
} |
+// static |
+int DOMWrapperWorld::GetNextDevToolsIsolatedWorldId() { |
+ DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<int>, |
+ next_devtools_isolatd_world_id, |
Sami
2017/05/05 09:33:14
typo: isolated
alex clarke (OOO till 29th)
2017/05/05 14:52:29
Done.
|
+ new ThreadSpecific<int>); |
+ |
+ if (!next_devtools_isolatd_world_id.IsSet()) |
+ *next_devtools_isolatd_world_id = WorldId::kDevToolsFirstIsolatedWorldId; |
+ int world_id = *next_devtools_isolatd_world_id; |
+ if (world_id > WorldId::kDevToolsLastIsolatedWorldId) |
+ return WorldId::kInvalidWorldId; |
+ *next_devtools_isolatd_world_id = world_id + 1; |
+ return world_id; |
+} |
+ |
void DOMWrapperWorld::DissociateDOMWindowWrappersInAllWorlds( |
ScriptWrappable* script_wrappable) { |
DCHECK(script_wrappable); |