[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
weinig at apple.com
weinig at apple.com
Wed Mar 17 18:26:38 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 3a751dcc8f836289629a25bc9bf522b6d5fa0347
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sun Mar 7 00:38:12 2010 +0000
Rubber-stamped by Dan Bernstein.
Move DOMObjectHashTableMap, DOMWrapperWorld and WebCoreJSClientData into
their own files.
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/DOMObjectHashTableMap.cpp: Copied from bindings/js/JSDOMBinding.cpp.
* bindings/js/DOMObjectHashTableMap.h: Copied from bindings/js/JSDOMBinding.h.
(WebCore::DOMObjectHashTableMap::~DOMObjectHashTableMap):
(WebCore::DOMObjectHashTableMap::get):
* bindings/js/DOMWrapperWorld.cpp: Copied from bindings/js/JSDOMBinding.cpp.
(WebCore::forgetWorldOfDOMNodesForDocument):
* bindings/js/DOMWrapperWorld.h: Copied from bindings/js/JSDOMBinding.h.
(WebCore::DOMWrapperWorld::create):
(WebCore::DOMWrapperWorld::rememberDocument):
(WebCore::DOMWrapperWorld::forgetDocument):
(WebCore::DOMWrapperWorld::isNormal):
(WebCore::debuggerWorld):
(WebCore::pluginWorld):
(WebCore::currentWorld):
(WebCore::Document::getWrapperCache):
* bindings/js/JSDOMBinding.cpp:
* bindings/js/JSDOMBinding.h:
* bindings/js/JSDOMWindowBase.cpp:
* bindings/js/ScriptController.cpp:
* bindings/js/WebCoreJSClientData.h: Copied from bindings/js/JSDOMBinding.h.
(WebCore::WebCoreJSClientData::WebCoreJSClientData):
(WebCore::WebCoreJSClientData::~WebCoreJSClientData):
(WebCore::WebCoreJSClientData::normalWorld):
(WebCore::WebCoreJSClientData::getAllWorlds):
(WebCore::WebCoreJSClientData::rememberWorld):
(WebCore::WebCoreJSClientData::forgetWorld):
* bindings/js/WorkerScriptController.cpp:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55631 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8b90fed..551f54d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,43 @@
+2010-03-06 Sam Weinig <sam at webkit.org>
+
+ Rubber-stamped by Dan Bernstein.
+
+ Move DOMObjectHashTableMap, DOMWrapperWorld and WebCoreJSClientData into
+ their own files.
+
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/DOMObjectHashTableMap.cpp: Copied from bindings/js/JSDOMBinding.cpp.
+ * bindings/js/DOMObjectHashTableMap.h: Copied from bindings/js/JSDOMBinding.h.
+ (WebCore::DOMObjectHashTableMap::~DOMObjectHashTableMap):
+ (WebCore::DOMObjectHashTableMap::get):
+ * bindings/js/DOMWrapperWorld.cpp: Copied from bindings/js/JSDOMBinding.cpp.
+ (WebCore::forgetWorldOfDOMNodesForDocument):
+ * bindings/js/DOMWrapperWorld.h: Copied from bindings/js/JSDOMBinding.h.
+ (WebCore::DOMWrapperWorld::create):
+ (WebCore::DOMWrapperWorld::rememberDocument):
+ (WebCore::DOMWrapperWorld::forgetDocument):
+ (WebCore::DOMWrapperWorld::isNormal):
+ (WebCore::debuggerWorld):
+ (WebCore::pluginWorld):
+ (WebCore::currentWorld):
+ (WebCore::Document::getWrapperCache):
+ * bindings/js/JSDOMBinding.cpp:
+ * bindings/js/JSDOMBinding.h:
+ * bindings/js/JSDOMWindowBase.cpp:
+ * bindings/js/ScriptController.cpp:
+ * bindings/js/WebCoreJSClientData.h: Copied from bindings/js/JSDOMBinding.h.
+ (WebCore::WebCoreJSClientData::WebCoreJSClientData):
+ (WebCore::WebCoreJSClientData::~WebCoreJSClientData):
+ (WebCore::WebCoreJSClientData::normalWorld):
+ (WebCore::WebCoreJSClientData::getAllWorlds):
+ (WebCore::WebCoreJSClientData::rememberWorld):
+ (WebCore::WebCoreJSClientData::forgetWorld):
+ * bindings/js/WorkerScriptController.cpp:
+
2010-03-06 Dan Bernstein <mitz at apple.com>
Rubber-stamped by Sam Weinig.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 4fa66af..43bbffe 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -344,6 +344,10 @@ webcore_sources += \
WebCore/accessibility/AccessibilityTableRow.cpp \
WebCore/accessibility/AccessibilityTableRow.h \
WebCore/bindings/js/CachedScriptSourceProvider.h \
+ WebCore/bindings/js/DOMObjectHashTableMap.cpp \
+ WebCore/bindings/js/DOMObjectHashTableMap.h \
+ WebCore/bindings/js/DOMWrapperWorld.cpp \
+ WebCore/bindings/js/DOMWrapperWorld.h \
WebCore/bindings/js/GCController.cpp \
WebCore/bindings/js/GCController.h \
WebCore/bindings/js/JSAttrCustom.cpp \
@@ -507,6 +511,7 @@ webcore_sources += \
WebCore/bindings/js/SerializedScriptValue.cpp \
WebCore/bindings/js/SerializedScriptValue.h \
WebCore/bindings/js/StringSourceProvider.h \
+ WebCore/bindings/js/WebCoreJSClientData.h \
WebCore/bindings/ScriptControllerBase.cpp \
WebCore/bridge/Bridge.h \
WebCore/bridge/IdentifierRep.cpp \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 3dec86e..2b04481 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -462,6 +462,10 @@
'bindings/generic/RuntimeEnabledFeatures.h',
'bindings/js/CachedScriptSourceProvider.h',
'bindings/js/DOMObjectWithSVGContext.h',
+ 'bindings/js/DOMObjectHashTableMap.cpp',
+ 'bindings/js/DOMObjectHashTableMap.h',
+ 'bindings/js/DOMWrapperWorld.cpp',
+ 'bindings/js/DOMWrapperWorld.h',
'bindings/js/GCController.cpp',
'bindings/js/GCController.h',
'bindings/js/JSCallbackData.cpp',
@@ -659,6 +663,7 @@
'bindings/js/ScriptValue.h',
'bindings/js/ScriptWrappable.h',
'bindings/js/StringSourceProvider.h',
+ 'bindings/js/WebCoreJSClientData.h',
'bindings/js/WorkerScriptController.cpp',
'bindings/js/WorkerScriptController.h',
'bindings/ScriptControllerBase.cpp',
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index ecaff3d..b498673 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -266,6 +266,8 @@ SOURCES += \
accessibility/AccessibilityTableRow.cpp \
accessibility/AXObjectCache.cpp \
bindings/js/GCController.cpp \
+ bindings/js/DOMObjectHashTableMap.cpp \
+ bindings/js/DOMWrapperWorld.cpp \
bindings/js/JSCallbackData.cpp \
bindings/js/JSAttrCustom.cpp \
bindings/js/JSCDATASectionCustom.cpp \
@@ -1001,6 +1003,8 @@ HEADERS += \
accessibility/AXObjectCache.h \
bindings/js/CachedScriptSourceProvider.h \
bindings/js/GCController.h \
+ bindings/js/DOMObjectHashTableMap.h \
+ bindings/js/DOMWrapperWorld.h \
bindings/js/JSCallbackData.h \
bindings/js/JSAudioConstructor.h \
bindings/js/JSCSSStyleDeclarationCustom.h \
@@ -1063,6 +1067,7 @@ HEADERS += \
bindings/js/ScriptWrappable.h \
bindings/js/SerializedScriptValue.h \
bindings/js/StringSourceProvider.h \
+ bindings/js/WebCoreJSClientData.h \
bindings/js/WorkerScriptController.h \
bridge/Bridge.h \
bridge/c/CRuntimeObject.h \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 81a552a..6e5ff35 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -34208,10 +34208,26 @@
>
</File>
<File
+ RelativePath="..\bindings\js\DOMObjectHashTableMap.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\DOMObjectHashTableMap.h"
+ >
+ </File>
+ <File
RelativePath="..\bindings\js\DOMObjectWithSVGContext.h"
>
</File>
<File
+ RelativePath="..\bindings\js\DOMWrapperWorld.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\DOMWrapperWorld.h"
+ >
+ </File>
+ <File
RelativePath="..\bindings\js\GCController.cpp"
>
<FileConfiguration
@@ -40632,6 +40648,10 @@
>
</File>
<File
+ RelativePath="..\bindings\js\WebCoreJSClientData.h"
+ >
+ </File>
+ <File
RelativePath="..\bindings\js\WorkerScriptController.cpp"
>
<FileConfiguration
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index c46545f..629b8ad 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -3200,7 +3200,6 @@
A8EA800C0A19516E00A8EF5F /* StyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA80040A19516E00A8EF5F /* StyleSheet.h */; };
A8EA800D0A19516E00A8EF5F /* StyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA80050A19516E00A8EF5F /* StyleSheet.cpp */; };
A8EA800E0A19516E00A8EF5F /* MediaList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA80060A19516E00A8EF5F /* MediaList.h */; };
- A8EDB03D1016849400FE8113 /* DOMObjectWithSVGContext.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EDB03C1016849400FE8113 /* DOMObjectWithSVGContext.h */; };
A8F46A840CB20A9D003A9670 /* DOMSVGClipPathElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 8503612C0ACE007B001F3D9E /* DOMSVGClipPathElement.h */; };
A8F46A880CB20A9D003A9670 /* DOMSVGGradientElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85C9A2EC0AD7E90300FBFF1E /* DOMSVGGradientElement.h */; };
A8F46A890CB20A9D003A9670 /* DOMSVGAnimateColorElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 850361280ACE007B001F3D9E /* DOMSVGAnimateColorElement.h */; };
@@ -4259,6 +4258,11 @@
BC53C6080DA56C570021EB5D /* Gradient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC53C6070DA56C570021EB5D /* Gradient.cpp */; };
BC53C60B0DA56CF10021EB5D /* GradientCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC53C60A0DA56CF10021EB5D /* GradientCG.cpp */; };
BC53C6920DA591140021EB5D /* CSSGradientValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC53C6910DA591140021EB5D /* CSSGradientValue.h */; };
+ BC53D911114310CC000D817E /* WebCoreJSClientData.h in Headers */ = {isa = PBXBuildFile; fileRef = BC53D910114310CC000D817E /* WebCoreJSClientData.h */; };
+ BC53DA2E1143121E000D817E /* DOMWrapperWorld.h in Headers */ = {isa = PBXBuildFile; fileRef = BC53DA2D1143121E000D817E /* DOMWrapperWorld.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ BC53DA481143134D000D817E /* DOMWrapperWorld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC53DA471143134D000D817E /* DOMWrapperWorld.cpp */; };
+ BC53DA601143141A000D817E /* DOMObjectHashTableMap.h in Headers */ = {isa = PBXBuildFile; fileRef = BC53DA5F1143141A000D817E /* DOMObjectHashTableMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ BC53DA62114314BD000D817E /* DOMObjectHashTableMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC53DA61114314BD000D817E /* DOMObjectHashTableMap.cpp */; };
BC56CB2110D5AC8000A77C64 /* GeolocationController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC56CB1C10D5AC8000A77C64 /* GeolocationController.cpp */; };
BC56CB2210D5AC8000A77C64 /* GeolocationController.h in Headers */ = {isa = PBXBuildFile; fileRef = BC56CB1D10D5AC8000A77C64 /* GeolocationController.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC56CB2310D5AC8000A77C64 /* GeolocationControllerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BC56CB1E10D5AC8000A77C64 /* GeolocationControllerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -8439,7 +8443,6 @@
A8EA80040A19516E00A8EF5F /* StyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = StyleSheet.h; sourceTree = "<group>"; };
A8EA80050A19516E00A8EF5F /* StyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StyleSheet.cpp; sourceTree = "<group>"; };
A8EA80060A19516E00A8EF5F /* MediaList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MediaList.h; sourceTree = "<group>"; };
- A8EDB03C1016849400FE8113 /* DOMObjectWithSVGContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMObjectWithSVGContext.h; sourceTree = "<group>"; };
A8F4FB930C169E7B002AFED5 /* SVGRenderSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGRenderSupport.h; sourceTree = "<group>"; };
A8F4FB950C169E85002AFED5 /* SVGRenderSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGRenderSupport.cpp; sourceTree = "<group>"; };
A8F5C0B60F9285AC0098E06B /* RenderSVGModelObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGModelObject.h; sourceTree = "<group>"; };
@@ -9539,6 +9542,11 @@
BC53C6070DA56C570021EB5D /* Gradient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Gradient.cpp; sourceTree = "<group>"; };
BC53C60A0DA56CF10021EB5D /* GradientCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GradientCG.cpp; sourceTree = "<group>"; };
BC53C6910DA591140021EB5D /* CSSGradientValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSGradientValue.h; sourceTree = "<group>"; };
+ BC53D910114310CC000D817E /* WebCoreJSClientData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreJSClientData.h; sourceTree = "<group>"; };
+ BC53DA2D1143121E000D817E /* DOMWrapperWorld.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWrapperWorld.h; sourceTree = "<group>"; };
+ BC53DA471143134D000D817E /* DOMWrapperWorld.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWrapperWorld.cpp; sourceTree = "<group>"; };
+ BC53DA5F1143141A000D817E /* DOMObjectHashTableMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMObjectHashTableMap.h; sourceTree = "<group>"; };
+ BC53DA61114314BD000D817E /* DOMObjectHashTableMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMObjectHashTableMap.cpp; sourceTree = "<group>"; };
BC56CB1C10D5AC8000A77C64 /* GeolocationController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeolocationController.cpp; sourceTree = "<group>"; };
BC56CB1D10D5AC8000A77C64 /* GeolocationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeolocationController.h; sourceTree = "<group>"; };
BC56CB1E10D5AC8000A77C64 /* GeolocationControllerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeolocationControllerClient.h; sourceTree = "<group>"; };
@@ -14676,14 +14684,16 @@
BC1A3793097C6FB10019F3D8 /* js */ = {
isa = PBXGroup;
children = (
- 65E0E9431133C89F00B4CB10 /* JSDOMWrapper.h */,
BCCE58A71061E82F008FB35A /* Callback Objects */,
BCCE58B41061E925008FB35A /* Constructors */,
BC4EDEF70C08F414007EDD49 /* Custom */,
14DFB33F0A7DF7630018F769 /* Derived Sources */,
- BCD533630ED6848900887468 /* CachedScriptSourceProvider.h */,
93F8B3060A300FEA00F61AB8 /* CodeGeneratorJS.pm */,
- A8EDB03C1016849400FE8113 /* DOMObjectWithSVGContext.h */,
+ BCD533630ED6848900887468 /* CachedScriptSourceProvider.h */,
+ BC53DA61114314BD000D817E /* DOMObjectHashTableMap.cpp */,
+ BC53DA5F1143141A000D817E /* DOMObjectHashTableMap.h */,
+ BC53DA471143134D000D817E /* DOMWrapperWorld.cpp */,
+ BC53DA2D1143121E000D817E /* DOMWrapperWorld.h */,
1432E8480C51493F00B1500F /* GCController.cpp */,
1432E8460C51493800B1500F /* GCController.h */,
B5D3601E112F8BA80048DEA8 /* JSDatabaseCallback.cpp */,
@@ -14696,6 +14706,7 @@
BC6932720D7E293900AE44D1 /* JSDOMWindowBase.h */,
BCBFB53A0DCD29CF0019B3E5 /* JSDOMWindowShell.cpp */,
BCBFB53B0DCD29CF0019B3E5 /* JSDOMWindowShell.h */,
+ 65E0E9431133C89F00B4CB10 /* JSDOMWrapper.h */,
BC60901E0E91B8EC000C68B5 /* JSEventTarget.cpp */,
BC60901D0E91B8EC000C68B5 /* JSEventTarget.h */,
3314ACE910892086000F0E56 /* JSExceptionBase.cpp */,
@@ -14748,6 +14759,7 @@
A75E497510752ACB00C9B896 /* SerializedScriptValue.cpp */,
A75E497410752ACB00C9B896 /* SerializedScriptValue.h */,
65488D6A0DD5A83D009D83B2 /* StringSourceProvider.h */,
+ BC53D910114310CC000D817E /* WebCoreJSClientData.h */,
E1A643FC0EC097A000779668 /* WorkerScriptController.cpp */,
E1A643F10EC0972500779668 /* WorkerScriptController.h */,
);
@@ -16636,7 +16648,6 @@
85CA96EA0A9624E900690CCF /* DOMNotation.h in Headers */,
85E711D40AC5D5350053270F /* DOMNotationInternal.h in Headers */,
856C8AE40A912649005C687B /* DOMObject.h in Headers */,
- A8EDB03D1016849400FE8113 /* DOMObjectWithSVGContext.h in Headers */,
85C7F5D00AAFB8D9004014DD /* DOMOverflowEvent.h in Headers */,
85989DCF0ACC8BBD00A0BC51 /* DOMOverflowEventInternal.h in Headers */,
E1284BD61044A01E00EAEB52 /* DOMPageTransitionEvent.h in Headers */,
@@ -18648,6 +18659,9 @@
626CDE0F1140424C001E5A68 /* SpatialNavigation.h in Headers */,
B5D3601A112F8B560048DEA8 /* DatabaseCallback.h in Headers */,
B5D3601D112F8BA00048DEA8 /* JSDatabaseCallback.h in Headers */,
+ BC53D911114310CC000D817E /* WebCoreJSClientData.h in Headers */,
+ BC53DA2E1143121E000D817E /* DOMWrapperWorld.h in Headers */,
+ BC53DA601143141A000D817E /* DOMObjectHashTableMap.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -20843,6 +20857,8 @@
7637C541112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp in Sources */,
626CDE0E1140424C001E5A68 /* SpatialNavigation.cpp in Sources */,
B5D3601F112F8BA80048DEA8 /* JSDatabaseCallback.cpp in Sources */,
+ BC53DA481143134D000D817E /* DOMWrapperWorld.cpp in Sources */,
+ BC53DA62114314BD000D817E /* DOMObjectHashTableMap.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebCore/bindings/js/DOMObjectHashTableMap.cpp b/WebCore/bindings/js/DOMObjectHashTableMap.cpp
new file mode 100644
index 0000000..bfcab0b
--- /dev/null
+++ b/WebCore/bindings/js/DOMObjectHashTableMap.cpp
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 1999-2001 Harri Porten (porten at kde.org)
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Samuel Weinig <sam at webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "DOMObjectHashTableMap.h"
+
+#include "WebCoreJSClientData.h"
+
+using namespace JSC;
+
+namespace WebCore{
+
+DOMObjectHashTableMap& DOMObjectHashTableMap::mapFor(JSGlobalData& globalData)
+{
+ JSGlobalData::ClientData* clientData = globalData.clientData;
+ ASSERT(clientData);
+ return static_cast<WebCoreJSClientData*>(clientData)->hashTableMap;
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/js/DOMObjectHashTableMap.h b/WebCore/bindings/js/DOMObjectHashTableMap.h
new file mode 100644
index 0000000..4ddacb8
--- /dev/null
+++ b/WebCore/bindings/js/DOMObjectHashTableMap.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 1999-2001 Harri Porten (porten at kde.org)
+ * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Samuel Weinig <sam at webkit.org>
+ * Copyright (C) 2009 Google, Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef DOMObjectHashTableMap_h
+#define DOMObjectHashTableMap_h
+
+#include <runtime/Lookup.h>
+#include <wtf/HashMap.h>
+
+namespace JSC {
+ class JSGlobalData;
+}
+
+namespace WebCore {
+
+// Map from static HashTable instances to per-GlobalData ones.
+class DOMObjectHashTableMap {
+public:
+ static DOMObjectHashTableMap& mapFor(JSC::JSGlobalData&);
+
+ ~DOMObjectHashTableMap()
+ {
+ HashMap<const JSC::HashTable*, JSC::HashTable>::iterator mapEnd = m_map.end();
+ for (HashMap<const JSC::HashTable*, JSC::HashTable>::iterator iter = m_map.begin(); iter != m_map.end(); ++iter)
+ iter->second.deleteTable();
+ }
+
+ const JSC::HashTable* get(const JSC::HashTable* staticTable)
+ {
+ HashMap<const JSC::HashTable*, JSC::HashTable>::iterator iter = m_map.find(staticTable);
+ if (iter != m_map.end())
+ return &iter->second;
+ return &m_map.set(staticTable, JSC::HashTable(*staticTable)).first->second;
+ }
+
+private:
+ HashMap<const JSC::HashTable*, JSC::HashTable> m_map;
+};
+
+} // namespace WebCore
+
+#endif // DOMObjectHashTableMap_h
diff --git a/WebCore/bindings/js/DOMWrapperWorld.cpp b/WebCore/bindings/js/DOMWrapperWorld.cpp
new file mode 100644
index 0000000..c696315
--- /dev/null
+++ b/WebCore/bindings/js/DOMWrapperWorld.cpp
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 1999-2001 Harri Porten (porten at kde.org)
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Samuel Weinig <sam at webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "DOMWrapperWorld.h"
+
+#include "JSDOMWindow.h"
+#include "WebCoreJSClientData.h"
+
+using namespace JSC;
+
+namespace WebCore {
+
+DOMWrapperWorld::DOMWrapperWorld(JSC::JSGlobalData* globalData, bool isNormal)
+ : m_globalData(globalData)
+ , m_isNormal(isNormal)
+{
+}
+
+static void forgetWorldOfDOMNodesForDocument(Document* document, DOMWrapperWorld* world)
+{
+ Document::JSWrapperCache* wrappers = document->wrapperCacheMap().take(world);
+ ASSERT(wrappers); // 'world' should only know about 'document' if 'document' knows about 'world'!
+ delete wrappers;
+}
+
+DOMWrapperWorld::~DOMWrapperWorld()
+{
+ JSGlobalData::ClientData* clientData = m_globalData->clientData;
+ ASSERT(clientData);
+ static_cast<WebCoreJSClientData*>(clientData)->forgetWorld(this);
+
+ for (HashSet<Document*>::iterator iter = documentsWithWrappers.begin(); iter != documentsWithWrappers.end(); ++iter)
+ forgetWorldOfDOMNodesForDocument(*iter, this);
+}
+
+DOMWrapperWorld* normalWorld(JSC::JSGlobalData& globalData)
+{
+ JSGlobalData::ClientData* clientData = globalData.clientData;
+ ASSERT(clientData);
+ return static_cast<WebCoreJSClientData*>(clientData)->normalWorld();
+}
+
+DOMWrapperWorld* mainThreadNormalWorld()
+{
+ ASSERT(isMainThread());
+ static DOMWrapperWorld* cachedNormalWorld = normalWorld(*JSDOMWindow::commonJSGlobalData());
+ return cachedNormalWorld;
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/js/DOMWrapperWorld.h b/WebCore/bindings/js/DOMWrapperWorld.h
new file mode 100644
index 0000000..65cf6a6
--- /dev/null
+++ b/WebCore/bindings/js/DOMWrapperWorld.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 1999-2001 Harri Porten (porten at kde.org)
+ * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Samuel Weinig <sam at webkit.org>
+ * Copyright (C) 2009 Google, Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef DOMWrapperWorld_h
+#define DOMWrapperWorld_h
+
+#include "Document.h"
+#include "JSDOMGlobalObject.h"
+#include "JSDOMWrapper.h"
+#include <runtime/WeakGCMap.h>
+
+namespace WebCore {
+
+class StringImpl;
+
+typedef JSC::WeakGCMap<void*, DOMObject*> DOMObjectWrapperMap;
+typedef JSC::WeakGCMap<StringImpl*, JSC::JSString*> JSStringCache;
+
+class DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
+public:
+ static PassRefPtr<DOMWrapperWorld> create(JSC::JSGlobalData* globalData, bool isNormal)
+ {
+ return adoptRef(new DOMWrapperWorld(globalData, isNormal));
+ }
+ ~DOMWrapperWorld();
+
+ void rememberDocument(Document* document) { documentsWithWrappers.add(document); }
+ void forgetDocument(Document* document) { documentsWithWrappers.remove(document); }
+
+ // FIXME: can we make this private?
+ DOMObjectWrapperMap m_wrappers;
+ JSStringCache m_stringCache;
+
+ bool isNormal() const { return m_isNormal; }
+
+protected:
+ DOMWrapperWorld(JSC::JSGlobalData*, bool isNormal);
+
+private:
+ JSC::JSGlobalData* m_globalData;
+ HashSet<Document*> documentsWithWrappers;
+ bool m_isNormal;
+};
+
+DOMWrapperWorld* normalWorld(JSC::JSGlobalData&);
+DOMWrapperWorld* mainThreadNormalWorld();
+inline DOMWrapperWorld* debuggerWorld() { return mainThreadNormalWorld(); }
+inline DOMWrapperWorld* pluginWorld() { return mainThreadNormalWorld(); }
+
+inline DOMWrapperWorld* currentWorld(JSC::ExecState* exec)
+{
+ return static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->world();
+}
+
+// From Document.h
+
+inline Document::JSWrapperCache* Document::getWrapperCache(DOMWrapperWorld* world)
+{
+ if (world->isNormal()) {
+ if (Document::JSWrapperCache* wrapperCache = m_normalWorldWrapperCache)
+ return wrapperCache;
+ ASSERT(!m_wrapperCacheMap.contains(world));
+ } else if (Document::JSWrapperCache* wrapperCache = m_wrapperCacheMap.get(world))
+ return wrapperCache;
+ return createWrapperCache(world);
+}
+
+} // namespace WebCore
+
+#endif // DOMWrapperWorld_h
diff --git a/WebCore/bindings/js/JSDOMBinding.cpp b/WebCore/bindings/js/JSDOMBinding.cpp
index 9ef6458..bc68c3f 100644
--- a/WebCore/bindings/js/JSDOMBinding.cpp
+++ b/WebCore/bindings/js/JSDOMBinding.cpp
@@ -25,6 +25,7 @@
#include "ActiveDOMObject.h"
#include "DOMCoreException.h"
+#include "DOMObjectHashTableMap.h"
#include "Document.h"
#include "EventException.h"
#include "ExceptionBase.h"
@@ -40,6 +41,7 @@
#include "JSEventException.h"
#include "JSExceptionBase.h"
#include "JSNode.h"
+#include "WebCoreJSClientData.h"
#include "JSRangeException.h"
#include "JSXMLHttpRequestException.h"
#include "KURL.h"
@@ -132,22 +134,6 @@ DOMObject::~DOMObject()
#endif
-DOMWrapperWorld::DOMWrapperWorld(JSC::JSGlobalData* globalData, bool isNormal)
- : m_globalData(globalData)
- , m_isNormal(isNormal)
-{
-}
-
-DOMWrapperWorld::~DOMWrapperWorld()
-{
- JSGlobalData::ClientData* clientData = m_globalData->clientData;
- ASSERT(clientData);
- static_cast<WebCoreJSClientData*>(clientData)->forgetWorld(this);
-
- for (HashSet<Document*>::iterator iter = documentsWithWrappers.begin(); iter != documentsWithWrappers.end(); ++iter)
- forgetWorldOfDOMNodesForDocument(*iter, this);
-}
-
class JSGlobalDataWorldIterator {
public:
JSGlobalDataWorldIterator(JSGlobalData* globalData)
@@ -184,27 +170,6 @@ private:
HashSet<DOMWrapperWorld*>::iterator m_end;
};
-DOMWrapperWorld* normalWorld(JSC::JSGlobalData& globalData)
-{
- JSGlobalData::ClientData* clientData = globalData.clientData;
- ASSERT(clientData);
- return static_cast<WebCoreJSClientData*>(clientData)->normalWorld();
-}
-
-DOMWrapperWorld* mainThreadNormalWorld()
-{
- ASSERT(isMainThread());
- static DOMWrapperWorld* cachedNormalWorld = normalWorld(*JSDOMWindow::commonJSGlobalData());
- return cachedNormalWorld;
-}
-
-DOMObjectHashTableMap& DOMObjectHashTableMap::mapFor(JSGlobalData& globalData)
-{
- JSGlobalData::ClientData* clientData = globalData.clientData;
- ASSERT(clientData);
- return static_cast<WebCoreJSClientData*>(clientData)->hashTableMap;
-}
-
const JSC::HashTable* getHashTableForGlobalData(JSGlobalData& globalData, const JSC::HashTable* staticTable)
{
return DOMObjectHashTableMap::mapFor(globalData).get(staticTable);
@@ -317,13 +282,6 @@ void forgetAllDOMNodesForDocument(Document* document)
}
}
-void forgetWorldOfDOMNodesForDocument(Document* document, DOMWrapperWorld* world)
-{
- JSWrapperCache* wrappers = document->wrapperCacheMap().take(world);
- ASSERT(wrappers); // 'world' should only know about 'document' if 'document' knows about 'world'!
- delete wrappers;
-}
-
static inline bool isObservableThroughDOM(JSNode* jsNode, DOMWrapperWorld* world)
{
// Certain conditions implicitly make a JS DOM node wrapper observable
diff --git a/WebCore/bindings/js/JSDOMBinding.h b/WebCore/bindings/js/JSDOMBinding.h
index 9580717..219472b 100644
--- a/WebCore/bindings/js/JSDOMBinding.h
+++ b/WebCore/bindings/js/JSDOMBinding.h
@@ -24,6 +24,7 @@
#include "JSDOMGlobalObject.h"
#include "JSDOMWrapper.h"
+#include "DOMWrapperWorld.h"
#include "JSSVGContextCache.h"
#include "Document.h"
#include <runtime/Completion.h>
@@ -119,102 +120,6 @@ namespace WebCore {
}
};
- typedef JSC::WeakGCMap<void*, DOMObject*> DOMObjectWrapperMap;
- typedef JSC::WeakGCMap<StringImpl*, JSC::JSString*> JSStringCache;
-
- class DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
- public:
- static PassRefPtr<DOMWrapperWorld> create(JSC::JSGlobalData* globalData, bool isNormal)
- {
- return adoptRef(new DOMWrapperWorld(globalData, isNormal));
- }
- ~DOMWrapperWorld();
-
- void rememberDocument(Document* document) { documentsWithWrappers.add(document); }
- void forgetDocument(Document* document) { documentsWithWrappers.remove(document); }
-
- // FIXME: can we make this private?
- DOMObjectWrapperMap m_wrappers;
- JSStringCache m_stringCache;
-
- bool isNormal() const { return m_isNormal; }
-
- protected:
- DOMWrapperWorld(JSC::JSGlobalData*, bool isNormal);
-
- private:
- JSC::JSGlobalData* m_globalData;
- HashSet<Document*> documentsWithWrappers;
- bool m_isNormal;
- };
-
- // Map from static HashTable instances to per-GlobalData ones.
- class DOMObjectHashTableMap {
- public:
- static DOMObjectHashTableMap& mapFor(JSC::JSGlobalData&);
-
- ~DOMObjectHashTableMap()
- {
- HashMap<const JSC::HashTable*, JSC::HashTable>::iterator mapEnd = m_map.end();
- for (HashMap<const JSC::HashTable*, JSC::HashTable>::iterator iter = m_map.begin(); iter != m_map.end(); ++iter)
- iter->second.deleteTable();
- }
-
- const JSC::HashTable* get(const JSC::HashTable* staticTable)
- {
- HashMap<const JSC::HashTable*, JSC::HashTable>::iterator iter = m_map.find(staticTable);
- if (iter != m_map.end())
- return &iter->second;
- return &m_map.set(staticTable, JSC::HashTable(*staticTable)).first->second;
- }
-
- private:
- HashMap<const JSC::HashTable*, JSC::HashTable> m_map;
- };
-
- class WebCoreJSClientData : public JSC::JSGlobalData::ClientData, public Noncopyable {
- friend class JSGlobalDataWorldIterator;
-
- public:
- WebCoreJSClientData(JSC::JSGlobalData* globalData)
- : m_normalWorld(DOMWrapperWorld::create(globalData, true))
- {
- m_worldSet.add(m_normalWorld.get());
- }
-
- virtual ~WebCoreJSClientData()
- {
- ASSERT(m_worldSet.contains(m_normalWorld.get()));
- ASSERT(m_worldSet.size() == 1);
- ASSERT(m_normalWorld->hasOneRef());
- m_normalWorld.clear();
- ASSERT(m_worldSet.isEmpty());
- }
-
- DOMWrapperWorld* normalWorld() { return m_normalWorld.get(); }
-
- void getAllWorlds(Vector<DOMWrapperWorld*>& worlds)
- {
- copyToVector(m_worldSet, worlds);
- }
-
- void rememberWorld(DOMWrapperWorld* world)
- {
- ASSERT(!m_worldSet.contains(world));
- m_worldSet.add(world);
- }
- void forgetWorld(DOMWrapperWorld* world)
- {
- ASSERT(m_worldSet.contains(world));
- m_worldSet.remove(world);
- }
-
- DOMObjectHashTableMap hashTableMap;
- private:
- HashSet<DOMWrapperWorld*> m_worldSet;
- RefPtr<DOMWrapperWorld> m_normalWorld;
- };
-
DOMObject* getCachedDOMObjectWrapper(JSC::ExecState*, void* objectHandle);
bool hasCachedDOMObjectWrapper(JSC::JSGlobalData*, void* objectHandle);
void cacheDOMObjectWrapper(JSC::ExecState*, void* objectHandle, DOMObject* wrapper);
@@ -224,7 +129,6 @@ namespace WebCore {
JSNode* getCachedDOMNodeWrapper(JSC::ExecState*, Document*, Node*);
void cacheDOMNodeWrapper(JSC::ExecState*, Document*, Node*, JSNode* wrapper);
void forgetAllDOMNodesForDocument(Document*);
- void forgetWorldOfDOMNodesForDocument(Document*, DOMWrapperWorld*);
void updateDOMNodeDocument(Node*, Document* oldDocument, Document* newDocument);
void markDOMNodesForDocument(JSC::MarkStack&, Document*);
@@ -239,12 +143,6 @@ namespace WebCore {
JSC::Structure* getCachedDOMStructure(JSC::ExecState*, const JSC::ClassInfo*);
JSC::Structure* cacheDOMStructure(JSC::ExecState*, NonNullPassRefPtr<JSC::Structure>, const JSC::ClassInfo*);
- DOMWrapperWorld* currentWorld(JSC::ExecState*);
- DOMWrapperWorld* normalWorld(JSC::JSGlobalData&);
- DOMWrapperWorld* mainThreadNormalWorld();
- inline DOMWrapperWorld* debuggerWorld() { return mainThreadNormalWorld(); }
- inline DOMWrapperWorld* pluginWorld() { return mainThreadNormalWorld(); }
-
JSC::JSObject* getCachedDOMConstructor(JSC::ExecState*, const JSC::ClassInfo*);
void cacheDOMConstructor(JSC::ExecState*, const JSC::ClassInfo*, JSC::JSObject* constructor);
@@ -410,11 +308,6 @@ namespace WebCore {
Frame* toDynamicFrame(JSC::ExecState*);
bool processingUserGesture(JSC::ExecState*);
KURL completeURL(JSC::ExecState*, const String& relativeURL);
-
- inline DOMWrapperWorld* currentWorld(JSC::ExecState* exec)
- {
- return static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->world();
- }
inline JSC::JSValue jsString(JSC::ExecState* exec, const String& s)
{
@@ -437,19 +330,6 @@ namespace WebCore {
return currentWorld(exec)->m_wrappers;
}
-
-
- inline Document::JSWrapperCache* Document::getWrapperCache(DOMWrapperWorld* world)
- {
- if (world->isNormal()) {
- if (Document::JSWrapperCache* wrapperCache = m_normalWorldWrapperCache)
- return wrapperCache;
- ASSERT(!m_wrapperCacheMap.contains(world));
- } else if (Document::JSWrapperCache* wrapperCache = m_wrapperCacheMap.get(world))
- return wrapperCache;
- return createWrapperCache(world);
- }
-
} // namespace WebCore
#endif // JSDOMBinding_h
diff --git a/WebCore/bindings/js/JSDOMWindowBase.cpp b/WebCore/bindings/js/JSDOMWindowBase.cpp
index 4338cdd..c25a70a 100644
--- a/WebCore/bindings/js/JSDOMWindowBase.cpp
+++ b/WebCore/bindings/js/JSDOMWindowBase.cpp
@@ -36,6 +36,7 @@
#include "ScriptController.h"
#include "SecurityOrigin.h"
#include "Settings.h"
+#include "WebCoreJSClientData.h"
using namespace JSC;
diff --git a/WebCore/bindings/js/ScriptController.cpp b/WebCore/bindings/js/ScriptController.cpp
index 8e95175..f6b779a 100644
--- a/WebCore/bindings/js/ScriptController.cpp
+++ b/WebCore/bindings/js/ScriptController.cpp
@@ -37,6 +37,7 @@
#include "ScriptValue.h"
#include "Settings.h"
#include "StorageNamespace.h"
+#include "WebCoreJSClientData.h"
#include "XSSAuditor.h"
#include "npruntime_impl.h"
#include "runtime_root.h"
diff --git a/WebCore/bindings/js/WebCoreJSClientData.h b/WebCore/bindings/js/WebCoreJSClientData.h
new file mode 100644
index 0000000..e0d2e4e
--- /dev/null
+++ b/WebCore/bindings/js/WebCoreJSClientData.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 1999-2001 Harri Porten (porten at kde.org)
+ * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Samuel Weinig <sam at webkit.org>
+ * Copyright (C) 2009 Google, Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef WebCoreJSClientData_h
+#define WebCoreJSClientData_h
+
+#include "DOMWrapperWorld.h"
+#include "DOMObjectHashTableMap.h"
+#include <wtf/Noncopyable.h>
+#include <wtf/HashSet.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class WebCoreJSClientData : public JSC::JSGlobalData::ClientData, public Noncopyable {
+ friend class JSGlobalDataWorldIterator;
+public:
+ WebCoreJSClientData(JSC::JSGlobalData* globalData)
+ : m_normalWorld(DOMWrapperWorld::create(globalData, true))
+ {
+ m_worldSet.add(m_normalWorld.get());
+ }
+
+ virtual ~WebCoreJSClientData()
+ {
+ ASSERT(m_worldSet.contains(m_normalWorld.get()));
+ ASSERT(m_worldSet.size() == 1);
+ ASSERT(m_normalWorld->hasOneRef());
+ m_normalWorld.clear();
+ ASSERT(m_worldSet.isEmpty());
+ }
+
+ DOMWrapperWorld* normalWorld() { return m_normalWorld.get(); }
+
+ void getAllWorlds(Vector<DOMWrapperWorld*>& worlds)
+ {
+ copyToVector(m_worldSet, worlds);
+ }
+
+ void rememberWorld(DOMWrapperWorld* world)
+ {
+ ASSERT(!m_worldSet.contains(world));
+ m_worldSet.add(world);
+ }
+ void forgetWorld(DOMWrapperWorld* world)
+ {
+ ASSERT(m_worldSet.contains(world));
+ m_worldSet.remove(world);
+ }
+
+ DOMObjectHashTableMap hashTableMap;
+
+private:
+ HashSet<DOMWrapperWorld*> m_worldSet;
+ RefPtr<DOMWrapperWorld> m_normalWorld;
+};
+
+} // namespace WebCore
+
+#endif // WebCoreJSClientData_h
diff --git a/WebCore/bindings/js/WorkerScriptController.cpp b/WebCore/bindings/js/WorkerScriptController.cpp
index adcc089..e371423 100644
--- a/WebCore/bindings/js/WorkerScriptController.cpp
+++ b/WebCore/bindings/js/WorkerScriptController.cpp
@@ -30,11 +30,11 @@
#include "WorkerScriptController.h"
-#include "JSDOMBinding.h"
#include "JSDedicatedWorkerContext.h"
#include "JSSharedWorkerContext.h"
#include "ScriptSourceCode.h"
#include "ScriptValue.h"
+#include "WebCoreJSClientData.h"
#include "WorkerContext.h"
#include "WorkerObjectProxy.h"
#include "WorkerThread.h"
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list