Commit 31a1ec3d authored by mjs@apple.com's avatar mjs@apple.com
Browse files

2011-01-24 Maciej Stachowiak <mjs@apple.com>

        Reviewed by Anders Carlsson.

        Use designated temp directory for the database for WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=53052
        
        Adopt the new WK2 API for this.

        * WebKitTestRunner/TestController.cpp:
        (WTR::TestController::libraryPathForTesting):
        (WTR::TestController::initialize):
        * WebKitTestRunner/TestController.h:
        * WebKitTestRunner/mac/TestControllerMac.mm:
        (WTR::TestController::platformLibraryPathForTesting):
        * WebKitTestRunner/qt/TestControllerQt.cpp:
        (WTR::TestController::platformLibraryPathForTesting):
        * WebKitTestRunner/win/TestControllerWin.cpp:
        (WTR::TestController::platformLibraryPathForTesting):
2011-01-24  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Anders Carlsson.

        Use designated temp directory for the database for WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=53052
        
        Add the API necessary to support this. Database path is now
        determined on the UI process side and passed to the Web process.
        Reviewed by Anders Carlsson.

        * GNUmakefile.am:
        * Shared/WebProcessCreationParameters.cpp:
        (WebKit::WebProcessCreationParameters::encode):
        (WebKit::WebProcessCreationParameters::decode):
        * Shared/WebProcessCreationParameters.h:
        * UIProcess/API/C/WKContext.cpp:
        (WKContextSetDatabaseDirectory):
        * UIProcess/API/C/WKContextPrivate.h:
        * UIProcess/WebContext.cpp:
        (WebKit::WebContext::ensureWebProcess):
        (WebKit::WebContext::databaseDirectory):
        * UIProcess/WebContext.h:
        (WebKit::WebContext::setDatabaseDirectory):
        * UIProcess/mac/WebContextMac.mm:
        (WebKit::WebContext::platformDefaultDatabaseDirectory):
        * UIProcess/qt/WebContextQt.cpp:
        (WebKit::WebContext::platformDefaultDatabaseDirectory):
        * UIProcess/win/WebContextWin.cpp:
        (WebKit::WebContext::platformDefaultDatabaseDirectory):
        * WebKit2.pro:
        * WebKit2.xcodeproj/project.pbxproj:
        * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
        (WebKit::WebDatabaseManager::initialize):
        (WebKit::WebDatabaseManager::WebDatabaseManager):
        * WebProcess/WebCoreSupport/WebDatabaseManager.h:
        * WebProcess/WebCoreSupport/gtk/WebDatabaseManagerGtk.cpp: Removed.
        * WebProcess/WebCoreSupport/mac/WebDatabaseManagerMac.mm: Removed.
        * WebProcess/WebCoreSupport/qt/WebDatabaseManagerQt.cpp: Removed.
        * WebProcess/WebCoreSupport/win/WebDatabaseManagerWin.cpp: Removed.
        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::WebProcess):
        (WebKit::WebProcess::initializeWebProcess):
        * WebProcess/com.apple.WebProcess.sb:
        * WebProcess/mac/WebProcessMac.mm:
        (WebKit::initializeSandbox):
        * win/WebKit2.vcproj:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76559 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4d1b17ce
2011-01-24 Maciej Stachowiak <mjs@apple.com>
Reviewed by Anders Carlsson.
Use designated temp directory for the database for WebKit2
https://bugs.webkit.org/show_bug.cgi?id=53052
Add the API necessary to support this. Database path is now
determined on the UI process side and passed to the Web process.
Reviewed by Anders Carlsson.
* GNUmakefile.am:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextSetDatabaseDirectory):
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::ensureWebProcess):
(WebKit::WebContext::databaseDirectory):
* UIProcess/WebContext.h:
(WebKit::WebContext::setDatabaseDirectory):
* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformDefaultDatabaseDirectory):
* UIProcess/qt/WebContextQt.cpp:
(WebKit::WebContext::platformDefaultDatabaseDirectory):
* UIProcess/win/WebContextWin.cpp:
(WebKit::WebContext::platformDefaultDatabaseDirectory):
* WebKit2.pro:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
(WebKit::WebDatabaseManager::initialize):
(WebKit::WebDatabaseManager::WebDatabaseManager):
* WebProcess/WebCoreSupport/WebDatabaseManager.h:
* WebProcess/WebCoreSupport/gtk/WebDatabaseManagerGtk.cpp: Removed.
* WebProcess/WebCoreSupport/mac/WebDatabaseManagerMac.mm: Removed.
* WebProcess/WebCoreSupport/qt/WebDatabaseManagerQt.cpp: Removed.
* WebProcess/WebCoreSupport/win/WebDatabaseManagerWin.cpp: Removed.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
(WebKit::WebProcess::initializeWebProcess):
* WebProcess/com.apple.WebProcess.sb:
* WebProcess/mac/WebProcessMac.mm:
(WebKit::initializeSandbox):
* win/WebKit2.vcproj:
2011-01-24 Brent Fulgham <bfulgham@webkit.org>
 
