| Index: sky/engine/bindings/core/v8/DOMWrapperWorld.h
|
| diff --git a/sky/engine/bindings/core/v8/DOMWrapperWorld.h b/sky/engine/bindings/core/v8/DOMWrapperWorld.h
|
| index cbba11619e0200bf4dd0506ea34a1c1befbca8f3..c6d1a1e347cfa86fd228a4b86c16f08f579f7b3d 100644
|
| --- a/sky/engine/bindings/core/v8/DOMWrapperWorld.h
|
| +++ b/sky/engine/bindings/core/v8/DOMWrapperWorld.h
|
| @@ -46,27 +46,19 @@ class DOMDataStore;
|
| class ExecutionContext;
|
| class ScriptController;
|
|
|
| -enum WorldIdConstants {
|
| - MainWorldId = 0,
|
| - // Embedder isolated worlds can use IDs in [1, 1<<29).
|
| - EmbedderWorldIdLimit = (1 << 29),
|
| - IsolatedWorldIdLimit,
|
| - TestingWorldId,
|
| +enum FakeWorldMarker {
|
| + MainWorld,
|
| + FakeWorld, // Used by garbage collection and testing, not sure why.
|
| };
|
|
|
| // This class represent a collection of DOM wrappers for a specific world.
|
| class DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
|
| public:
|
| - static PassRefPtr<DOMWrapperWorld> create(int worldId = -1, int extensionGroup = -1);
|
| + static PassRefPtr<DOMWrapperWorld> create(FakeWorldMarker);
|
|
|
| - static const int mainWorldExtensionGroup = 0;
|
| - static PassRefPtr<DOMWrapperWorld> ensureIsolatedWorld(int worldId, int extensionGroup);
|
| ~DOMWrapperWorld();
|
| void dispose();
|
|
|
| - static bool isolatedWorldsExist() { return isolatedWorldCount; }
|
| - static void allWorldsInMainThread(Vector<RefPtr<DOMWrapperWorld> >& worlds);
|
| -
|
| static DOMWrapperWorld& world(v8::Handle<v8::Context> context)
|
| {
|
| return ScriptState::from(context)->world();
|
| @@ -86,14 +78,8 @@ public:
|
|
|
| static DOMWrapperWorld& mainWorld();
|
|
|
| - static void setIsolatedWorldHumanReadableName(int worldID, const String&);
|
| - String isolatedWorldHumanReadableName();
|
| -
|
| - bool isMainWorld() const { return m_worldId == MainWorldId; }
|
| - bool isIsolatedWorld() const { return MainWorldId < m_worldId && m_worldId < IsolatedWorldIdLimit; }
|
| + bool isMainWorld() const { return !m_isFakeWorld; }
|
|
|
| - int worldId() const { return m_worldId; }
|
| - int extensionGroup() const { return m_extensionGroup; }
|
| DOMDataStore& domDataStore() const { return *m_domDataStore; }
|
|
|
| static void setWorldOfInitializingWindow(DOMWrapperWorld* world)
|
| @@ -152,7 +138,7 @@ public:
|
| }
|
|
|
| private:
|
| - DOMWrapperWorld(int worldId, int extensionGroup);
|
| + DOMWrapperWorld(FakeWorldMarker);
|
|
|
| static void weakCallbackForDOMObjectHolder(const v8::WeakCallbackData<v8::Value, DOMObjectHolderBase>&);
|
| void registerDOMObjectHolderInternal(PassOwnPtr<DOMObjectHolderBase>);
|
| @@ -161,8 +147,7 @@ private:
|
| static unsigned isolatedWorldCount;
|
| static DOMWrapperWorld* worldOfInitializingWindow;
|
|
|
| - const int m_worldId;
|
| - const int m_extensionGroup;
|
| + bool m_isFakeWorld;
|
| OwnPtr<DOMDataStore> m_domDataStore;
|
| HashSet<OwnPtr<DOMObjectHolderBase> > m_domObjectHolders;
|
| };
|
|
|