Diff
Modified: trunk/Source/WebCore/CMakeLists.txt (109832 => 109833)
--- trunk/Source/WebCore/CMakeLists.txt 2012-03-06 02:11:17 UTC (rev 109832)
+++ trunk/Source/WebCore/CMakeLists.txt 2012-03-06 02:30:28 UTC (rev 109833)
@@ -1437,6 +1437,7 @@
storage/StorageNamespaceImpl.cpp
storage/StorageSyncManager.cpp
storage/StorageTracker.cpp
+ storage/WorkerContextSQLDatabase.cpp
xml/DOMParser.cpp
xml/NativeXPathNSResolver.cpp
@@ -1524,6 +1525,7 @@
storage/SQLTransactionErrorCallback.idl
storage/SQLTransactionSync.idl
storage/SQLTransactionSyncCallback.idl
+ storage/WorkerContextSQLDatabase.idl
)
ENDIF ()
Modified: trunk/Source/WebCore/ChangeLog (109832 => 109833)
--- trunk/Source/WebCore/ChangeLog 2012-03-06 02:11:17 UTC (rev 109832)
+++ trunk/Source/WebCore/ChangeLog 2012-03-06 02:30:28 UTC (rev 109833)
@@ -1,3 +1,40 @@
+2012-03-05 Adam Barth <[email protected]>
+
+ WorkerContext shouldn't need to know about SQLDatabase
+ https://bugs.webkit.org/show_bug.cgi?id=80352
+
+ Reviewed by Eric Seidel.
+
+ This patch removes the SQLDatabase functions from WorkerContext in
+ preparation for moving the SQLDatabase code into a module. These
+ functions don't interact with the rest of WorkerContext.
+
+ * CMakeLists.txt:
+ * DerivedSources.make:
+ * DerivedSources.pri:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * storage/DOMWindowSQLDatabase.cpp:
+ * storage/WorkerContextSQLDatabase.cpp: Added.
+ (WebCore):
+ (WebCore::WorkerContextSQLDatabase::openDatabase):
+ (WebCore::WorkerContextSQLDatabase::openDatabaseSync):
+ * storage/WorkerContextSQLDatabase.h: Added.
+ (WebCore):
+ (WorkerContextSQLDatabase):
+ (WebCore::WorkerContextSQLDatabase::WorkerContextSQLDatabase):
+ (WebCore::WorkerContextSQLDatabase::~WorkerContextSQLDatabase):
+ * storage/WorkerContextSQLDatabase.idl: Added.
+ * workers/WorkerContext.cpp:
+ (WebCore):
+ * workers/WorkerContext.h:
+ (WebCore):
+ (WorkerContext):
+ * workers/WorkerContext.idl:
+
2012-03-05 Kenichi Ishibashi <[email protected]>
[WebSocket] Introduce ThreadableWebSocketChannel::SendResult
Modified: trunk/Source/WebCore/DerivedSources.make (109832 => 109833)
--- trunk/Source/WebCore/DerivedSources.make 2012-03-06 02:11:17 UTC (rev 109832)
+++ trunk/Source/WebCore/DerivedSources.make 2012-03-06 02:30:28 UTC (rev 109833)
@@ -386,6 +386,7 @@
$(WebCore)/storage/StorageInfoErrorCallback.idl \
$(WebCore)/storage/StorageInfoQuotaCallback.idl \
$(WebCore)/storage/StorageInfoUsageCallback.idl \
+ $(WebCore)/storage/WorkerContextSQLDatabase.idl \
$(WebCore)/svg/ElementTimeControl.idl \
$(WebCore)/svg/SVGAElement.idl \
$(WebCore)/svg/SVGAltGlyphDefElement.idl \
Modified: trunk/Source/WebCore/DerivedSources.pri (109832 => 109833)
--- trunk/Source/WebCore/DerivedSources.pri 2012-03-06 02:11:17 UTC (rev 109832)
+++ trunk/Source/WebCore/DerivedSources.pri 2012-03-06 02:30:28 UTC (rev 109833)
@@ -408,6 +408,7 @@
$$PWD/storage/SQLTransactionErrorCallback.idl \
$$PWD/storage/SQLTransactionSync.idl \
$$PWD/storage/SQLTransactionSyncCallback.idl \
+ $$PWD/storage/WorkerContextSQLDatabase.idl \
$$PWD/testing/Internals.idl \
$$PWD/testing/InternalSettings.idl \
$$PWD/webaudio/AudioBuffer.idl \
Modified: trunk/Source/WebCore/GNUmakefile.list.am (109832 => 109833)
--- trunk/Source/WebCore/GNUmakefile.list.am 2012-03-06 02:11:17 UTC (rev 109832)
+++ trunk/Source/WebCore/GNUmakefile.list.am 2012-03-06 02:30:28 UTC (rev 109833)
@@ -4005,6 +4005,8 @@
Source/WebCore/storage/StorageTracker.cpp \
Source/WebCore/storage/StorageTracker.h \
Source/WebCore/storage/StorageTrackerClient.h \
+ Source/WebCore/storage/WorkerContextSQLDatabase.cpp \
+ Source/WebCore/storage/WorkerContextSQLDatabase.h \
Source/WebCore/svg/animation/SMILTimeContainer.cpp \
Source/WebCore/svg/animation/SMILTimeContainer.h \
Source/WebCore/svg/animation/SMILTime.cpp \
Modified: trunk/Source/WebCore/Target.pri (109832 => 109833)
--- trunk/Source/WebCore/Target.pri 2012-03-06 02:11:17 UTC (rev 109832)
+++ trunk/Source/WebCore/Target.pri 2012-03-06 02:30:28 UTC (rev 109833)
@@ -1318,6 +1318,7 @@
storage/StorageNamespaceImpl.cpp \
storage/StorageSyncManager.cpp \
storage/StorageTracker.cpp \
+ storage/WorkerContextSQLDatabase.cpp \
testing/Internals.cpp \
testing/InternalSettings.cpp \
xml/DOMParser.cpp \
@@ -2548,6 +2549,7 @@
storage/StorageSyncManager.h \
storage/StorageTracker.h \
storage/StorageTrackerClient.h \
+ storage/WorkerContextSQLDatabase.h \
svg/animation/SMILTimeContainer.h \
svg/animation/SMILTime.h \
svg/animation/SVGSMILElement.h \
Modified: trunk/Source/WebCore/WebCore.gypi (109832 => 109833)
--- trunk/Source/WebCore/WebCore.gypi 2012-03-06 02:11:17 UTC (rev 109832)
+++ trunk/Source/WebCore/WebCore.gypi 2012-03-06 02:30:28 UTC (rev 109833)
@@ -1079,6 +1079,7 @@
'storage/StorageInfoErrorCallback.idl',
'storage/StorageInfoQuotaCallback.idl',
'storage/StorageInfoUsageCallback.idl',
+ 'storage/WorkerContextSQLDatabase.idl',
'webaudio/AudioBuffer.idl',
'webaudio/AudioBufferCallback.idl',
'webaudio/AudioBufferSourceNode.idl',
@@ -4772,6 +4773,8 @@
'storage/StorageSyncManager.cpp',
'storage/StorageSyncManager.h',
'storage/StorageTracker.cpp',
+ 'storage/WorkerContextSQLDatabase.cpp',
+ 'storage/WorkerContextSQLDatabase.h',
'storage/chromium/DatabaseObserver.h',
'storage/chromium/DatabaseTrackerChromium.cpp',
'storage/chromium/IDBFactoryBackendInterface.cpp',
Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (109832 => 109833)
--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2012-03-06 02:11:17 UTC (rev 109832)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2012-03-06 02:30:28 UTC (rev 109833)
@@ -71165,6 +71165,14 @@
RelativePath="..\storage\VersionChangeCallback.h"
>
</File>
+ <File
+ RelativePath="..\storage\WorkerContextSQLDatabase.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\WorkerContextSQLDatabase.h"
+ >
+ </File>
</Filter>
<Filter
Name="strings"
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (109832 => 109833)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2012-03-06 02:11:17 UTC (rev 109832)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2012-03-06 02:30:28 UTC (rev 109833)
@@ -3552,6 +3552,8 @@
97E4029013A696ED00913D67 /* IconController.h in Headers */ = {isa = PBXBuildFile; fileRef = 97E4028E13A696ED00913D67 /* IconController.h */; settings = {ATTRIBUTES = (Private, ); }; };
97E4A12614F4C5D400870E43 /* NavigatorRegisterProtocolHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9730BE1514EF286B00DF06B9 /* NavigatorRegisterProtocolHandler.h */; };
97E4A12714F4C5D700870E43 /* NavigatorRegisterProtocolHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9730BE1414EF286B00DF06B9 /* NavigatorRegisterProtocolHandler.cpp */; };
+ 97E6C13D1505873F006FC943 /* WorkerContextSQLDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97E6C13A1505873F006FC943 /* WorkerContextSQLDatabase.cpp */; };
+ 97E6C13E1505873F006FC943 /* WorkerContextSQLDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 97E6C13B1505873F006FC943 /* WorkerContextSQLDatabase.h */; };
97EF7DFE107E55B700D7C49C /* ScriptControllerBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97EF7DFD107E55B700D7C49C /* ScriptControllerBase.cpp */; };
984264F112D5280A000D88A4 /* LinkLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 984264EF12D5280A000D88A4 /* LinkLoaderClient.h */; };
985BB96D13A94058007A0B69 /* LinkRelAttribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 985BB96B13A94058007A0B69 /* LinkRelAttribute.cpp */; };
@@ -10493,6 +10495,9 @@
97DCE20010807C750057D394 /* HistoryController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HistoryController.h; sourceTree = "<group>"; };
97E4028D13A696ED00913D67 /* IconController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IconController.cpp; sourceTree = "<group>"; };
97E4028E13A696ED00913D67 /* IconController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IconController.h; sourceTree = "<group>"; };
+ 97E6C13A1505873F006FC943 /* WorkerContextSQLDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerContextSQLDatabase.cpp; sourceTree = "<group>"; };
+ 97E6C13B1505873F006FC943 /* WorkerContextSQLDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerContextSQLDatabase.h; sourceTree = "<group>"; };
+ 97E6C13C1505873F006FC943 /* WorkerContextSQLDatabase.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WorkerContextSQLDatabase.idl; sourceTree = "<group>"; };
97EF7DFD107E55B700D7C49C /* ScriptControllerBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptControllerBase.cpp; sourceTree = "<group>"; };
984264EF12D5280A000D88A4 /* LinkLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkLoaderClient.h; sourceTree = "<group>"; };
985BB96B13A94058007A0B69 /* LinkRelAttribute.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LinkRelAttribute.cpp; sourceTree = "<group>"; };
@@ -14071,6 +14076,9 @@
3AB02D2912D4F91600FBB694 /* StorageTracker.cpp */,
3AB02D2812D4F91600FBB694 /* StorageTracker.h */,
3AC367FE12EF7A09006A3D6F /* StorageTrackerClient.h */,
+ 97E6C13A1505873F006FC943 /* WorkerContextSQLDatabase.cpp */,
+ 97E6C13B1505873F006FC943 /* WorkerContextSQLDatabase.h */,
+ 97E6C13C1505873F006FC943 /* WorkerContextSQLDatabase.idl */,
);
indentWidth = 4;
path = storage;
@@ -24460,6 +24468,7 @@
2E4346490F546A8200B0F1BA /* WorkerContext.h in Headers */,
9712A612150090CE0048AF10 /* WorkerContextIndexedDatabase.h in Headers */,
2E43464B0F546A8200B0F1BA /* WorkerContextProxy.h in Headers */,
+ 97E6C13E1505873F006FC943 /* WorkerContextSQLDatabase.h in Headers */,
F34742E11343631F00531BC2 /* WorkerDebuggerAgent.h in Headers */,
A3E2643114748991005A8588 /* WorkerEventQueue.h in Headers */,
F36E07A51358A8BE00AACBC9 /* WorkerInspectorController.h in Headers */,
@@ -27437,6 +27446,7 @@
F3820896147D35F90010BC06 /* WorkerConsoleAgent.cpp in Sources */,
2E4346480F546A8200B0F1BA /* WorkerContext.cpp in Sources */,
9712A611150090CE0048AF10 /* WorkerContextIndexedDatabase.cpp in Sources */,
+ 97E6C13D1505873F006FC943 /* WorkerContextSQLDatabase.cpp in Sources */,
F34742E01343631F00531BC2 /* WorkerDebuggerAgent.cpp in Sources */,
A3E2643014748991005A8588 /* WorkerEventQueue.cpp in Sources */,
F36E07A41358A8BE00AACBC9 /* WorkerInspectorController.cpp in Sources */,
Modified: trunk/Source/WebCore/storage/DOMWindowSQLDatabase.cpp (109832 => 109833)
--- trunk/Source/WebCore/storage/DOMWindowSQLDatabase.cpp 2012-03-06 02:11:17 UTC (rev 109832)
+++ trunk/Source/WebCore/storage/DOMWindowSQLDatabase.cpp 2012-03-06 02:30:28 UTC (rev 109833)
@@ -25,6 +25,9 @@
*/
#include "config.h"
+
+#if ENABLE(SQL_DATABASE)
+
#include "DOMWindowSQLDatabase.h"
#include "AbstractDatabase.h"
@@ -35,8 +38,6 @@
#include "Frame.h"
#include "SecurityOrigin.h"
-#if ENABLE(SQL_DATABASE)
-
namespace WebCore {
PassRefPtr<Database> DOMWindowSQLDatabase::openDatabase(DOMWindow* window, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
Copied: trunk/Source/WebCore/storage/WorkerContextSQLDatabase.cpp (from rev 109832, trunk/Source/WebCore/storage/DOMWindowSQLDatabase.cpp) (0 => 109833)
--- trunk/Source/WebCore/storage/WorkerContextSQLDatabase.cpp (rev 0)
+++ trunk/Source/WebCore/storage/WorkerContextSQLDatabase.cpp 2012-03-06 02:30:28 UTC (rev 109833)
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "config.h"
+
+#if ENABLE(SQL_DATABASE)
+
+#include "WorkerContextSQLDatabase.h"
+
+#include "AbstractDatabase.h"
+#include "Database.h"
+#include "DatabaseCallback.h"
+#include "DatabaseSync.h"
+#include "DatabaseTracker.h"
+#include "SecurityOrigin.h"
+#include "WorkerContext.h"
+
+namespace WebCore {
+
+PassRefPtr<Database> WorkerContextSQLDatabase::openDatabase(WorkerContext* context, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
+{
+ if (!context->securityOrigin()->canAccessDatabase() || !AbstractDatabase::isAvailable()) {
+ ec = SECURITY_ERR;
+ return 0;
+ }
+
+ return Database::openDatabase(context, name, version, displayName, estimatedSize, creationCallback, ec);
+}
+
+PassRefPtr<DatabaseSync> WorkerContextSQLDatabase::openDatabaseSync(WorkerContext* context, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
+{
+ if (!context->securityOrigin()->canAccessDatabase() || !AbstractDatabase::isAvailable()) {
+ ec = SECURITY_ERR;
+ return 0;
+ }
+
+ return DatabaseSync::openDatabaseSync(context, name, version, displayName, estimatedSize, creationCallback, ec);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(SQL_DATABASE)
Copied: trunk/Source/WebCore/storage/WorkerContextSQLDatabase.h (from rev 109832, trunk/Source/WebCore/storage/DOMWindowSQLDatabase.cpp) (0 => 109833)
--- trunk/Source/WebCore/storage/WorkerContextSQLDatabase.h (rev 0)
+++ trunk/Source/WebCore/storage/WorkerContextSQLDatabase.h 2012-03-06 02:30:28 UTC (rev 109833)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef WorkerContextSQLDatabase_h
+#define WorkerContextSQLDatabase_h
+
+#if ENABLE(SQL_DATABASE)
+
+#include "ExceptionCode.h"
+#include "PlatformString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class Database;
+class DatabaseCallback;
+class DatabaseSync;
+class WorkerContext;
+
+class WorkerContextSQLDatabase {
+public:
+ static PassRefPtr<Database> openDatabase(WorkerContext*, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode&);
+ static PassRefPtr<DatabaseSync> openDatabaseSync(WorkerContext*, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode&);
+
+private:
+ WorkerContextSQLDatabase() { };
+ ~WorkerContextSQLDatabase() { };
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SQL_DATABASE)
+
+#endif // WorkerContextSQLDatabase_h
Copied: trunk/Source/WebCore/storage/WorkerContextSQLDatabase.idl (from rev 109832, trunk/Source/WebCore/storage/DOMWindowSQLDatabase.cpp) (0 => 109833)
--- trunk/Source/WebCore/storage/WorkerContextSQLDatabase.idl (rev 0)
+++ trunk/Source/WebCore/storage/WorkerContextSQLDatabase.idl 2012-03-06 02:30:28 UTC (rev 109833)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+module window {
+
+ interface [
+ Conditional=SQL_DATABASE,
+ Supplemental=WorkerContext
+ ] WorkerContextSQLDatabase {
+ [V8EnabledAtRuntime] Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Callback, Optional] DatabaseCallback creationCallback)
+ raises(DOMException);
+
+ [V8EnabledAtRuntime] DatabaseSync openDatabaseSync(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Callback, Optional] DatabaseCallback creationCallback)
+ raises(DOMException);
+ };
+
+}
Modified: trunk/Source/WebCore/workers/WorkerContext.cpp (109832 => 109833)
--- trunk/Source/WebCore/workers/WorkerContext.cpp 2012-03-06 02:11:17 UTC (rev 109832)
+++ trunk/Source/WebCore/workers/WorkerContext.cpp 2012-03-06 02:30:28 UTC (rev 109833)
@@ -31,13 +31,8 @@
#include "WorkerContext.h"
-#include "AbstractDatabase.h"
#include "ActiveDOMObject.h"
#include "ContentSecurityPolicy.h"
-#include "Database.h"
-#include "DatabaseCallback.h"
-#include "DatabaseSync.h"
-#include "DatabaseTracker.h"
#include "DOMTimer.h"
#include "DOMURL.h"
#include "DOMWindow.h"
@@ -308,28 +303,6 @@
}
#endif
-#if ENABLE(SQL_DATABASE)
-PassRefPtr<Database> WorkerContext::openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
-{
- if (!securityOrigin()->canAccessDatabase() || !AbstractDatabase::isAvailable()) {
- ec = SECURITY_ERR;
- return 0;
- }
-
- return Database::openDatabase(this, name, version, displayName, estimatedSize, creationCallback, ec);
-}
-
-PassRefPtr<DatabaseSync> WorkerContext::openDatabaseSync(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
-{
- if (!securityOrigin()->canAccessDatabase() || !AbstractDatabase::isAvailable()) {
- ec = SECURITY_ERR;
- return 0;
- }
-
- return DatabaseSync::openDatabaseSync(this, name, version, displayName, estimatedSize, creationCallback, ec);
-}
-#endif
-
bool WorkerContext::isContextThread() const
{
return currentThread() == thread()->threadID();
Modified: trunk/Source/WebCore/workers/WorkerContext.h (109832 => 109833)
--- trunk/Source/WebCore/workers/WorkerContext.h 2012-03-06 02:11:17 UTC (rev 109832)
+++ trunk/Source/WebCore/workers/WorkerContext.h 2012-03-06 02:30:28 UTC (rev 109833)
@@ -48,9 +48,6 @@
class Blob;
class DOMURL;
- class Database;
- class DatabaseCallback;
- class DatabaseSync;
class NotificationCenter;
class ScheduledAction;
class WorkerInspectorController;
@@ -112,11 +109,6 @@
NotificationCenter* webkitNotifications() const;
#endif
-#if ENABLE(SQL_DATABASE)
- // HTML 5 client-side database
- PassRefPtr<Database> openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode&);
- PassRefPtr<DatabaseSync> openDatabaseSync(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode&);
-#endif
virtual bool isContextThread() const;
virtual bool isJSExecutionForbidden() const;
Modified: trunk/Source/WebCore/workers/WorkerContext.idl (109832 => 109833)
--- trunk/Source/WebCore/workers/WorkerContext.idl 2012-03-06 02:11:17 UTC (rev 109832)
+++ trunk/Source/WebCore/workers/WorkerContext.idl 2012-03-06 02:30:28 UTC (rev 109833)
@@ -50,12 +50,6 @@
// WorkerUtils
[Custom] void importScripts(/*[Variadic] in DOMString urls */);
attribute [Replaceable] WorkerNavigator navigator;
-#if defined(ENABLE_SQL_DATABASE) && ENABLE_SQL_DATABASE
- [V8EnabledAtRuntime] Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Callback, Optional] DatabaseCallback creationCallback)
- raises(DOMException);
- [V8EnabledAtRuntime] DatabaseSync openDatabaseSync(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Callback, Optional] DatabaseCallback creationCallback)
- raises(DOMException);
-#endif
// Timers
[Custom] long setTimeout(in TimeoutHandler handler, in long timeout);