WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-116729-20130524160120.patch (text/plain), 16.41 KB, created by
Brent Fulgham
on 2013-05-24 16:02:39 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Brent Fulgham
Created:
2013-05-24 16:02:39 PDT
Size:
16.41 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 150662) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2013-05-24 Brent Fulgham <bfulgham@apple.com> >+ >+ [Windows] Expose database storage and cache locations via preferences. >+ https://bugs.webkit.org/show_bug.cgi?id=116729 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Export >+ three symbols needed to implement the feature. >+ > 2013-05-21 Carlos Garcia Campos <cgarcia@igalia.com> > > [BlackBerry] Make PagePopup implementation independent from WebCore >Index: Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in >=================================================================== >--- Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in (revision 150639) >+++ Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in (working copy) >@@ -178,6 +178,9 @@ EXPORTS > ?childItemWithTarget@HistoryItem@WebCore@@QBEPAV12@ABVString@WTF@@@Z > ?create@Range@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@V?$PassRefPtr@VDocument@WebCore@@@4@V?$PassRefPtr@VNode@WebCore@@@4@H1H@Z > ?create@SerializedScriptValue@WebCore@@SA?AV?$PassRefPtr@VSerializedScriptValue@WebCore@@@WTF@@ABVString@4@@Z >+#if USE(CF) >+ ?createCFString@String@WTF@@QBE?AV?$RetainPtr@PBU__CFString@@@2@XZ >+#endif > ?createShadowRoot@Element@WebCore@@QAE?AV?$PassRefPtr@VShadowRoot@WebCore@@@WTF@@AAH@Z > ?createWrapper@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNode@1@@Z > ?deprecatedShadowAncestorNode@Node@WebCore@@QBEPAV12@XZ >@@ -222,6 +225,7 @@ EXPORTS > ?setProperty@Settings@InspectorFrontendClientLocal@WebCore@@UAEXABVString@WTF@@0@Z > ?windowObjectCleared@InspectorFrontendClientLocal@WebCore@@UAEXXZ > ?setResourcesDataSizeLimitsFromInternals@InspectorController@WebCore@@QAEXHH@Z >+ ?pathByAppendingComponent@WebCore@@YA?AVString@WTF@@ABV23@0@Z > ?profilerEnabled@InspectorController@WebCore@@QAE_NXZ > ?setProfilerEnabled@InspectorController@WebCore@@QAEX_N@Z > ?disconnectFrontend@InspectorController@WebCore@@QAEXXZ >@@ -237,6 +241,7 @@ EXPORTS > ?firstChild@ComposedShadowTreeWalker@WebCore@@QAEXXZ > ?lastChild@ComposedShadowTreeWalker@WebCore@@QAEXXZ > ?length@StaticNodeList@WebCore@@UBEIXZ >+ ?localUserSpecificStorageDirectory@WebCore@@YA?AVString@WTF@@XZ > ?namedItem@StaticNodeList@WebCore@@UBEPAVNode@2@ABVAtomicString@WTF@@@Z > ?next@ComposedShadowTreeWalker@WebCore@@QAEXXZ > ?previous@ComposedShadowTreeWalker@WebCore@@QAEXXZ >Index: Source/WebKit/win/ChangeLog >=================================================================== >--- Source/WebKit/win/ChangeLog (revision 150662) >+++ Source/WebKit/win/ChangeLog (working copy) >@@ -1,3 +1,24 @@ >+2013-05-24 Brent Fulgham <bfulgham@apple.com> >+ >+ [Windows] Expose database storage and cache locations via preferences. >+ https://bugs.webkit.org/show_bug.cgi?id=116729 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebDatabaseManager.cpp: Update to check preferences for the >+ desired location of the database store. >+ (databasesDirectory): Added. >+ (WebKitInitializeWebDatabasesIfNecessary): Use new databasesDirectory >+ method to determine what system path to use for file storage. >+ * WebKit.vcproj/WebKitExports.def.in: Export three symbols >+ needed to implement the feature. >+ * WebView.cpp: Update to check preferences for the desired location >+ of the various caches used by WebKit. >+ (WebView::setCacheModel): Update to check preferences for URL cache >+ storage. >+ (WebKitSetApplicationCachePathIfNecessary): Update to check >+ preferences for ccache storage. >+ > 2013-05-24 Anders Carlsson <andersca@apple.com> > > Remove unused code to read/write history >Index: Source/WebKit/win/WebDatabaseManager.cpp >=================================================================== >--- Source/WebKit/win/WebDatabaseManager.cpp (revision 150639) >+++ Source/WebKit/win/WebDatabaseManager.cpp (working copy) >@@ -47,6 +47,8 @@ > > using namespace WebCore; > >+static CFStringRef WebDatabaseDirectoryDefaultsKey = CFSTR("WebDatabaseDirectory"); >+ > static inline bool isEqual(LPCWSTR s1, LPCWSTR s2) > { > return !wcscmp(s1, s2); >@@ -405,14 +407,24 @@ void WebDatabaseManager::dispatchDidModi > notifyCenter->postNotificationName(databaseDidModifyOriginName, securityOrigin.get(), userInfoBag.get()); > } > >+static WTF::String databasesDirectory() >+{ >+#if USE(CF) >+ CFStringRef directoryPref = static_cast<CFStringRef>(CFPreferencesCopyAppValue(WebDatabaseDirectoryDefaultsKey, kCFPreferencesCurrentApplication)); >+ if (directoryPref && CFStringGetTypeID() == CFGetTypeID(directoryPref)) >+ return directoryPref; >+#endif >+ >+ return WebCore::pathByAppendingComponent(WebCore::localUserSpecificStorageDirectory(), "Databases"); >+} >+ > void WebKitInitializeWebDatabasesIfNecessary() > { > static bool initialized = false; > if (initialized) > return; > >- WTF::String databasesDirectory = WebCore::pathByAppendingComponent(WebCore::localUserSpecificStorageDirectory(), "Databases"); >- WebCore::DatabaseManager::manager().initialize(databasesDirectory); >+ WebCore::DatabaseManager::manager().initialize(databasesDirectory()); > > initialized = true; > } >Index: Source/WebKit/win/WebView.cpp >=================================================================== >--- Source/WebKit/win/WebView.cpp (revision 150639) >+++ Source/WebKit/win/WebView.cpp (working copy) >@@ -195,6 +195,8 @@ using JSC::JSLock; > static HMODULE accessibilityLib; > static HashSet<WebView*> pendingDeleteBackingStoreSet; > >+static CFStringRef WebKitLocalCacheDefaultsKey = CFSTR("WebKitLocalCache"); >+ > static String webKitVersionString(); > > WebView* kit(Page* page) >@@ -478,8 +480,11 @@ void WebView::setCacheModel(WebCacheMode > > RetainPtr<CFURLCacheRef> cfurlCache = adoptCF(CFURLCacheCopySharedURLCache()); > RetainPtr<CFStringRef> cfurlCacheDirectory = adoptCF(wkCopyFoundationCacheDirectory(0)); >- if (!cfurlCacheDirectory) >- cfurlCacheDirectory = WebCore::localUserSpecificStorageDirectory().createCFString(); >+ if (!cfurlCacheDirectory) { >+ cfurlCacheDirectory = static_cast<CFStringRef>(CFPreferencesCopyAppValue(WebKitLocalCacheDefaultsKey, kCFPreferencesCurrentApplication)); >+ if (!cfurlCacheDirectory || CFStringGetTypeID() != CFGetTypeID(cfurlCacheDirectory.get())) >+ cfurlCacheDirectory = WebCore::localUserSpecificStorageDirectory().createCFString(); >+ } > > // As a fudge factor, use 1000 instead of 1024, in case the reported byte > // count doesn't align exactly to a megabyte boundary. >@@ -2597,6 +2602,13 @@ static void WebKitSetApplicationCachePat > return; > > String path = localUserSpecificStorageDirectory(); >+ >+#if USE(CF) >+ CFStringRef cacheDirectory = static_cast<CFStringRef>(CFPreferencesCopyAppValue(WebKitLocalCacheDefaultsKey, kCFPreferencesCurrentApplication)); >+ if (cacheDirectory && CFStringGetTypeID() == CFGetTypeID(cacheDirectory)) >+ path = cacheDirectory; >+#endif >+ > if (!path.isNull()) > cacheStorage().setCacheDirectory(path); > >Index: Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in >=================================================================== >--- Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in (revision 150639) >+++ Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in (working copy) >@@ -178,6 +178,9 @@ EXPORTS > ?childItemWithTarget@HistoryItem@WebCore@@QBEPAV12@ABVString@WTF@@@Z > ?create@Range@WebCore@@SA?AV?$PassRefPtr@VRange@WebCore@@@WTF@@V?$PassRefPtr@VDocument@WebCore@@@4@V?$PassRefPtr@VNode@WebCore@@@4@H1H@Z > ?create@SerializedScriptValue@WebCore@@SA?AV?$PassRefPtr@VSerializedScriptValue@WebCore@@@WTF@@ABVString@4@@Z >+#if USE(CF) >+ ?createCFString@String@WTF@@QBE?AV?$RetainPtr@PBU__CFString@@@2@XZ >+#endif > ?createShadowRoot@Element@WebCore@@QAE?AV?$PassRefPtr@VShadowRoot@WebCore@@@WTF@@AAH@Z > ?createWrapper@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVNode@1@@Z > ?deprecatedShadowAncestorNode@Node@WebCore@@QBEPAV12@XZ >@@ -222,6 +225,7 @@ EXPORTS > ?setProperty@Settings@InspectorFrontendClientLocal@WebCore@@UAEXABVString@WTF@@0@Z > ?windowObjectCleared@InspectorFrontendClientLocal@WebCore@@UAEXXZ > ?setResourcesDataSizeLimitsFromInternals@InspectorController@WebCore@@QAEXHH@Z >+ ?pathByAppendingComponent@WebCore@@YA?AVString@WTF@@ABV23@0@Z > ?profilerEnabled@InspectorController@WebCore@@QAE_NXZ > ?setProfilerEnabled@InspectorController@WebCore@@QAEX_N@Z > ?disconnectFrontend@InspectorController@WebCore@@QAEXXZ >@@ -237,6 +241,7 @@ EXPORTS > ?firstChild@ComposedShadowTreeWalker@WebCore@@QAEXXZ > ?lastChild@ComposedShadowTreeWalker@WebCore@@QAEXXZ > ?length@StaticNodeList@WebCore@@UBEIXZ >+ ?localUserSpecificStorageDirectory@WebCore@@YA?AVString@WTF@@XZ > ?namedItem@StaticNodeList@WebCore@@UBEPAVNode@2@ABVAtomicString@WTF@@@Z > ?next@ComposedShadowTreeWalker@WebCore@@QAEXXZ > ?previous@ComposedShadowTreeWalker@WebCore@@QAEXXZ >Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 150662) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,28 @@ >+2013-05-24 Brent Fulgham <bfulgham@apple.com> >+ >+ [Windows] Expose database storage and cache locations via preferences. >+ https://bugs.webkit.org/show_bug.cgi?id=116729 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update DumpRenderTree to use CFPreferences to control where WebKit >+ stores its local databases, URL caches, etc. >+ >+ * DumpRenderTree/win/DumpRenderTree.cpp: >+ (libraryPathForDumpRenderTree): Added. >+ (dllLauncherEntryPoint): Set up DRT-specific cache locations. >+ * Scripts/webkitpy/port/base.py: >+ (Port._driver_tempdir): Added (to allow port-specific overload). >+ (Port._driver_tempdir_for_environment): Ditto >+ * Scripts/webkitpy/port/driver.py: >+ (Driver._setup_environ_for_driver): Use new overload to set >+ environment variable. >+ (Driver._start): Use new overload for temp directory location. >+ * Scripts/webkitpy/port/win.py: >+ (WinPort._driver_tempdir_for_environment): New overload to supply >+ Windows path to DumpRenderTree environment (while still using >+ cygwin paths for internal operations. >+ > 2013-05-24 Bem Jones-Bey <bjonesbe@adobe.com> > > Make team.html have each contributor's area of expertise >Index: Tools/DumpRenderTree/win/DumpRenderTree.cpp >=================================================================== >--- Tools/DumpRenderTree/win/DumpRenderTree.cpp (revision 150639) >+++ Tools/DumpRenderTree/win/DumpRenderTree.cpp (working copy) >@@ -54,15 +54,13 @@ > #include <wtf/Vector.h> > #include <windows.h> > #include <CoreFoundation/CoreFoundation.h> >+#include <WebCore/FileSystem.h> > #include <WebKit/WebKit.h> > #include <WebKit/WebKitCOMAPI.h> > > #if USE(CFNETWORK) >-#include <CFNetwork/CFURLCachePriv.h> >-#endif >- >-#if USE(CFNETWORK) > #include <CFNetwork/CFHTTPCookiesPriv.h> >+#include <CFNetwork/CFURLCachePriv.h> > #endif > > using namespace std; >@@ -74,8 +72,13 @@ const LPWSTR TestPluginDir = L"TestNetsc > #endif > > static LPCWSTR fontsEnvironmentVariable = L"WEBKIT_TESTFONTS"; >+static LPCWSTR dumpRenderTreeTemp = L"DUMPRENDERTREE_TEMP"; > #define USE_MAC_FONTS > >+static CFStringRef WebDatabaseDirectoryDefaultsKey = CFSTR("WebDatabaseDirectory"); >+static CFStringRef WebKitLocalCacheDefaultsKey = CFSTR("WebKitLocalCache"); >+static CFStringRef WebStorageDirectoryDefaultsKey = CFSTR("WebKitLocalStorageDatabasePathPreferenceKey"); >+ > const LPCWSTR kDumpRenderTreeClassName = L"DumpRenderTreeWindow"; > > static bool dumpTree = true; >@@ -191,6 +194,22 @@ static string toUTF8(const wchar_t* wide > return string(utf8Vector.data(), utf8Vector.size() - 1); > } > >+#if USE(CF) >+static WTF::String libraryPathForDumpRenderTree() >+{ >+ DWORD size = ::GetEnvironmentVariable(dumpRenderTreeTemp, 0, 0); >+ Vector<TCHAR> buffer(size); >+ if (::GetEnvironmentVariable(dumpRenderTreeTemp, buffer.data(), buffer.size())) { >+ wstring path = buffer.data(); >+ if (path[path.length() - 1] != '\\') >+ path.append(L"\\"); >+ return WTF::String (path.data(), path.length()); >+ } >+ >+ return WebCore::localUserSpecificStorageDirectory(); >+} >+#endif >+ > string toUTF8(BSTR bstr) > { > return toUTF8(bstr, SysStringLen(bstr)); >@@ -1275,6 +1294,14 @@ extern "C" __declspec(dllexport) int WIN > return 0; > } > >+#if USE(CF) >+ // Set up these values before creating the WebView so that the various initializations will see these preferred values. >+ WTF::String path = libraryPathForDumpRenderTree(); >+ CFPreferencesSetAppValue(WebDatabaseDirectoryDefaultsKey, WebCore::pathByAppendingComponent(path, "Databases").createCFString().get(), kCFPreferencesCurrentApplication); >+ CFPreferencesSetAppValue(WebStorageDirectoryDefaultsKey, WebCore::pathByAppendingComponent(path, "LocalStorage").createCFString().get(), kCFPreferencesCurrentApplication); >+ CFPreferencesSetAppValue(WebKitLocalCacheDefaultsKey, WebCore::pathByAppendingComponent(path, "LocalCache").createCFString().get(), kCFPreferencesCurrentApplication); >+#endif >+ > COMPtr<IWebView> webView(AdoptCOM, createWebViewAndOffscreenWindow(&webViewWindow)); > if (!webView) > return -1; >Index: Tools/Scripts/webkitpy/port/base.py >=================================================================== >--- Tools/Scripts/webkitpy/port/base.py (revision 150639) >+++ Tools/Scripts/webkitpy/port/base.py (working copy) >@@ -1265,6 +1265,12 @@ class Port(object): > """Returns the full path to the test driver (DumpRenderTree).""" > return self._build_path(self.driver_name()) > >+ def _driver_tempdir(self): >+ return self._filesystem.mkdtemp(prefix='%s-' % self.driver_name()) >+ >+ def _driver_tempdir_for_environment(self): >+ return self._driver_tempdir() >+ > def _path_to_webcore_library(self): > """Returns the full path to a built copy of WebCore.""" > return None >Index: Tools/Scripts/webkitpy/port/driver.py >=================================================================== >--- Tools/Scripts/webkitpy/port/driver.py (revision 150639) >+++ Tools/Scripts/webkitpy/port/driver.py (working copy) >@@ -284,7 +284,7 @@ class Driver(object): > environment['DYLD_LIBRARY_PATH'] = self._port._build_path() > environment['DYLD_FRAMEWORK_PATH'] = self._port._build_path() > # FIXME: We're assuming that WebKitTestRunner checks this DumpRenderTree-named environment variable. >- environment['DUMPRENDERTREE_TEMP'] = str(self._driver_tempdir) >+ environment['DUMPRENDERTREE_TEMP'] = str(self._port._driver_tempdir_for_environment()) > environment['LOCAL_RESOURCE_ROOT'] = self._port.layout_tests_dir() > if 'WEBKITOUTPUTDIR' in os.environ: > environment['WEBKITOUTPUTDIR'] = os.environ['WEBKITOUTPUTDIR'] >@@ -294,7 +294,7 @@ class Driver(object): > > def _start(self, pixel_tests, per_test_args): > self.stop() >- self._driver_tempdir = self._port._filesystem.mkdtemp(prefix='%s-' % self._port.driver_name()) >+ self._driver_tempdir = self._port._driver_tempdir() > server_name = self._port.driver_name() > environment = self._port.setup_environ_for_server(server_name) > environment = self._setup_environ_for_driver(environment) >Index: Tools/Scripts/webkitpy/port/win.py >=================================================================== >--- Tools/Scripts/webkitpy/port/win.py (revision 150639) >+++ Tools/Scripts/webkitpy/port/win.py (working copy) >@@ -32,7 +32,7 @@ import sys > > from webkitpy.common.system.systemhost import SystemHost > from webkitpy.common.system.executive import ScriptError, Executive >-from webkitpy.common.system.path import abspath_to_uri >+from webkitpy.common.system.path import abspath_to_uri, cygpath > from webkitpy.port.apple import ApplePort > > >@@ -115,3 +115,6 @@ class WinPort(ApplePort): > # Remove this implementation when we are confident that DumpRenderTree on Windows works properly in parallel. > def default_child_processes(self): > return 1 >+ >+ def _driver_tempdir_for_environment(self): >+ return cygpath(self._driver_tempdir())
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 116729
:
202862
|
202867