Changeset 207144 in webkit
- Timestamp:
- Oct 11, 2016 9:33:30 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/win/ChangeLog
r207067 r207144 1 2016-10-11 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r207067. 4 5 This change caused webkitpy test failures. 6 7 Reverted changeset: 8 9 "[Win] Parallel DRTs are sharing preferences and cache." 10 https://bugs.webkit.org/show_bug.cgi?id=163013 11 http://trac.webkit.org/changeset/207067 12 1 13 2016-10-11 Per Arne Vollan <pvollan@apple.com> 2 14 -
trunk/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
r207067 r207144 188 188 } 189 189 190 [uuid(F9582D72-6348-45B1-AB09-39E33459B5B9)]191 interface IWebPreferencesPrivate4 : IWebPreferencesPrivate3192 {193 HRESULT setApplicationId([in] BSTR applicationId);194 } -
trunk/Source/WebKit/win/WebApplicationCache.cpp
r207067 r207144 29 29 #include "CFDictionaryPropertyBag.h" 30 30 #include "MarshallingHelpers.h" 31 #include "WebPreferences.h"32 31 #include "WebSecurityOrigin.h" 33 32 #include <wtf/RetainPtr.h> … … 70 69 71 70 #if USE(CF) 72 auto cacheDirectoryPreference = adoptCF(CFPreferencesCopyAppValue(WebKitLocalCacheDefaultsKey, WebPreferences::applicationId()));71 auto cacheDirectoryPreference = adoptCF(CFPreferencesCopyAppValue(WebKitLocalCacheDefaultsKey, kCFPreferencesCurrentApplication)); 73 72 if (cacheDirectoryPreference && CFStringGetTypeID() == CFGetTypeID(cacheDirectoryPreference.get())) 74 73 path = static_cast<CFStringRef>(cacheDirectoryPreference.get()); -
trunk/Source/WebKit/win/WebCache.cpp
r207067 r207144 36 36 #if USE(CURL) 37 37 #include <WebCore/CurlCacheManager.h> 38 #elif USE(CFNETWORK) 39 #include <CFNetwork/CFURLCachePriv.h> 40 #include <WebKitSystemInterface/WebKitSystemInterface.h> 41 #endif 42 43 using namespace WebCore; 38 #endif 44 39 45 40 // WebCache --------------------------------------------------------------------------- … … 249 244 *location = WebCore::BString(cacheFolder).release(); 250 245 return S_OK; 251 #elif USE(CFNETWORK) 252 RetainPtr<CFStringRef> cfurlCacheDirectory = adoptCF(wkCopyFoundationCacheDirectory(0)); 253 *location = BString(cfurlCacheDirectory.get()).release(); 254 return S_OK; 246 #else 247 return E_NOTIMPL; 255 248 #endif 256 249 } … … 262 255 WebCore::CurlCacheManager::getInstance().setCacheDirectory(cacheFolder); 263 256 return S_OK; 264 #elif USE(CFNETWORK) 265 RetainPtr<CFURLCacheRef> cache = adoptCF(CFURLCacheCopySharedURLCache()); 266 CFIndex memoryCapacity = CFURLCacheMemoryCapacity(cache.get()); 267 CFIndex diskCapacity = CFURLCacheDiskCapacity(cache.get()); 268 RetainPtr<CFURLCacheRef> newCache = adoptCF(CFURLCacheCreate(kCFAllocatorDefault, memoryCapacity, diskCapacity, String(location).createCFString().get())); 269 CFURLCacheSetSharedURLCache(newCache.get()); 270 return S_OK; 271 #endif 272 } 257 #else 258 return E_NOTIMPL; 259 #endif 260 } -
trunk/Source/WebKit/win/WebDatabaseManager.cpp
r207067 r207144 34 34 #include "MarshallingHelpers.h" 35 35 #include "WebNotificationCenter.h" 36 #include "WebPreferences.h"37 36 #include "WebSecurityOrigin.h" 38 37 … … 422 421 { 423 422 #if USE(CF) 424 RetainPtr<CFPropertyListRef> directoryPref = adoptCF(CFPreferencesCopyAppValue(WebDatabaseDirectoryDefaultsKey, WebPreferences::applicationId()));423 RetainPtr<CFPropertyListRef> directoryPref = adoptCF(CFPreferencesCopyAppValue(WebDatabaseDirectoryDefaultsKey, kCFPreferencesCurrentApplication)); 425 424 if (directoryPref && (CFStringGetTypeID() == CFGetTypeID(directoryPref.get()))) 426 425 return static_cast<CFStringRef>(directoryPref.get()); -
trunk/Source/WebKit/win/WebPreferences.cpp
r207067 r207144 102 102 static CFDictionaryRef defaultSettings; 103 103 104 RetainPtr<CFStringRef> WebPreferences::m_applicationId = kCFPreferencesCurrentApplication;105 106 104 static HashMap<WTF::String, COMPtr<WebPreferences>>& webPreferencesInstances() 107 105 { … … 184 182 if (webPreference && webPreference->m_refCount == 1) 185 183 webPreferencesInstances().remove(identifierString); 186 }187 188 CFStringRef WebPreferences::applicationId()189 {190 return m_applicationId.get();191 184 } 192 185 … … 314 307 return value; 315 308 316 value = adoptCF(CFPreferencesCopyAppValue(key, applicationId()));309 value = adoptCF(CFPreferencesCopyAppValue(key, kCFPreferencesCurrentApplication)); 317 310 if (value) 318 311 return value; … … 325 318 CFDictionarySetValue(m_privatePrefs.get(), key, value); 326 319 if (m_autoSaves) { 327 CFPreferencesSetAppValue(key, value, applicationId());320 CFPreferencesSetAppValue(key, value, kCFPreferencesCurrentApplication); 328 321 save(); 329 322 } … … 456 449 void WebPreferences::save() 457 450 { 458 CFPreferencesAppSynchronize( applicationId());451 CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); 459 452 } 460 453 … … 548 541 else if (IsEqualGUID(riid, IID_IWebPreferencesPrivate3)) 549 542 *ppvObject = static_cast<IWebPreferencesPrivate3*>(this); 550 else if (IsEqualGUID(riid, IID_IWebPreferencesPrivate4))551 *ppvObject = static_cast<IWebPreferencesPrivate4*>(this);552 543 else if (IsEqualGUID(riid, CLSID_WebPreferences)) 553 544 *ppvObject = this; … … 2003 1994 return S_OK; 2004 1995 } 2005 2006 HRESULT WebPreferences::setApplicationId(BSTR applicationId)2007 {2008 m_applicationId = String(applicationId).createCFString();2009 return S_OK;2010 } -
trunk/Source/WebKit/win/WebPreferences.h
r207067 r207144 24 24 */ 25 25 26 #pragma once 26 #ifndef WebPreferences_H 27 #define WebPreferences_H 27 28 28 29 #include "WebKit.h" … … 31 32 #include <wtf/RetainPtr.h> 32 33 33 class WebPreferences : public IWebPreferences, public IWebPreferencesPrivate 4{34 class WebPreferences : public IWebPreferences, public IWebPreferencesPrivate3 { 34 35 public: 35 36 static WebPreferences* createInstance(); … … 244 245 virtual HRESULT STDMETHODCALLTYPE setModernMediaControlsEnabled(BOOL); 245 246 246 // IWebPreferencesPrivate4247 virtual HRESULT STDMETHODCALLTYPE setApplicationId(BSTR);248 249 247 // WebPreferences 250 248 … … 259 257 static void removeReferenceForIdentifier(BSTR identifier); 260 258 static WebPreferences* sharedStandardPreferences(); 261 262 static CFStringRef applicationId();263 259 264 260 // From WebHistory.h … … 268 264 HRESULT setHistoryAgeInDaysLimit(int); 269 265 270 void willAddToWebView();271 void didRemoveFromWebView();266 void willAddToWebView(); 267 void didRemoveFromWebView(); 272 268 273 269 HRESULT postPreferencesChangesNotification(); … … 302 298 bool m_automaticallyDetectsCacheModel { true }; 303 299 unsigned m_numWebViews { 0 }; 304 static RetainPtr<CFStringRef> m_applicationId;305 300 }; 301 302 #endif -
trunk/Source/WebKit/win/WebView.cpp
r207067 r207144 502 502 RetainPtr<CFStringRef> cfurlCacheDirectory = adoptCF(wkCopyFoundationCacheDirectory(0)); 503 503 if (!cfurlCacheDirectory) { 504 RetainPtr<CFPropertyListRef> preference = adoptCF(CFPreferencesCopyAppValue(WebKitLocalCacheDefaultsKey, WebPreferences::applicationId()));504 RetainPtr<CFPropertyListRef> preference = adoptCF(CFPreferencesCopyAppValue(WebKitLocalCacheDefaultsKey, kCFPreferencesCurrentApplication)); 505 505 if (preference && (CFStringGetTypeID() == CFGetTypeID(preference.get()))) 506 506 cfurlCacheDirectory = adoptCF(static_cast<CFStringRef>(preference.leakRef())); -
trunk/Tools/ChangeLog
r207067 r207144 1 2016-10-11 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r207067. 4 5 This change caused webkitpy test failures. 6 7 Reverted changeset: 8 9 "[Win] Parallel DRTs are sharing preferences and cache." 10 https://bugs.webkit.org/show_bug.cgi?id=163013 11 http://trac.webkit.org/changeset/207067 12 1 13 2016-10-11 Per Arne Vollan <pvollan@apple.com> 2 14 -
trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp
r207067 r207144 50 50 #include <io.h> 51 51 #include <math.h> 52 #include <shlobj.h>53 52 #include <shlwapi.h> 54 53 #include <tchar.h> … … 861 860 } 862 861 863 static String applicationId()864 {865 DWORD processId = ::GetCurrentProcessId();866 return String::format("com.apple.DumpRenderTree.%d", processId);867 }868 869 static void setApplicationId()870 {871 COMPtr<IWebPreferences> preferences;872 if (SUCCEEDED(WebKitCreateInstance(CLSID_WebPreferences, 0, IID_IWebPreferences, (void**)&preferences))) {873 COMPtr<IWebPreferencesPrivate4> prefsPrivate4(Query, preferences);874 ASSERT(prefsPrivate4);875 _bstr_t fileName = applicationId().charactersWithNullTermination().data();876 prefsPrivate4->setApplicationId(fileName);877 }878 }879 880 static void setCacheFolder()881 {882 String libraryPath = libraryPathForDumpRenderTree();883 884 COMPtr<IWebCache> webCache;885 if (SUCCEEDED(WebKitCreateInstance(CLSID_WebCache, 0, IID_IWebCache, (void**)&webCache))) {886 _bstr_t cacheFolder = WebCore::pathByAppendingComponent(libraryPath, "LocalCache").utf8().data();887 webCache->setCacheFolder(cacheFolder);888 }889 }890 891 862 // Called once on DumpRenderTree startup. 892 863 static void setDefaultsToConsistentValuesForTesting() 893 864 { 894 865 #if USE(CF) 895 // Create separate preferences for each DRT instance896 setApplicationId();897 898 RetainPtr<CFStringRef> appId = applicationId().createCFString();899 900 866 String libraryPath = libraryPathForDumpRenderTree(); 901 867 902 868 // Set up these values before creating the WebView so that the various initializations will see these preferred values. 903 CFPreferencesSetAppValue(WebDatabaseDirectoryDefaultsKey, WebCore::pathByAppendingComponent(libraryPath, "Databases").createCFString().get(), appId.get()); 904 CFPreferencesSetAppValue(WebStorageDirectoryDefaultsKey, WebCore::pathByAppendingComponent(libraryPath, "LocalStorage").createCFString().get(), appId.get()); 905 CFPreferencesSetAppValue(WebKitLocalCacheDefaultsKey, WebCore::pathByAppendingComponent(libraryPath, "LocalCache").createCFString().get(), appId.get()); 906 907 // Create separate cache for each DRT instance 908 setCacheFolder(); 869 CFPreferencesSetAppValue(WebDatabaseDirectoryDefaultsKey, WebCore::pathByAppendingComponent(libraryPath, "Databases").createCFString().get(), kCFPreferencesCurrentApplication); 870 CFPreferencesSetAppValue(WebStorageDirectoryDefaultsKey, WebCore::pathByAppendingComponent(libraryPath, "LocalStorage").createCFString().get(), kCFPreferencesCurrentApplication); 871 CFPreferencesSetAppValue(WebKitLocalCacheDefaultsKey, WebCore::pathByAppendingComponent(libraryPath, "LocalCache").createCFString().get(), kCFPreferencesCurrentApplication); 909 872 #endif 910 873 } -
trunk/Tools/Scripts/webkitpy/port/win.py
r207067 r207144 29 29 30 30 import atexit 31 import glob31 import os 32 32 import logging 33 import os34 33 import re 35 34 import sys … … 353 352 self.prevent_error_dialogs() 354 353 self.delete_sem_locks() 355 356 preferences_files = self._filesystem.join(os.environ['APPDATA'], "Apple Computer/Preferences", "com.apple.DumpRenderTree*")357 filelist = glob.glob(preferences_files)358 for file in filelist:359 self._filesystem.remove(file)360 361 354 super(WinPort, self).setup_test_run(device_class) 362 355
Note: See TracChangeset
for help on using the changeset viewer.