[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

jberlin at webkit.org jberlin at webkit.org
Wed Dec 22 18:07:17 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 56df99e7e89996dcb405b2aa04ce027a5c02ebf4
Author: jberlin at webkit.org <jberlin at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 7 17:27:10 2010 +0000

    WebKit2: Need to set the location of the Databases directory when the WebProcess is initialized
    https://bugs.webkit.org/show_bug.cgi?id=50604
    
    Reviewed by Darin Adler.
    
    * WebProcess/WebCoreSupport/WebDatabaseManager.cpp: Added.
    (WebKit::WebDatabaseManager::shared):
    (WebKit::WebDatabaseManager::WebDatabaseManager):
    Initialize the DatabaseTracker with the Database directory.
    * WebProcess/WebCoreSupport/WebDatabaseManager.h: Added.
    * WebProcess/WebCoreSupport/mac/WebDatabaseManagerMac.mm: Added.
    (WebKit::WebDatabaseManager::databaseDirectory):
    Copied from WebKitInitializeDatabasesIfNecessary in WebKit/mac/Storage/WebDatabaseManager.mm.
    * WebProcess/WebCoreSupport/win/WebDatabaseManagerWin.cpp: Added.
    (WebKit::WebDatabaseManager::databaseDirectory):
    Copied from WebKitInitializeWebDatabasesIfNecessary in WebKit/win/WebDatabaseManager.cpp.
    
    * WebProcess/WebProcess.cpp:
    (WebKit::WebProcess::WebProcess):
    Make sure that the Databases directory has been set by calling WebDatabaseManager::shared().
    
    * WebKit2.xcodeproj/project.pbxproj:
    Add WebDatabaseManager.cpp/.h/Mac.cpp
    * win/WebKit2.vcproj:
    Add WebDatabaseManager.cpp/.h/Win.cpp
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73449 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 43101ca..b6de3a2 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,31 @@
+2010-12-07  Jessie Berlin  <jberlin at apple.com>
+
+        Reviewed by Darin Adler.
+
+        WebKit2: Need to set the location of the Databases directory when the WebProcess is initialized
+        https://bugs.webkit.org/show_bug.cgi?id=50604
+
+        * WebProcess/WebCoreSupport/WebDatabaseManager.cpp: Added.
+        (WebKit::WebDatabaseManager::shared):
+        (WebKit::WebDatabaseManager::WebDatabaseManager):
+        Initialize the DatabaseTracker with the Database directory.
+        * WebProcess/WebCoreSupport/WebDatabaseManager.h: Added.
+        * WebProcess/WebCoreSupport/mac/WebDatabaseManagerMac.mm: Added.
+        (WebKit::WebDatabaseManager::databaseDirectory):
+        Copied from WebKitInitializeDatabasesIfNecessary in WebKit/mac/Storage/WebDatabaseManager.mm.
+        * WebProcess/WebCoreSupport/win/WebDatabaseManagerWin.cpp: Added.
+        (WebKit::WebDatabaseManager::databaseDirectory):
+        Copied from WebKitInitializeWebDatabasesIfNecessary in WebKit/win/WebDatabaseManager.cpp.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::WebProcess):
+        Make sure that the Databases directory has been set by calling WebDatabaseManager::shared().
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Add WebDatabaseManager.cpp/.h/Mac.cpp
+        * win/WebKit2.vcproj:
+        Add WebDatabaseManager.cpp/.h/Win.cpp
+
 2010-12-06  Darin Adler  <darin at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index 9615ff1..7c7ab65 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -584,6 +584,9 @@
 		F634445C12A885E9000612D8 /* WKSecurityOrigin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F634445A12A885E9000612D8 /* WKSecurityOrigin.cpp */; };
 		F634445D12A885E9000612D8 /* WKSecurityOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = F634445B12A885E9000612D8 /* WKSecurityOrigin.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		F67DD7BA125E40D9007BDCB8 /* WKSerializedScriptValuePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = F67DD7B9125E40D9007BDCB8 /* WKSerializedScriptValuePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		F6A25FD912ADC6BD00DC40CC /* WebDatabaseManagerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6A25FD812ADC6BD00DC40CC /* WebDatabaseManagerMac.mm */; };
