Diff
Modified: trunk/Source/WebKit/win/ChangeLog (207143 => 207144)
--- trunk/Source/WebKit/win/ChangeLog 2016-10-11 16:28:06 UTC (rev 207143)
+++ trunk/Source/WebKit/win/ChangeLog 2016-10-11 16:33:30 UTC (rev 207144)
@@ -1,3 +1,15 @@
+2016-10-11 Ryan Haddad <[email protected]>
+
+ Unreviewed, rolling out r207067.
+
+ This change caused webkitpy test failures.
+
+ Reverted changeset:
+
+ "[Win] Parallel DRTs are sharing preferences and cache."
+ https://bugs.webkit.org/show_bug.cgi?id=163013
+ http://trac.webkit.org/changeset/207067
+
2016-10-11 Per Arne Vollan <[email protected]>
[Win] Parallel DRTs are sharing preferences and cache.
Modified: trunk/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl (207143 => 207144)
--- trunk/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl 2016-10-11 16:28:06 UTC (rev 207143)
+++ trunk/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl 2016-10-11 16:33:30 UTC (rev 207144)
@@ -187,8 +187,3 @@
HRESULT setModernMediaControlsEnabled([in] BOOL enabled);
}
-[uuid(F9582D72-6348-45B1-AB09-39E33459B5B9)]
-interface IWebPreferencesPrivate4 : IWebPreferencesPrivate3
-{
- HRESULT setApplicationId([in] BSTR applicationId);
-}
\ No newline at end of file
Modified: trunk/Source/WebKit/win/WebApplicationCache.cpp (207143 => 207144)
--- trunk/Source/WebKit/win/WebApplicationCache.cpp 2016-10-11 16:28:06 UTC (rev 207143)
+++ trunk/Source/WebKit/win/WebApplicationCache.cpp 2016-10-11 16:33:30 UTC (rev 207144)
@@ -28,7 +28,6 @@
#include "CFDictionaryPropertyBag.h"
#include "MarshallingHelpers.h"
-#include "WebPreferences.h"
#include "WebSecurityOrigin.h"
#include <wtf/RetainPtr.h>
#include <WebCore/ApplicationCache.h>
@@ -69,7 +68,7 @@
String path = localUserSpecificStorageDirectory();
#if USE(CF)
- auto cacheDirectoryPreference = adoptCF(CFPreferencesCopyAppValue(WebKitLocalCacheDefaultsKey, WebPreferences::applicationId()));
+ auto cacheDirectoryPreference = adoptCF(CFPreferencesCopyAppValue(WebKitLocalCacheDefaultsKey, kCFPreferencesCurrentApplication));
if (cacheDirectoryPreference && CFStringGetTypeID() == CFGetTypeID(cacheDirectoryPreference.get()))
path = static_cast<CFStringRef>(cacheDirectoryPreference.get());
#endif
Modified: trunk/Source/WebKit/win/WebCache.cpp (207143 => 207144)
--- trunk/Source/WebKit/win/WebCache.cpp 2016-10-11 16:28:06 UTC (rev 207143)
+++ trunk/Source/WebKit/win/WebCache.cpp 2016-10-11 16:33:30 UTC (rev 207144)
@@ -35,13 +35,8 @@
#if USE(CURL)
#include <WebCore/CurlCacheManager.h>
-#elif USE(CFNETWORK)
-#include <CFNetwork/CFURLCachePriv.h>
-#include <WebKitSystemInterface/WebKitSystemInterface.h>
#endif
-using namespace WebCore;
-
// WebCache ---------------------------------------------------------------------------
WebCache::WebCache()
@@ -248,10 +243,8 @@
String cacheFolder = WebCore::CurlCacheManager::getInstance().cacheDirectory();
*location = WebCore::BString(cacheFolder).release();
return S_OK;
-#elif USE(CFNETWORK)
- RetainPtr<CFStringRef> cfurlCacheDirectory = adoptCF(wkCopyFoundationCacheDirectory(0));
- *location = BString(cfurlCacheDirectory.get()).release();
- return S_OK;
+#else
+ return E_NOTIMPL;
#endif
}
@@ -261,12 +254,7 @@
String cacheFolder(location, SysStringLen(location));
WebCore::CurlCacheManager::getInstance().setCacheDirectory(cacheFolder);
return S_OK;
-#elif USE(CFNETWORK)
- RetainPtr<CFURLCacheRef> cache = adoptCF(CFURLCacheCopySharedURLCache());
- CFIndex memoryCapacity = CFURLCacheMemoryCapacity(cache.get());
- CFIndex diskCapacity = CFURLCacheDiskCapacity(cache.get());
- RetainPtr<CFURLCacheRef> newCache = adoptCF(CFURLCacheCreate(kCFAllocatorDefault, memoryCapacity, diskCapacity, String(location).createCFString().get()));
- CFURLCacheSetSharedURLCache(newCache.get());
- return S_OK;
+#else
+ return E_NOTIMPL;
#endif
}
Modified: trunk/Source/WebKit/win/WebDatabaseManager.cpp (207143 => 207144)
--- trunk/Source/WebKit/win/WebDatabaseManager.cpp 2016-10-11 16:28:06 UTC (rev 207143)
+++ trunk/Source/WebKit/win/WebDatabaseManager.cpp 2016-10-11 16:33:30 UTC (rev 207144)
@@ -33,7 +33,6 @@
#include "COMPropertyBag.h"
#include "MarshallingHelpers.h"
#include "WebNotificationCenter.h"
-#include "WebPreferences.h"
#include "WebSecurityOrigin.h"
#include <WebCore/BString.h>
@@ -421,7 +420,7 @@
static WTF::String databasesDirectory()
{
#if USE(CF)
- RetainPtr<CFPropertyListRef> directoryPref = adoptCF(CFPreferencesCopyAppValue(WebDatabaseDirectoryDefaultsKey, WebPreferences::applicationId()));
+ RetainPtr<CFPropertyListRef> directoryPref = adoptCF(CFPreferencesCopyAppValue(WebDatabaseDirectoryDefaultsKey, kCFPreferencesCurrentApplication));
if (directoryPref && (CFStringGetTypeID() == CFGetTypeID(directoryPref.get())))
return static_cast<CFStringRef>(directoryPref.get());
#endif
Modified: trunk/Source/WebKit/win/WebPreferences.cpp (207143 => 207144)
--- trunk/Source/WebKit/win/WebPreferences.cpp 2016-10-11 16:28:06 UTC (rev 207143)
+++ trunk/Source/WebKit/win/WebPreferences.cpp 2016-10-11 16:33:30 UTC (rev 207144)
@@ -101,8 +101,6 @@
static CFDictionaryRef defaultSettings;
-RetainPtr<CFStringRef> WebPreferences::m_applicationId = kCFPreferencesCurrentApplication;
-
static HashMap<WTF::String, COMPtr<WebPreferences>>& webPreferencesInstances()
{
static NeverDestroyed<HashMap<WTF::String, COMPtr<WebPreferences>>> webPreferencesInstances;
@@ -185,11 +183,6 @@
webPreferencesInstances().remove(identifierString);
}
-CFStringRef WebPreferences::applicationId()
-{
- return m_applicationId.get();
-}
-
void WebPreferences::initializeDefaultSettings()
{
if (defaultSettings)
@@ -313,7 +306,7 @@
if (value)
return value;
- value = adoptCF(CFPreferencesCopyAppValue(key, applicationId()));
+ value = adoptCF(CFPreferencesCopyAppValue(key, kCFPreferencesCurrentApplication));
if (value)
return value;
@@ -324,7 +317,7 @@
{
CFDictionarySetValue(m_privatePrefs.get(), key, value);
if (m_autoSaves) {
- CFPreferencesSetAppValue(key, value, applicationId());
+ CFPreferencesSetAppValue(key, value, kCFPreferencesCurrentApplication);
save();
}
}
@@ -455,7 +448,7 @@
void WebPreferences::save()
{
- CFPreferencesAppSynchronize(applicationId());
+ CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
}
void WebPreferences::load()
@@ -547,8 +540,6 @@
*ppvObject = static_cast<IWebPreferencesPrivate2*>(this);
else if (IsEqualGUID(riid, IID_IWebPreferencesPrivate3))
*ppvObject = static_cast<IWebPreferencesPrivate3*>(this);
- else if (IsEqualGUID(riid, IID_IWebPreferencesPrivate4))
- *ppvObject = static_cast<IWebPreferencesPrivate4*>(this);
else if (IsEqualGUID(riid, CLSID_WebPreferences))
*ppvObject = this;
else
@@ -2002,9 +1993,3 @@
*enabled = boolValueForKey(WebKitModernMediaControlsEnabledPreferenceKey);
return S_OK;
}
-
-HRESULT WebPreferences::setApplicationId(BSTR applicationId)
-{
- m_applicationId = String(applicationId).createCFString();
- return S_OK;
-}
Modified: trunk/Source/WebKit/win/WebPreferences.h (207143 => 207144)
--- trunk/Source/WebKit/win/WebPreferences.h 2016-10-11 16:28:06 UTC (rev 207143)
+++ trunk/Source/WebKit/win/WebPreferences.h 2016-10-11 16:33:30 UTC (rev 207144)
@@ -23,7 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#pragma once
+#ifndef WebPreferences_H
+#define WebPreferences_H
#include "WebKit.h"
#include <CoreFoundation/CoreFoundation.h>
@@ -30,7 +31,7 @@
#include <WebCore/BString.h>
#include <wtf/RetainPtr.h>
-class WebPreferences : public IWebPreferences, public IWebPreferencesPrivate4 {
+class WebPreferences : public IWebPreferences, public IWebPreferencesPrivate3 {
public:
static WebPreferences* createInstance();
protected:
@@ -243,9 +244,6 @@
virtual HRESULT STDMETHODCALLTYPE modernMediaControlsEnabled(_Out_ BOOL*);
virtual HRESULT STDMETHODCALLTYPE setModernMediaControlsEnabled(BOOL);
- // IWebPreferencesPrivate4
- virtual HRESULT STDMETHODCALLTYPE setApplicationId(BSTR);
-
// WebPreferences
// This method accesses a different preference key than developerExtrasEnabled.
@@ -259,8 +257,6 @@
static void removeReferenceForIdentifier(BSTR identifier);
static WebPreferences* sharedStandardPreferences();
- static CFStringRef applicationId();
-
// From WebHistory.h
HRESULT historyItemLimit(_Out_ int*);
HRESULT setHistoryItemLimit(int);
@@ -267,8 +263,8 @@
HRESULT historyAgeInDaysLimit(_Out_ int*);
HRESULT setHistoryAgeInDaysLimit(int);
- void willAddToWebView();
- void didRemoveFromWebView();
+ void willAddToWebView();
+ void didRemoveFromWebView();
HRESULT postPreferencesChangesNotification();
@@ -301,5 +297,6 @@
bool m_autoSaves { false };
bool m_automaticallyDetectsCacheModel { true };
unsigned m_numWebViews { 0 };
- static RetainPtr<CFStringRef> m_applicationId;
};
+
+#endif
Modified: trunk/Source/WebKit/win/WebView.cpp (207143 => 207144)
--- trunk/Source/WebKit/win/WebView.cpp 2016-10-11 16:28:06 UTC (rev 207143)
+++ trunk/Source/WebKit/win/WebView.cpp 2016-10-11 16:33:30 UTC (rev 207144)
@@ -501,7 +501,7 @@
RetainPtr<CFURLCacheRef> cfurlCache = adoptCF(CFURLCacheCopySharedURLCache());
RetainPtr<CFStringRef> cfurlCacheDirectory = adoptCF(wkCopyFoundationCacheDirectory(0));
if (!cfurlCacheDirectory) {
- RetainPtr<CFPropertyListRef> preference = adoptCF(CFPreferencesCopyAppValue(WebKitLocalCacheDefaultsKey, WebPreferences::applicationId()));
+ RetainPtr<CFPropertyListRef> preference = adoptCF(CFPreferencesCopyAppValue(WebKitLocalCacheDefaultsKey, kCFPreferencesCurrentApplication));
if (preference && (CFStringGetTypeID() == CFGetTypeID(preference.get())))
cfurlCacheDirectory = adoptCF(static_cast<CFStringRef>(preference.leakRef()));
else
Modified: trunk/Tools/ChangeLog (207143 => 207144)
--- trunk/Tools/ChangeLog 2016-10-11 16:28:06 UTC (rev 207143)
+++ trunk/Tools/ChangeLog 2016-10-11 16:33:30 UTC (rev 207144)
@@ -1,3 +1,15 @@
+2016-10-11 Ryan Haddad <[email protected]>
+
+ Unreviewed, rolling out r207067.
+
+ This change caused webkitpy test failures.
+
+ Reverted changeset:
+
+ "[Win] Parallel DRTs are sharing preferences and cache."
+ https://bugs.webkit.org/show_bug.cgi?id=163013
+ http://trac.webkit.org/changeset/207067
+
2016-10-11 Per Arne Vollan <[email protected]>
[Win] Parallel DRTs are sharing preferences and cache.
Modified: trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp (207143 => 207144)
--- trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp 2016-10-11 16:28:06 UTC (rev 207143)
+++ trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp 2016-10-11 16:33:30 UTC (rev 207144)
@@ -49,7 +49,6 @@
#include <fstream>
#include <io.h>
#include <math.h>
-#include <shlobj.h>
#include <shlwapi.h>
#include <tchar.h>
#include <wtf/NeverDestroyed.h>
@@ -860,52 +859,16 @@
setAlwaysAcceptCookies(false);
}
-static String applicationId()
-{
- DWORD processId = ::GetCurrentProcessId();
- return String::format("com.apple.DumpRenderTree.%d", processId);
-}
-
-static void setApplicationId()
-{
- COMPtr<IWebPreferences> preferences;
- if (SUCCEEDED(WebKitCreateInstance(CLSID_WebPreferences, 0, IID_IWebPreferences, (void**)&preferences))) {
- COMPtr<IWebPreferencesPrivate4> prefsPrivate4(Query, preferences);
- ASSERT(prefsPrivate4);
- _bstr_t fileName = applicationId().charactersWithNullTermination().data();
- prefsPrivate4->setApplicationId(fileName);
- }
-}
-
-static void setCacheFolder()
-{
- String libraryPath = libraryPathForDumpRenderTree();
-
- COMPtr<IWebCache> webCache;
- if (SUCCEEDED(WebKitCreateInstance(CLSID_WebCache, 0, IID_IWebCache, (void**)&webCache))) {
- _bstr_t cacheFolder = WebCore::pathByAppendingComponent(libraryPath, "LocalCache").utf8().data();
- webCache->setCacheFolder(cacheFolder);
- }
-}
-
// Called once on DumpRenderTree startup.
static void setDefaultsToConsistentValuesForTesting()
{
#if USE(CF)
- // Create separate preferences for each DRT instance
- setApplicationId();
-
- RetainPtr<CFStringRef> appId = applicationId().createCFString();
-
String libraryPath = libraryPathForDumpRenderTree();
// Set up these values before creating the WebView so that the various initializations will see these preferred values.
- CFPreferencesSetAppValue(WebDatabaseDirectoryDefaultsKey, WebCore::pathByAppendingComponent(libraryPath, "Databases").createCFString().get(), appId.get());
- CFPreferencesSetAppValue(WebStorageDirectoryDefaultsKey, WebCore::pathByAppendingComponent(libraryPath, "LocalStorage").createCFString().get(), appId.get());
- CFPreferencesSetAppValue(WebKitLocalCacheDefaultsKey, WebCore::pathByAppendingComponent(libraryPath, "LocalCache").createCFString().get(), appId.get());
-
- // Create separate cache for each DRT instance
- setCacheFolder();
+ CFPreferencesSetAppValue(WebDatabaseDirectoryDefaultsKey, WebCore::pathByAppendingComponent(libraryPath, "Databases").createCFString().get(), kCFPreferencesCurrentApplication);
+ CFPreferencesSetAppValue(WebStorageDirectoryDefaultsKey, WebCore::pathByAppendingComponent(libraryPath, "LocalStorage").createCFString().get(), kCFPreferencesCurrentApplication);
+ CFPreferencesSetAppValue(WebKitLocalCacheDefaultsKey, WebCore::pathByAppendingComponent(libraryPath, "LocalCache").createCFString().get(), kCFPreferencesCurrentApplication);
#endif
}
Modified: trunk/Tools/Scripts/webkitpy/port/win.py (207143 => 207144)
--- trunk/Tools/Scripts/webkitpy/port/win.py 2016-10-11 16:28:06 UTC (rev 207143)
+++ trunk/Tools/Scripts/webkitpy/port/win.py 2016-10-11 16:33:30 UTC (rev 207144)
@@ -28,9 +28,8 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import atexit
-import glob
+import os
import logging
-import os
import re
import sys
import time
@@ -352,12 +351,6 @@
self.setup_crash_log_saving()
self.prevent_error_dialogs()
self.delete_sem_locks()
-
- preferences_files = self._filesystem.join(os.environ['APPDATA'], "Apple Computer/Preferences", "com.apple.DumpRenderTree*")
- filelist = glob.glob(preferences_files)
- for file in filelist:
- self._filesystem.remove(file)
-
super(WinPort, self).setup_test_run(device_class)
def clean_up_test_run(self):