| Index: third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp b/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp
|
| index 3d23c73d43c297bb6ea06936628761ccf5e5eb31..42cc28e39e6d35283cca55684adbe7f8abb3752e 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp
|
| @@ -30,6 +30,7 @@
|
|
|
| #include "bindings/core/v8/DOMWrapperWorld.h"
|
|
|
| +#include <memory>
|
| #include "bindings/core/v8/DOMDataStore.h"
|
| #include "bindings/core/v8/ScriptController.h"
|
| #include "bindings/core/v8/V8Binding.h"
|
| @@ -42,7 +43,6 @@
|
| #include "wtf/HashTraits.h"
|
| #include "wtf/PtrUtil.h"
|
| #include "wtf/StdLibExtras.h"
|
| -#include <memory>
|
|
|
| namespace blink {
|
|
|
| @@ -81,7 +81,7 @@ class DOMObjectHolder : public DOMObjectHolderBase {
|
| Persistent<T> m_object;
|
| };
|
|
|
| -unsigned DOMWrapperWorld::isolatedWorldCount = 0;
|
| +unsigned DOMWrapperWorld::s_numberOfNonMainWorldsInMainThread = 0;
|
|
|
| PassRefPtr<DOMWrapperWorld> DOMWrapperWorld::create(v8::Isolate* isolate,
|
| int worldId) {
|
| @@ -95,6 +95,8 @@ DOMWrapperWorld::DOMWrapperWorld(v8::Isolate* isolate, int worldId)
|
| if (worldId == WorkerWorldId) {
|
| workerWorld() = this;
|
| }
|
| + if (worldId != MainWorldId && isMainThread())
|
| + s_numberOfNonMainWorldsInMainThread++;
|
| }
|
|
|
| DOMWrapperWorld& DOMWrapperWorld::mainWorld() {
|
| @@ -167,6 +169,9 @@ DOMWrapperWorld::~DOMWrapperWorld() {
|
|
|
| dispose();
|
|
|
| + if (isMainThread())
|
| + s_numberOfNonMainWorldsInMainThread--;
|
| +
|
| if (!isIsolatedWorld())
|
| return;
|
|
|
| @@ -179,7 +184,6 @@ DOMWrapperWorld::~DOMWrapperWorld() {
|
| ASSERT(it->value == this);
|
|
|
| map.remove(it);
|
| - isolatedWorldCount--;
|
| }
|
|
|
| void DOMWrapperWorld::dispose() {
|
| @@ -210,7 +214,6 @@ PassRefPtr<DOMWrapperWorld> DOMWrapperWorld::ensureIsolatedWorld(
|
|
|
| world = DOMWrapperWorld::create(isolate, worldId);
|
| result.storedValue->value = world.get();
|
| - isolatedWorldCount++;
|
| return world.release();
|
| }
|
|
|
|
|