+		F6A25FDC12ADC6CC00DC40CC /* WebDatabaseManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F6A25FDA12ADC6CC00DC40CC /* WebDatabaseManager.cpp */; };
+		F6A25FDD12ADC6CC00DC40CC /* WebDatabaseManager.h in Headers */ = {isa = PBXBuildFile; fileRef = F6A25FDB12ADC6CC00DC40CC /* WebDatabaseManager.h */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
@@ -1230,6 +1233,9 @@
 		F634445A12A885E9000612D8 /* WKSecurityOrigin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKSecurityOrigin.cpp; sourceTree = "<group>"; };
 		F634445B12A885E9000612D8 /* WKSecurityOrigin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKSecurityOrigin.h; sourceTree = "<group>"; };
 		F67DD7B9125E40D9007BDCB8 /* WKSerializedScriptValuePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKSerializedScriptValuePrivate.h; sourceTree = "<group>"; };
+		F6A25FD812ADC6BD00DC40CC /* WebDatabaseManagerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDatabaseManagerMac.mm; sourceTree = "<group>"; };
+		F6A25FDA12ADC6CC00DC40CC /* WebDatabaseManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebDatabaseManager.cpp; sourceTree = "<group>"; };
+		F6A25FDB12ADC6CC00DC40CC /* WebDatabaseManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDatabaseManager.h; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -1724,6 +1730,8 @@
 				BC032D6010F4378D0058C15A /* WebChromeClient.h */,
 				BC111A54112F4FBB00337BAB /* WebContextMenuClient.cpp */,
 				BC032D6210F4378D0058C15A /* WebContextMenuClient.h */,
+				F6A25FDA12ADC6CC00DC40CC /* WebDatabaseManager.cpp */,
+				F6A25FDB12ADC6CC00DC40CC /* WebDatabaseManager.h */,
 				BC111A56112F4FBB00337BAB /* WebDragClient.cpp */,
 				BC032D6610F4378D0058C15A /* WebDragClient.h */,
 				BC111A57112F4FBB00337BAB /* WebEditorClient.cpp */,
@@ -1928,6 +1936,7 @@
 		BC111ADE112F5B9A00337BAB /* mac */ = {
 			isa = PBXGroup;
 			children = (
+				F6A25FD812ADC6BD00DC40CC /* WebDatabaseManagerMac.mm */,
 				C5237F5F12441CA300780472 /* WebEditorClientMac.mm */,
 				BC111ADF112F5BC200337BAB /* WebErrorsMac.mm */,
 				9391F283121B38F500EBF7E8 /* WebFrameNetworkingContext.h */,
@@ -2627,6 +2636,7 @@
 				F634445D12A885E9000612D8 /* WKSecurityOrigin.h in Headers */,
 				BC2D021712AC41CB00E732A3 /* SameDocumentNavigationType.h in Headers */,
 				BC2D021912AC426C00E732A3 /* WKPageLoadTypes.h in Headers */,
+				F6A25FDD12ADC6CC00DC40CC /* WebDatabaseManager.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -3034,6 +3044,8 @@
 				512F58F912A88A5400629530 /* WKCredential.cpp in Sources */,
 				512F58FB12A88A5400629530 /* WKProtectionSpace.cpp in Sources */,
 				F634445C12A885E9000612D8 /* WKSecurityOrigin.cpp in Sources */,
+				F6A25FD912ADC6BD00DC40CC /* WebDatabaseManagerMac.mm in Sources */,
+				F6A25FDC12ADC6CC00DC40CC /* WebDatabaseManager.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp b/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp
new file mode 100644
index 0000000..fc849b9
--- /dev/null
+++ b/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2010 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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 "WebDatabaseManager.h"
+
+#include <WebCore/DatabaseTracker.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebDatabaseManager& WebDatabaseManager::shared()
+{
+    static WebDatabaseManager& shared = *new WebDatabaseManager;
+    return shared;
+}
+
+WebDatabaseManager::WebDatabaseManager()
+{
+    DatabaseTracker::initializeTracker(databaseDirectory());
+}
+
+} // namespace WebKit
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.h b/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.h
new file mode 100644
index 0000000..86176f3
--- /dev/null
+++ b/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2010 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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 WebDatabaseManager_h
+#define WebDatabaseManager_h
+
+#include <wtf/Noncopyable.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebKit {
+
+class WebDatabaseManager : public Noncopyable {
+public:
+    static WebDatabaseManager& shared();
+
+    // FIXME: Add methods to get the origins for which there are databases, delete the databases
+    // for an origin, and delete all the databases.
+    // https://bugs.webkit.org/show_bug.cgi?id=50606
+
+private:
+    WebDatabaseManager();
+
+    String databaseDirectory() const;
+};
+
+} // namespace WebKit
+
+#endif // WebDatabaseManager_h
diff --git a/WebKit2/WebProcess/WebCoreSupport/mac/WebDatabaseManagerMac.mm b/WebKit2/WebProcess/WebCoreSupport/mac/WebDatabaseManagerMac.mm
new file mode 100644
index 0000000..d4eb3ac
--- /dev/null
+++ b/WebKit2/WebProcess/WebCoreSupport/mac/WebDatabaseManagerMac.mm
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2010 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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 "WebDatabaseManager.h"
+
+namespace WebKit {
+
+NSString *WebDatabaseDirectoryDefaultsKey = @"WebDatabaseDirectory";
+
+String WebDatabaseManager::databaseDirectory() const
+{
+    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+    NSString *databasesDirectory = [defaults objectForKey:WebDatabaseDirectoryDefaultsKey];
+    if (!databasesDirectory || ![databasesDirectory isKindOfClass:[NSString class]])
+        databasesDirectory = @"~/Library/WebKit/Databases";
+
+    return [databasesDirectory stringByStandardizingPath];
+}
+
+} // namespace WebKit
diff --git a/WebKit2/WebProcess/WebCoreSupport/win/WebDatabaseManagerWin.cpp b/WebKit2/WebProcess/WebCoreSupport/win/WebDatabaseManagerWin.cpp
new file mode 100644
index 0000000..b6d15fd
--- /dev/null
+++ b/WebKit2/WebProcess/WebCoreSupport/win/WebDatabaseManagerWin.cpp
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2010 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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 "WebDatabaseManager.h"
+
+#include <WebCore/FileSystem.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+String WebDatabaseManager::databaseDirectory() const
+{
+    return WebCore::pathByAppendingComponent(WebCore::localUserSpecificStorageDirectory(), "Databases");
+}
+
+} // namespace WebKit
diff --git a/WebKit2/WebProcess/WebProcess.cpp b/WebKit2/WebProcess/WebProcess.cpp
index 511805a..389f995 100644
--- a/WebKit2/WebProcess/WebProcess.cpp
+++ b/WebKit2/WebProcess/WebProcess.cpp
@@ -33,6 +33,7 @@
 #include "RunLoop.h"
 #include "WebContextMessages.h"
 #include "WebCoreArgumentCoders.h"
+#include "WebDatabaseManager.h"
 #include "WebFrame.h"
 #include "WebPage.h"
 #include "WebPageCreationParameters.h"
@@ -105,6 +106,11 @@ WebProcess::WebProcess()
     // Initialize our platform strategies.
     WebPlatformStrategies::initialize();
 #endif // USE(PLATFORM_STRATEGIES)
+
+#if ENABLE(DATABASE)
+    // Make sure the WebDatabaseManager is initialized so that the Database directory is set.
+    WebDatabaseManager::shared();
+#endif
 }
 
 void WebProcess::initialize(CoreIPC::Connection::Identifier serverIdentifier, RunLoop* runLoop)
diff --git a/WebKit2/win/WebKit2.vcproj b/WebKit2/win/WebKit2.vcproj
index 134e6a5..add5939 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -1142,6 +1142,14 @@
 					>
 				</File>
 				<File
+					RelativePath="..\WebProcess\WebCoreSupport\WebDatabaseManager.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\WebProcess\WebCoreSupport\WebDatabaseManager.h"
+					>
+				</File>
+				<File
 					RelativePath="..\WebProcess\WebCoreSupport\WebDragClient.cpp"
 					>
 				</File>
@@ -1213,6 +1221,10 @@
 					Name="win"
 					>
 					<File
+						RelativePath="..\WebProcess\WebCoreSupport\win\WebDatabaseManagerWin.cpp"
+						>
+					</File>
+					<File
 						RelativePath="..\WebProcess\WebCoreSupport\win\WebErrorsWin.cpp"
 						>
 					</File>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list