Unreviewed build fix.
......@@ -323,6 +323,7 @@ libWebKit2_la_SOURCES = \
Source/WebKit2/UIProcess/FindIndicator.h \
Source/WebKit2/UIProcess/GenericCallback.h \
Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp \
Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp \
Source/WebKit2/UIProcess/gtk/WebInspectorGtk.cpp \
Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp \
Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp \
......@@ -504,7 +505,6 @@ libWebKit2_la_SOURCES = \
Source/WebKit2/WebProcess/Plugins/PluginView.cpp \
Source/WebKit2/WebProcess/Plugins/PluginView.h \
Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebContextMenuClientGtk.cpp \
Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebDatabaseManagerGtk.cpp \
Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebFrameNetworkingContext.h \
Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebPopupMenuGtk.cpp \
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp \
......
......@@ -46,6 +46,7 @@ void WebProcessCreationParameters::encode(CoreIPC::ArgumentEncoder* encoder) con
encoder->encode(injectedBundlePath);
encoder->encode(injectedBundlePathExtensionHandle);
encoder->encode(applicationCacheDirectory);
encoder->encode(databaseDirectory);
encoder->encode(urlSchemesRegistererdAsEmptyDocument);
encoder->encode(urlSchemesRegisteredAsSecure);
encoder->encode(urlSchemesForWhichDomainRelaxationIsForbidden);
......@@ -76,6 +77,8 @@ bool WebProcessCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, Web
return false;
if (!decoder->decode(parameters.applicationCacheDirectory))
return false;
if (!decoder->decode(parameters.databaseDirectory))
return false;
if (!decoder->decode(parameters.urlSchemesRegistererdAsEmptyDocument))
return false;
if (!decoder->decode(parameters.urlSchemesRegisteredAsSecure))
......
......@@ -53,6 +53,7 @@ struct WebProcessCreationParameters {
SandboxExtension::Handle injectedBundlePathExtensionHandle;
String applicationCacheDirectory;
String databaseDirectory;
Vector<String> urlSchemesRegistererdAsEmptyDocument;
Vector<String> urlSchemesRegisteredAsSecure;
Vector<String> urlSchemesForWhichDomainRelaxationIsForbidden;
......
......@@ -176,3 +176,8 @@ void WKContextStopMemorySampler(WKContextRef contextRef)
{
toImpl(contextRef)->stopMemorySampler();
}
void WKContextSetDatabaseDirectory(WKContextRef contextRef, WKStringRef databaseDirectory)
{
toImpl(contextRef)->setDatabaseDirectory(toImpl(databaseDirectory)->string());
}
......@@ -54,6 +54,10 @@ WK_EXPORT void WKContextRegisterURLSchemeAsSecure(WKContextRef context, WKString
WK_EXPORT void WKContextSetDomainRelaxationForbiddenForURLScheme(WKContextRef context, WKStringRef urlScheme);
// FIXME: This function is only effective if called before the Web process is launched. But
// we should really change this setting to be on WebPreferences and changeable at runtime.
WK_EXPORT void WKContextSetDatabaseDirectory(WKContextRef context, WKStringRef databaseDirectory);
#ifdef __cplusplus
}
#endif
......
......@@ -176,6 +176,7 @@ void WebContext::ensureWebProcess()
parameters.cacheModel = m_cacheModel;
parameters.languageCode = defaultLanguage();
parameters.applicationCacheDirectory = applicationCacheDirectory();
parameters.databaseDirectory = databaseDirectory();
parameters.clearResourceCaches = m_clearResourceCachesForNewWebProcess;
parameters.clearApplicationCache = m_clearApplicationCacheForNewWebProcess;
#if PLATFORM(MAC)
......@@ -602,4 +603,12 @@ void WebContext::stopMemorySampler()
m_process->send(Messages::WebProcess::StopMemorySampler(), 0);
}
String WebContext::databaseDirectory() const
{
if (!m_overrideDatabaseDirectory.isEmpty())
return m_overrideDatabaseDirectory;
return platformDefaultDatabaseDirectory();
}
} // namespace WebKit
......@@ -137,6 +137,8 @@ public:
};
static Statistics& statistics();
void setDatabaseDirectory(const String& dir) { m_overrideDatabaseDirectory = dir; }
private:
WebContext(ProcessModel, const String& injectedBundlePath);
......@@ -162,6 +164,9 @@ private:
static void languageChanged(void* context);
void languageChanged();
String databaseDirectory() const;
String platformDefaultDatabaseDirectory() const;
ProcessModel m_processModel;
// FIXME: In the future, this should be one or more WebProcessProxies.
......@@ -203,6 +208,8 @@ private:
#if PLATFORM(WIN)
bool m_shouldPaintNativeControls;
#endif
String m_overrideDatabaseDirectory;
};
} // namespace WebKit
......
......@@ -90,5 +90,10 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para
parameters.uiProcessBundleResourcePath = fileSystemRepresentation([[NSBundle mainBundle] resourcePath]);
}
String WebContext::platformDefaultDatabaseDirectory() const
{
return [@"~/Library/WebKit/Databases" stringByStandardizingPath];
}
} // namespace WebKit
......@@ -46,4 +46,10 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters&)
qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
}
String WebContext::platformDefaultDatabaseDirectory() const
{
// FIXME: Implement.
return "";
}
} // namespace WebKit
......@@ -52,5 +52,10 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para
parameters.shouldPaintNativeControls = m_shouldPaintNativeControls;
}
String WebContext::platformDefaultDatabaseDirectory() const
{
return WebCore::pathByAppendingComponent(WebCore::localUserSpecificStorageDirectory(), "Databases");
}
} // namespace WebKit
......@@ -663,7 +663,6 @@ SOURCES += \
WebProcess/WebCoreSupport/WebPopupMenu.cpp \
WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp \
WebProcess/WebCoreSupport/qt/WebContextMenuClientQt.cpp \
WebProcess/WebCoreSupport/qt/WebDatabaseManagerQt.cpp \
WebProcess/WebCoreSupport/qt/WebErrorsQt.cpp \
WebProcess/WebCoreSupport/qt/WebFrameNetworkingContext.cpp \
WebProcess/WebCoreSupport/qt/WebPopupMenuQt.cpp \
......
......@@ -694,7 +694,6 @@
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 */
......@@ -1457,7 +1456,6 @@
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 */
......@@ -2279,7 +2277,6 @@
children = (
C554FFA212E4E8EA002F22C0 /* WebDragClientMac.mm */,
51021E9B12B16788005C033C /* WebContextMenuClientMac.mm */,
F6A25FD812ADC6BD00DC40CC /* WebDatabaseManagerMac.mm */,
C5237F5F12441CA300780472 /* WebEditorClientMac.mm */,
BC111ADF112F5BC200337BAB /* WebErrorsMac.mm */,
9391F283121B38F500EBF7E8 /* WebFrameNetworkingContext.h */,
......@@ -3481,7 +3478,6 @@
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 */,
51021E9C12B16788005C033C /* WebContextMenuClientMac.mm in Sources */,
1AAF061512B01131008E49E2 /* PDFViewController.mm in Sources */,
......
......@@ -45,9 +45,13 @@ WebDatabaseManager& WebDatabaseManager::shared()
return shared;
}
void WebDatabaseManager::initialize(const String& databaseDirectory)
{
DatabaseTracker::initializeTracker(databaseDirectory);
}
WebDatabaseManager::WebDatabaseManager()
{
DatabaseTracker::initializeTracker(databaseDirectory());
DatabaseTracker::tracker().setClient(this);
}
......
......@@ -43,6 +43,7 @@ class WebDatabaseManager : public WebCore::DatabaseTrackerClient {
WTF_MAKE_NONCOPYABLE(WebDatabaseManager);
public:
static WebDatabaseManager& shared();
static void initialize(const String& databaseDirectory);
void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
......@@ -63,8 +64,6 @@ private:
// WebCore::DatabaseTrackerClient
virtual void dispatchDidModifyOrigin(WebCore::SecurityOrigin*);
virtual void dispatchDidModifyDatabase(WebCore::SecurityOrigin*, const String& databaseIdentifier);
String databaseDirectory() const;
};
} // namespace WebKit
......
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
* Portions Copyright (c) 2010 Motorola Mobility, 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 "NotImplemented.h"
namespace WebKit {
String WebDatabaseManager::databaseDirectory() const
{
notImplemented();
return String();
}
} // namespace WebKit
/*
* 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.
*/
#import "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
/*
* 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 {
String WebDatabaseManager::databaseDirectory() const
{
// FIXME: Implement.
return "";
}
} // namespace WebKit
/*
* 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
......@@ -119,11 +119,6 @@ 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)
......@@ -159,6 +154,11 @@ void WebProcess::initializeWebProcess(const WebProcessCreationParameters& parame
}
}
#if ENABLE(DATABASE)
// Make sure the WebDatabaseManager is initialized so that the Database directory is set.
WebDatabaseManager::initialize(parameters.databaseDirectory);
#endif
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
if (!parameters.applicationCacheDirectory.isEmpty())
cacheStorage().setCacheDirectory(parameters.applicationCacheDirectory);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment