Optionally partition cache to prevent using cache for tracking
authorjpfau@apple.com <jpfau@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Feb 2013 00:49:17 +0000 (00:49 +0000)
committerjpfau@apple.com <jpfau@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Feb 2013 00:49:17 +0000 (00:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=110269

Reviewed by Maciej Stachowiak.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig: Add defines for cache partitioning and public suffix list usage

Source/WebCore:

Implement memory cache partitioning by passing the cache name through
resource requests into a new version of resourceForURL.

Test: http/tests/cache/partitioned-cache.html

* Configurations/FeatureDefines.xcconfig: Add defines for cache partitioning and public suffix list usage
* WebCore.exp.in: Export new functions for WKSI and test suite
* WebCore.xcodeproj/project.pbxproj:
* html/DOMURL.cpp:
(WebCore::DOMURL::revokeObjectURL): Retrofit for new resourceForRequest function
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResource): Retrofit for new resourceForRequest function
* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::replayXHR): Retrofit for new resourceForRequest function
* loader/DocumentLoader.h:
(DocumentLoader):
(WebCore::DocumentLoader::recordMemoryCacheLoadForFutureClientNotification): Retrofit for new resourceForRequest function
(WebCore::DocumentLoader::takeMemoryCacheLoadsForClientNotification): Retrofit for new resourceForRequest function
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadedResourceFromMemoryCache): Retrofit for new resourceForRequest function
(WebCore::FrameLoader::tellClientAboutPastMemoryCacheLoads): Retrofit for new resourceForRequest function
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create): Retrofit for new resourceForRequest function
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::~CachedResource):
* loader/cache/CachedResource.h: Retrofit for new resourceForRequest function
(CachedResource):
(WebCore::CachedResource::cachePartition):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet): Retrofit for new resourceForRequest function
(WebCore::CachedResourceLoader::requestResource): Retrofit for new resourceForRequest function
(WebCore::CachedResourceLoader::loadResource): Retrofit for new resourceForRequest function
* loader/cache/MemoryCache.cpp:
(WebCore):
(WebCore::partitionName): Add function for determining absolute partition name
(WebCore::MemoryCache::add): Retrofit for partition mapping
(WebCore::MemoryCache::revalidationSucceeded): Retrofit for partition mapping
(WebCore::MemoryCache::resourceForURL): Call into new resourceForRequest
(WebCore::MemoryCache::resourceForRequest): Retrofit for partition mapping
(WebCore::MemoryCache::evict): Retrofit for partition mapping
(WebCore::MemoryCache::removeResourcesWithOrigin): Retrofit for partition mapping
(WebCore::MemoryCache::getOriginsWithCache): Retrofit for partition mapping
(WebCore::MemoryCache::removeUrlFromCache): Retrofit for partition mapping
(WebCore::MemoryCache::removeRequestFromCache): Retrofit for partition mapping
(WebCore::MemoryCache::removeRequestFromCacheImpl): Retrofit for partition mapping
(WebCore::MemoryCache::crossThreadRemoveRequestFromCache): Add function for calling removeRequestFromCacheImpl that takes a CrossThreadResourceRequestData
(WebCore::MemoryCache::getStatistics): Retrofit for partition mapping
(WebCore::MemoryCache::setDisabled): Retrofit for partition mapping
* loader/cache/MemoryCache.h:
(MemoryCache):
* page/SecurityOrigin.cpp:
(WebCore):
(WebCore::SecurityOrigin::cachePartition): Add function for determining the cache partition name
* page/SecurityOrigin.h:
(SecurityOrigin):
* platform/PublicSuffix.h: Added.
(WebCore):
* platform/mac/PublicSuffixMac.mm: Added.
(WebCore):
(WebCore::isPublicSuffix):
(WebCore::topPrivatelyControlledDomain):
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:
* platform/network/cf/ResourceRequest.h:
(ResourceRequest):
(WebCore::ResourceRequest::cachePartition):
(WebCore::ResourceRequest::setCachePartition):
(CrossThreadResourceRequestData):
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::doPlatformCopyData): Pass through cache partition name
(WebCore):
(WebCore::ResourceRequest::doPlatformAdopt): Pass through cache partition name
* platform/network/mac/ResourceRequestMac.mm:
(WebCore::ResourceRequest::doUpdateResourceRequest): Pass through cache partition name
(WebCore::ResourceRequest::doUpdatePlatformRequest): Pass through cache partition name

Source/WebKit/mac:

Update WKSI bindings and add feature defines.

* Configurations/FeatureDefines.xcconfig: Add defines for cache partitioning and public suffix list usage
* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

Source/WebKit2:

Update WKSI bindings and add feature defines.

* Configurations/FeatureDefines.xcconfig: Add defines for cache partitioning and public suffix list usage
* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

Tools:

Add test suite for public suffix functions on Mac.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/PublicSuffix.mm: Added.
(TestWebKitAPI):
(TestWebKitAPI::TEST_F):

WebKitLibraries:

Update WKSI bindings.

* WebKitSystemInterface.h:
* libWebKitSystemInterfaceLion.a:
* libWebKitSystemInterfaceMountainLion.a:

LayoutTests:

Added tests for ensuring the cache partitioning functions

* http/tests/cache/partitioned-cache-expected.txt: Added.
* http/tests/cache/partitioned-cache.html: Added.
* http/tests/cache/resources/echo-cookie.cgi: Added.
* http/tests/cache/resources/partitioned-cache-loader.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@143986 268f45cc-cd09-0410-ab3c-d52691b4dbfc

44 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/cache/partitioned-cache-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/cache/partitioned-cache.html [new file with mode: 0644]
LayoutTests/http/tests/cache/resources/echo-cookie.cgi [new file with mode: 0755]
LayoutTests/http/tests/cache/resources/partitioned-cache-loader.html [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/DOMURL.cpp
Source/WebCore/inspector/InspectorPageAgent.cpp
Source/WebCore/inspector/InspectorResourceAgent.cpp
Source/WebCore/loader/DocumentLoader.h
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp
Source/WebCore/loader/cache/CachedResource.cpp
Source/WebCore/loader/cache/CachedResource.h
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/loader/cache/MemoryCache.cpp
Source/WebCore/loader/cache/MemoryCache.h
Source/WebCore/page/SecurityOrigin.cpp
Source/WebCore/page/SecurityOrigin.h
Source/WebCore/platform/PublicSuffix.h [new file with mode: 0644]
Source/WebCore/platform/mac/PublicSuffixMac.mm [new file with mode: 0644]
Source/WebCore/platform/mac/WebCoreSystemInterface.h
Source/WebCore/platform/mac/WebCoreSystemInterface.mm
Source/WebCore/platform/network/cf/ResourceRequest.h
Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp
Source/WebCore/platform/network/mac/ResourceRequestMac.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/FeatureDefines.xcconfig
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/mac/PublicSuffix.mm [new file with mode: 0644]
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLion.a
WebKitLibraries/libWebKitSystemInterfaceMountainLion.a

index 7dc9675..d398726 100644 (file)
@@ -1,3 +1,17 @@
+2013-02-21  Jeffrey Pfau  <jpfau@apple.com>
+
+        Optionally partition cache to prevent using cache for tracking
+        https://bugs.webkit.org/show_bug.cgi?id=110269
+
+        Reviewed by Maciej Stachowiak.
+
+        Added tests for ensuring the cache partitioning functions
+
+        * http/tests/cache/partitioned-cache-expected.txt: Added.
+        * http/tests/cache/partitioned-cache.html: Added.
+        * http/tests/cache/resources/echo-cookie.cgi: Added.
+        * http/tests/cache/resources/partitioned-cache-loader.html: Added.
+
 2013-02-25  Eric Seidel  <eric@webkit.org>
 
         Move html5lib/run-test* into html5lib/generated in preparation for generating these harnesses
diff --git a/LayoutTests/http/tests/cache/partitioned-cache-expected.txt b/LayoutTests/http/tests/cache/partitioned-cache-expected.txt
new file mode 100644 (file)
index 0000000..90ae89e
--- /dev/null
@@ -0,0 +1,4 @@
+CONSOLE MESSAGE: line 10: localhost
+CONSOLE MESSAGE: line 10: localhost
+FAIL response should be 127.0.0.1. Was localhost.
+
diff --git a/LayoutTests/http/tests/cache/partitioned-cache.html b/LayoutTests/http/tests/cache/partitioned-cache.html
new file mode 100644 (file)
index 0000000..6e386c4
--- /dev/null
@@ -0,0 +1,19 @@
+<html>
+<head>
+<script>
+if (window.testRunner) {
+       testRunner.dumpAsText();
+       testRunner.dumpChildFramesAsText();
+       testRunner.waitUntilDone();
+       testRunner.setCanOpenWindows(true);
+       testRunner.setCloseRemainingWindowsWhenComplete(true);
+       internals.settings.setStorageBlockingPolicy('BlockThirdParty');
+}
+
+document.location = "http://localhost:8000/cache/resources/partitioned-cache-loader.html";
+</script>
+<head>
+<body>
+This test must be run from run-webkit-tests
+</body>
+</html>
diff --git a/LayoutTests/http/tests/cache/resources/echo-cookie.cgi b/LayoutTests/http/tests/cache/resources/echo-cookie.cgi
new file mode 100755 (executable)
index 0000000..80d3c4b
--- /dev/null
@@ -0,0 +1,11 @@
+#!/usr/bin/perl -w
+
+use CGI;
+$query = new CGI;
+
+my $cookie = $query->cookie('value');
+
+print "Content-type: text/plain\n";
+print "Cache-control: max-age=3600\n";
+print "\n";
+print "var response = '${cookie}';";
diff --git a/LayoutTests/http/tests/cache/resources/partitioned-cache-loader.html b/LayoutTests/http/tests/cache/resources/partitioned-cache-loader.html
new file mode 100644 (file)
index 0000000..57ea26e
--- /dev/null
@@ -0,0 +1,24 @@
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+<script>
+       var scriptElement = document.createElement('script');
+       document.cookie = 'value=' + document.domain;
+       scriptElement.setAttribute('src', 'http://localhost:8000/cache/resources/echo-cookie.cgi');
+       document.head.appendChild(scriptElement);
+       window.onload = function() {
+               console.log(response);
+               shouldBeEqualToString('response',  document.domain);
+               if (document.domain == 'localhost') {
+                       document.cookie = 'value=127.0.0.1';
+                       document.location = 'http://127.0.0.1:8000/cache/resources/partitioned-cache-loader.html';
+               } else if (window.testRunner) {
+                       internals.settings.setStorageBlockingPolicy('AllowAll');
+                       testRunner.notifyDone();
+               }
+       };
+</script>
+</head>
+<body>
+</body>
+</html>
index 30e22cf..6dc1d50 100644 (file)
@@ -1,3 +1,12 @@
+2013-02-25  Jeffrey Pfau  <jpfau@apple.com>
+
+        Optionally partition cache to prevent using cache for tracking
+        https://bugs.webkit.org/show_bug.cgi?id=110269
+
+        Reviewed by Maciej Stachowiak.
+
+        * Configurations/FeatureDefines.xcconfig: Add defines for cache partitioning and public suffix list usage
+
 2013-02-25  Roger Fong  <roger_fong@apple.com>
 
         Unreviewed. VS2010 solution build fix.
index 25d0284..72f3501 100644 (file)
 ENABLE_3D_RENDERING = ENABLE_3D_RENDERING;
 ENABLE_ACCELERATED_2D_CANVAS = ;
 ENABLE_BLOB = ENABLE_BLOB;
+ENABLE_CACHE_PARTITIONING = $(ENABLE_CACHE_PARTITIONING_$(PLATFORM_NAME));
+ENABLE_CACHE_PARTITIONING_macosx = $(ENABLE_CACHE_PARTITIONING_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+ENABLE_CACHE_PARTITIONING_macosx_1070 = ;
+ENABLE_CACHE_PARTITIONING_macosx_1080 = ;
+ENABLE_CACHE_PARTITIONING_macosx_1090 = ENABLE_CACHE_PARTITIONING;
 ENABLE_CANVAS_PATH = ENABLE_CANVAS_PATH;
 ENABLE_CANVAS_PROXY = ;
 ENABLE_CHANNEL_MESSAGING = ENABLE_CHANNEL_MESSAGING;
@@ -141,6 +146,11 @@ ENABLE_PLUGIN_PROXY_FOR_VIDEO_iphoneos = ENABLE_PLUGIN_PROXY_FOR_VIDEO;
 ENABLE_PLUGIN_PROXY_FOR_VIDEO_iphonesimulator = $(ENABLE_PLUGIN_PROXY_FOR_VIDEO_iphoneos);
 ENABLE_PROGRESS_ELEMENT = ENABLE_PROGRESS_ELEMENT;
 ENABLE_PROXIMITY_EVENTS = ;
+ENABLE_PUBLIC_SUFFIX_LIST = $(ENABLE_PUBLIC_SUFFIX_LIST_$(PLATFORM_NAME));
+ENABLE_PUBLIC_SUFFIX_LIST_macosx = $(ENABLE_PUBLIC_SUFFIX_LIST_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+ENABLE_PUBLIC_SUFFIX_LIST_macosx_1070 = ;
+ENABLE_PUBLIC_SUFFIX_LIST_macosx_1080 = ;
+ENABLE_PUBLIC_SUFFIX_LIST_macosx_1090 = ENABLE_PUBLIC_SUFFIX_LIST;
 ENABLE_QUOTA = ;
 ENABLE_REQUEST_ANIMATION_FRAME = ENABLE_REQUEST_ANIMATION_FRAME;
 ENABLE_RESOLUTION_MEDIA_QUERY = ;
@@ -171,4 +181,4 @@ ENABLE_WORKERS = ENABLE_WORKERS;
 ENABLE_XHR_TIMEOUT = ENABLE_XHR_TIMEOUT;
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_BLOB) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PLUGIN_PROXY_FOR_VIDEO) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(FEATURE_DEFINES_$(PLATFORM_NAME));
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_BLOB) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PLUGIN_PROXY_FOR_VIDEO) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(FEATURE_DEFINES_$(PLATFORM_NAME));
index 51d3512..143b405 100644 (file)
@@ -1,3 +1,86 @@
+2013-02-21  Jeffrey Pfau  <jpfau@apple.com>
+
+        Optionally partition cache to prevent using cache for tracking
+        https://bugs.webkit.org/show_bug.cgi?id=110269
+
+        Reviewed by Maciej Stachowiak.
+
+        Implement memory cache partitioning by passing the cache name through
+        resource requests into a new version of resourceForURL.
+
+        Test: http/tests/cache/partitioned-cache.html
+
+        * Configurations/FeatureDefines.xcconfig: Add defines for cache partitioning and public suffix list usage
+        * WebCore.exp.in: Export new functions for WKSI and test suite
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/DOMURL.cpp:
+        (WebCore::DOMURL::revokeObjectURL): Retrofit for new resourceForRequest function
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::cachedResource): Retrofit for new resourceForRequest function
+        * inspector/InspectorResourceAgent.cpp:
+        (WebCore::InspectorResourceAgent::replayXHR): Retrofit for new resourceForRequest function
+        * loader/DocumentLoader.h:
+        (DocumentLoader):
+        (WebCore::DocumentLoader::recordMemoryCacheLoadForFutureClientNotification): Retrofit for new resourceForRequest function
+        (WebCore::DocumentLoader::takeMemoryCacheLoadsForClientNotification): Retrofit for new resourceForRequest function
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::loadedResourceFromMemoryCache): Retrofit for new resourceForRequest function
+        (WebCore::FrameLoader::tellClientAboutPastMemoryCacheLoads): Retrofit for new resourceForRequest function
+        * loader/archive/cf/LegacyWebArchive.cpp:
+        (WebCore::LegacyWebArchive::create): Retrofit for new resourceForRequest function
+        * loader/cache/CachedResource.cpp:
+        (WebCore::CachedResource::~CachedResource):
+        * loader/cache/CachedResource.h: Retrofit for new resourceForRequest function
+        (CachedResource):
+        (WebCore::CachedResource::cachePartition):
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): Retrofit for new resourceForRequest function
+        (WebCore::CachedResourceLoader::requestResource): Retrofit for new resourceForRequest function
+        (WebCore::CachedResourceLoader::loadResource): Retrofit for new resourceForRequest function
+        * loader/cache/MemoryCache.cpp:
+        (WebCore):
+        (WebCore::partitionName): Add function for determining absolute partition name
+        (WebCore::MemoryCache::add): Retrofit for partition mapping
+        (WebCore::MemoryCache::revalidationSucceeded): Retrofit for partition mapping
+        (WebCore::MemoryCache::resourceForURL): Call into new resourceForRequest
+        (WebCore::MemoryCache::resourceForRequest): Retrofit for partition mapping
+        (WebCore::MemoryCache::evict): Retrofit for partition mapping
+        (WebCore::MemoryCache::removeResourcesWithOrigin): Retrofit for partition mapping
+        (WebCore::MemoryCache::getOriginsWithCache): Retrofit for partition mapping
+        (WebCore::MemoryCache::removeUrlFromCache): Retrofit for partition mapping
+        (WebCore::MemoryCache::removeRequestFromCache): Retrofit for partition mapping
+        (WebCore::MemoryCache::removeRequestFromCacheImpl): Retrofit for partition mapping
+        (WebCore::MemoryCache::crossThreadRemoveRequestFromCache): Add function for calling removeRequestFromCacheImpl that takes a CrossThreadResourceRequestData
+        (WebCore::MemoryCache::getStatistics): Retrofit for partition mapping
+        (WebCore::MemoryCache::setDisabled): Retrofit for partition mapping
+        * loader/cache/MemoryCache.h:
+        (MemoryCache):
+        * page/SecurityOrigin.cpp:
+        (WebCore):
+        (WebCore::SecurityOrigin::cachePartition): Add function for determining the cache partition name
+        * page/SecurityOrigin.h:
+        (SecurityOrigin):
+        * platform/PublicSuffix.h: Added.
+        (WebCore):
+        * platform/mac/PublicSuffixMac.mm: Added.
+        (WebCore):
+        (WebCore::isPublicSuffix):
+        (WebCore::topPrivatelyControlledDomain):
+        * platform/mac/WebCoreSystemInterface.h:
+        * platform/mac/WebCoreSystemInterface.mm:
+        * platform/network/cf/ResourceRequest.h:
+        (ResourceRequest):
+        (WebCore::ResourceRequest::cachePartition):
+        (WebCore::ResourceRequest::setCachePartition):
+        (CrossThreadResourceRequestData):
+        * platform/network/cf/ResourceRequestCFNet.cpp:
+        (WebCore::ResourceRequest::doPlatformCopyData): Pass through cache partition name
+        (WebCore):
+        (WebCore::ResourceRequest::doPlatformAdopt): Pass through cache partition name
+        * platform/network/mac/ResourceRequestMac.mm:
+        (WebCore::ResourceRequest::doUpdateResourceRequest): Pass through cache partition name
+        (WebCore::ResourceRequest::doUpdatePlatformRequest): Pass through cache partition name
+
 2013-02-25  Jer Noble  <jer.noble@apple.com>
 
         Normalize ENABLE_ENCRYPTED_MEDIA definitions across all FeatureDefines files.
index 2b9f3c9..d850383 100644 (file)
 ENABLE_3D_RENDERING = ENABLE_3D_RENDERING;
 ENABLE_ACCELERATED_2D_CANVAS = ;
 ENABLE_BLOB = ENABLE_BLOB;
+ENABLE_CACHE_PARTITIONING = $(ENABLE_CACHE_PARTITIONING_$(PLATFORM_NAME));
+ENABLE_CACHE_PARTITIONING_macosx = $(ENABLE_CACHE_PARTITIONING_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+ENABLE_CACHE_PARTITIONING_macosx_1070 = ;
+ENABLE_CACHE_PARTITIONING_macosx_1080 = ;
+ENABLE_CACHE_PARTITIONING_macosx_1090 = ENABLE_CACHE_PARTITIONING;
 ENABLE_CANVAS_PATH = ENABLE_CANVAS_PATH;
 ENABLE_CANVAS_PROXY = ;
 ENABLE_CHANNEL_MESSAGING = ENABLE_CHANNEL_MESSAGING;
@@ -141,6 +146,11 @@ ENABLE_PLUGIN_PROXY_FOR_VIDEO_iphoneos = ENABLE_PLUGIN_PROXY_FOR_VIDEO;
 ENABLE_PLUGIN_PROXY_FOR_VIDEO_iphonesimulator = $(ENABLE_PLUGIN_PROXY_FOR_VIDEO_iphoneos);
 ENABLE_PROGRESS_ELEMENT = ENABLE_PROGRESS_ELEMENT;
 ENABLE_PROXIMITY_EVENTS = ;
+ENABLE_PUBLIC_SUFFIX_LIST = $(ENABLE_PUBLIC_SUFFIX_LIST_$(PLATFORM_NAME));
+ENABLE_PUBLIC_SUFFIX_LIST_macosx = $(ENABLE_PUBLIC_SUFFIX_LIST_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+ENABLE_PUBLIC_SUFFIX_LIST_macosx_1070 = ;
+ENABLE_PUBLIC_SUFFIX_LIST_macosx_1080 = ;
+ENABLE_PUBLIC_SUFFIX_LIST_macosx_1090 = ENABLE_PUBLIC_SUFFIX_LIST;
 ENABLE_QUOTA = ;
 ENABLE_REQUEST_ANIMATION_FRAME = ENABLE_REQUEST_ANIMATION_FRAME;
 ENABLE_RESOLUTION_MEDIA_QUERY = ;
@@ -171,4 +181,4 @@ ENABLE_WORKERS = ENABLE_WORKERS;
 ENABLE_XHR_TIMEOUT = ENABLE_XHR_TIMEOUT;
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_BLOB) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PLUGIN_PROXY_FOR_VIDEO) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(FEATURE_DEFINES_$(PLATFORM_NAME));
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_BLOB) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PLUGIN_PROXY_FOR_VIDEO) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(FEATURE_DEFINES_$(PLATFORM_NAME));
index a5e3175..c3e7a92 100644 (file)
@@ -1544,17 +1544,26 @@ __ZTVN7WebCore25PlatformSpeechSynthesizerE
 #endif
 __ZTVN7WebCore28InspectorFrontendClientLocal8SettingsE
 __ZN7WebCore16CSSParserContextC1EPNS_8DocumentERKNS_4KURLERKN3WTF6StringE
+#if ENABLE(PUBLIC_SUFFIX_LIST)
+__ZN7WebCore14isPublicSuffixERKN3WTF6StringE
+#endif
 __ZN7WebCore18StyleSheetContents11parseStringERKN3WTF6StringE
 __ZN7WebCore18StyleSheetContentsC1EPNS_15StyleRuleImportERKN3WTF6StringERKNS_16CSSParserContextE
 __ZN7WebCore18StyleSheetContentsD1Ev
 __ZN7WebCore28DocumentStyleSheetCollection12addUserSheetEN3WTF10PassRefPtrINS_18StyleSheetContentsEEE
 __ZN7WebCore28DocumentStyleSheetCollection14addAuthorSheetEN3WTF10PassRefPtrINS_18StyleSheetContentsEEE
+#if ENABLE(PUBLIC_SUFFIX_LIST)
+__ZN7WebCore28topPrivatelyControlledDomainERKN3WTF6StringE
+#endif
 _filenameByFixingIllegalCharacters
 _hasCaseInsensitivePrefix
 _hasCaseInsensitiveSubstring
 _hasCaseInsensitiveSuffix
 _stringIsCaseInsensitiveEqualToString
 _suggestedFilenameWithMIMEType
+#if ENABLE(CACHE_PARTITIONING)
+_wkCachePartitionKey
+#endif
 _wkCGContextGetShouldSmoothFonts
 _wkCGContextResetClip
 #if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
@@ -1588,6 +1597,9 @@ _wkGetUserToBaseCTM
 _wkHTTPCookies
 _wkHTTPCookiesForURL
 _wkInitializeMaximumHTTPConnectionCountPerHost
+#if ENABLE(PUBLIC_SUFFIX_LIST)
+_wkIsPublicSuffix
+#endif
 _wkSetBaseCTM
 _wkSetCFURLResponseMIMEType
 _wkSetCONNECTProxyAuthorizationForStream
index 10a3694..2da155d 100644 (file)
@@ -48,6 +48,8 @@
                0014628A103CD1DE000B20DB /* OriginAccessEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00146288103CD1DE000B20DB /* OriginAccessEntry.cpp */; };
                0014628B103CD1DE000B20DB /* OriginAccessEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 00146289103CD1DE000B20DB /* OriginAccessEntry.h */; };
                003F1FEA11E6AB43008258D9 /* UserContentTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 003F1FE911E6AB43008258D9 /* UserContentTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               0081FEFF16B0A2B6008AAA7A /* PublicSuffixMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0081FEFE16B0A2B6008AAA7A /* PublicSuffixMac.mm */; };
+               0081FF0016B0A2D3008AAA7A /* PublicSuffix.h in Headers */ = {isa = PBXBuildFile; fileRef = 0081FEFD16B0A244008AAA7A /* PublicSuffix.h */; settings = {ATTRIBUTES = (Private, ); }; };
                00B9318713BA8DB30035A948 /* XMLDocumentParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00B9318113BA867F0035A948 /* XMLDocumentParser.cpp */; };
                00B9318813BA8DBA0035A948 /* XMLDocumentParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 00B9318213BA867F0035A948 /* XMLDocumentParser.h */; };
                00B9318913BA8DBC0035A948 /* XMLDocumentParserLibxml2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00B9318313BA867F0035A948 /* XMLDocumentParserLibxml2.cpp */; };
                00146288103CD1DE000B20DB /* OriginAccessEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OriginAccessEntry.cpp; sourceTree = "<group>"; };
                00146289103CD1DE000B20DB /* OriginAccessEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OriginAccessEntry.h; sourceTree = "<group>"; };
                003F1FE911E6AB43008258D9 /* UserContentTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserContentTypes.h; sourceTree = "<group>"; };
+               0081FEFD16B0A244008AAA7A /* PublicSuffix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PublicSuffix.h; sourceTree = "<group>"; };
+               0081FEFE16B0A2B6008AAA7A /* PublicSuffixMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PublicSuffixMac.mm; path = ../mac/PublicSuffixMac.mm; sourceTree = "<group>"; };
                00B9318113BA867F0035A948 /* XMLDocumentParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLDocumentParser.cpp; sourceTree = "<group>"; };
                00B9318213BA867F0035A948 /* XMLDocumentParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLDocumentParser.h; sourceTree = "<group>"; };
                00B9318313BA867F0035A948 /* XMLDocumentParserLibxml2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLDocumentParserLibxml2.cpp; sourceTree = "<group>"; };
                                29E4D8E016B0959800C84704 /* PlatformSpeechSynthesizerMac.mm */,
                                D39D006C11F8E308006041F2 /* PopupMenuMac.h */,
                                0668E18E0ADD9640004128E0 /* PopupMenuMac.mm */,
+                               0081FEFE16B0A2B6008AAA7A /* PublicSuffixMac.mm */,
                                E4D687760ED7AE3D006EA978 /* PurgeableBufferMac.cpp */,
                                BC0B358214C4F9540055E22A /* RunLoopMac.mm */,
                                1CE24F960D7CAF0E007E04C2 /* SchedulePairMac.mm */,
                                BC3BE12A0E98092F00835588 /* PopupMenuStyle.h */,
                                986EA88215FFF29000985E5E /* PrerenderClient.h */,
                                9856F8D01549E84F00B04F3A /* PrerenderHandle.h */,
+                               0081FEFD16B0A244008AAA7A /* PublicSuffix.h */,
                                E4D687780ED7AE4F006EA978 /* PurgeableBuffer.h */,
                                7E33CD00127F340D00BE8F17 /* PurgePriority.h */,
                                A72EA3BA1585CF55004FAA26 /* RefCountedSupplement.h */,
                                51A052561058874000CC9E95 /* ProtectionSpaceHash.h in Headers */,
                                1AF8E11A1256592600230FF7 /* ProxyServer.h in Headers */,
                                FF945ECC161F7F3600971BC8 /* PseudoElement.h in Headers */,
+                               0081FF0016B0A2D3008AAA7A /* PublicSuffix.h in Headers */,
                                10FB084B14E15C7E00A3DB98 /* PublicURLManager.h in Headers */,
                                E4D687790ED7AE4F006EA978 /* PurgeableBuffer.h in Headers */,
                                7E33CD01127F340D00BE8F17 /* PurgePriority.h in Headers */,
                                1AF8E13312565A4400230FF7 /* ProxyServer.cpp in Sources */,
                                1AF8E1C3125673E000230FF7 /* ProxyServerCFNet.cpp in Sources */,
                                FF945ECB161F7F3600971BC8 /* PseudoElement.cpp in Sources */,
+                               0081FEFF16B0A2B6008AAA7A /* PublicSuffixMac.mm in Sources */,
                                E4D687770ED7AE3D006EA978 /* PurgeableBufferMac.cpp in Sources */,
                                550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */,
                                379E371613736A6600B9E919 /* QuotedPrintable.cpp in Sources */,
index f658626..b413594 100644 (file)
@@ -114,7 +114,11 @@ void DOMURL::revokeObjectURL(ScriptExecutionContext* scriptExecutionContext, con
     if (!scriptExecutionContext)
         return;
 
-    MemoryCache::removeUrlFromCache(scriptExecutionContext, urlString);
+    ResourceRequest request(urlString);
+#if ENABLE(CACHE_PARTITIONING)
+    request.setCachePartition(scriptExecutionContext->topOrigin()->cachePartition());
+#endif
+    MemoryCache::removeRequestFromCache(scriptExecutionContext, request);
 
     KURL url(KURL(), urlString);
     HashSet<String>& blobURLs = scriptExecutionContext->publicURLManager().blobURLs();
index 7e9c360..1dd6b6e 100644 (file)
@@ -267,8 +267,14 @@ void InspectorPageAgent::resourceContent(ErrorString* errorString, Frame* frame,
 CachedResource* InspectorPageAgent::cachedResource(Frame* frame, const KURL& url)
 {
     CachedResource* cachedResource = frame->document()->cachedResourceLoader()->cachedResource(url);
-    if (!cachedResource)
-        cachedResource = memoryCache()->resourceForURL(url);
+    if (!cachedResource) {
+        ResourceRequest request(url);
+#if ENABLE(CACHE_PARTITIONING)
+        request.setCachePartition(frame->document()->topOrigin()->cachePartition());
+#endif
+        cachedResource = memoryCache()->resourceForRequest(request);
+    }
+
     return cachedResource;
 }
 
index fe30662..fbff3a1 100644 (file)
@@ -63,6 +63,7 @@
 #include "ScriptCallStack.h"
 #include "ScriptCallStackFactory.h"
 #include "ScriptableDocumentParser.h"
+#include "Settings.h"
 #include "SubresourceLoader.h"
 #include "WebSocketFrame.h"
 #include "WebSocketHandshakeRequest.h"
@@ -609,7 +610,11 @@ void InspectorResourceAgent::replayXHR(ErrorString*, const String& requestId)
     if (!xhrReplayData)
         return;
 
-    CachedResource* cachedResource = memoryCache()->resourceForURL(xhrReplayData->url());
+    ResourceRequest request(xhrReplayData->url());
+#if ENABLE(CACHE_PARTITIONING)
+    request.setCachePartition(m_pageAgent->mainFrame()->document()->topOrigin()->cachePartition());
+#endif
+    CachedResource* cachedResource = memoryCache()->resourceForRequest(request);
     if (cachedResource)
         memoryCache()->remove(cachedResource);
 
index 0e5cea1..d74c706 100644 (file)
@@ -234,8 +234,8 @@ namespace WebCore {
                 m_resourcesClientKnowsAbout.add(url);
         }
         bool haveToldClientAboutLoad(const String& url) { return m_resourcesClientKnowsAbout.contains(url); }
-        void recordMemoryCacheLoadForFutureClientNotification(const String& url);
-        void takeMemoryCacheLoadsForClientNotification(Vector<String>& loads);
+        void recordMemoryCacheLoadForFutureClientNotification(const ResourceRequest&);
+        void takeMemoryCacheLoadsForClientNotification(Vector<ResourceRequest>& loads);
 
         DocumentLoadTiming* timing() { return &m_documentLoadTiming; }
         void resetTiming() { m_documentLoadTiming = DocumentLoadTiming(); }
@@ -344,7 +344,7 @@ namespace WebCore {
 #endif
 
         HashSet<String> m_resourcesClientKnowsAbout;
-        Vector<String> m_resourcesLoadedFromMemoryCacheForClientNotification;
+        Vector<ResourceRequest> m_resourcesLoadedFromMemoryCacheForClientNotification;
         
         String m_clientRedirectSourceForHistory;
         bool m_didCreateGlobalHistoryEntry;
@@ -358,12 +358,12 @@ namespace WebCore {
         OwnPtr<ApplicationCacheHost> m_applicationCacheHost;
     };
 
-    inline void DocumentLoader::recordMemoryCacheLoadForFutureClientNotification(const String& url)
+    inline void DocumentLoader::recordMemoryCacheLoadForFutureClientNotification(const ResourceRequest& request)
     {
-        m_resourcesLoadedFromMemoryCacheForClientNotification.append(url);
+        m_resourcesLoadedFromMemoryCacheForClientNotification.append(request);
     }
 
-    inline void DocumentLoader::takeMemoryCacheLoadsForClientNotification(Vector<String>& loadsSet)
+    inline void DocumentLoader::takeMemoryCacheLoadsForClientNotification(Vector<ResourceRequest>& loadsSet)
     {
         loadsSet.swap(m_resourcesLoadedFromMemoryCacheForClientNotification);
         m_resourcesLoadedFromMemoryCacheForClientNotification.clear();
index 976b7ae..c772c44 100644 (file)
@@ -2899,7 +2899,7 @@ void FrameLoader::loadedResourceFromMemoryCache(CachedResource* resource)
 
     if (!page->areMemoryCacheClientCallsEnabled()) {
         InspectorInstrumentation::didLoadResourceFromMemoryCache(page, m_documentLoader.get(), resource);
-        m_documentLoader->recordMemoryCacheLoadForFutureClientNotification(resource->url());
+        m_documentLoader->recordMemoryCacheLoadForFutureClientNotification(resource->resourceRequest());
         m_documentLoader->didTellClientAboutLoad(resource->url());
         return;
     }
@@ -3278,12 +3278,12 @@ void FrameLoader::tellClientAboutPastMemoryCacheLoads()
     if (!m_documentLoader)
         return;
 
-    Vector<String> pastLoads;
+    Vector<ResourceRequest> pastLoads;
     m_documentLoader->takeMemoryCacheLoadsForClientNotification(pastLoads);
 
     size_t size = pastLoads.size();
     for (size_t i = 0; i < size; ++i) {
-        CachedResource* resource = memoryCache()->resourceForURL(KURL(ParsedURLString, pastLoads[i]));
+        CachedResource* resource = memoryCache()->resourceForRequest(pastLoads[i]);
 
         // FIXME: These loads, loaded from cache, but now gone from the cache by the time
         // Page::setMemoryCacheClientCallsEnabled(true) is called, will not be seen by the client.
index d77f874..d622aca 100644 (file)
@@ -553,7 +553,11 @@ PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(const String& markupString
                     continue;
                 }
 
-                CachedResource* cachedResource = memoryCache()->resourceForURL(subresourceURL);
+                ResourceRequest request(subresourceURL);
+#if ENABLE(CACHE_PARTITIONING)
+                request.setCachePartition(frame->document()->topOrigin()->cachePartition());
+#endif
+                CachedResource* cachedResource = memoryCache()->resourceForRequest(request);
                 if (cachedResource) {
                     ResourceBuffer* data = cachedResource->resourceBuffer();
                     resource = ArchiveResource::create(data ? data->sharedBuffer() : 0, subresourceURL, cachedResource->response());
index 8f6d7b8..e9974a1 100644 (file)
@@ -247,7 +247,7 @@ CachedResource::~CachedResource()
     ASSERT(canDelete());
     ASSERT(!inCache());
     ASSERT(!m_deleted);
-    ASSERT(url().isNull() || memoryCache()->resourceForURL(KURL(ParsedURLString, url())) != this);
+    ASSERT(url().isNull() || memoryCache()->resourceForRequest(resourceRequest()) != this);
 
 #ifndef NDEBUG
     m_deleted = true;
index 2d65927..27b08db 100644 (file)
@@ -111,6 +111,9 @@ public:
 
     ResourceRequest& resourceRequest() { return m_resourceRequest; }
     const KURL& url() const { return m_resourceRequest.url();}
+#if ENABLE(CACHE_PARTITIONING)
+    const String& cachePartition() const { return m_resourceRequest.cachePartition(); }
+#endif
     Type type() const { return static_cast<Type>(m_type); }
     
     ResourceLoadPriority loadPriority() const { return m_loadPriority; }
index 81435ac..c51fb7b 100644 (file)
@@ -200,7 +200,11 @@ CachedResourceHandle<CachedCSSStyleSheet> CachedResourceLoader::requestUserCSSSt
 {
     KURL url = MemoryCache::removeFragmentIdentifierIfNeeded(request.resourceRequest().url());
 
-    if (CachedResource* existing = memoryCache()->resourceForURL(url)) {
+#if ENABLE(CACHE_PARTITIONING)
+    request.mutableResourceRequest().setCachePartition(document()->topOrigin()->cachePartition());
+#endif
+
+    if (CachedResource* existing = memoryCache()->resourceForRequest(request.resourceRequest())) {
         if (existing->type() == CachedResource::CSSStyleSheet)
             return static_cast<CachedCSSStyleSheet*>(existing);
         memoryCache()->remove(existing);
@@ -443,7 +447,13 @@ CachedResourceHandle<CachedResource> CachedResourceLoader::requestResource(Cache
     }
 
     // See if we can use an existing resource from the cache.
-    CachedResourceHandle<CachedResource> resource = memoryCache()->resourceForURL(url);
+    CachedResourceHandle<CachedResource> resource;
+#if ENABLE(CACHE_PARTITIONING)
+    if (document())
+        request.mutableResourceRequest().setCachePartition(document()->topOrigin()->cachePartition());
+#endif
+
+    resource = memoryCache()->resourceForRequest(request.resourceRequest());
 
     const RevalidationPolicy policy = determineRevalidationPolicy(type, request.mutableResourceRequest(), request.forPreload(), resource.get(), request.defer());
     switch (policy) {
@@ -529,7 +539,7 @@ CachedResourceHandle<CachedResource> CachedResourceLoader::revalidateResource(co
 
 CachedResourceHandle<CachedResource> CachedResourceLoader::loadResource(CachedResource::Type type, CachedResourceRequest& request, const String& charset)
 {
-    ASSERT(!memoryCache()->resourceForURL(request.resourceRequest().url()));
+    ASSERT(!memoryCache()->resourceForRequest(request.resourceRequest()));
 
     LOG(ResourceLoading, "Loading CachedResource for '%s'.", request.resourceRequest().url().string().latin1().data());
 
index 966d85b..2373c6e 100644 (file)
@@ -36,6 +36,7 @@
 #include "FrameView.h"
 #include "Image.h"
 #include "Logging.h"
+#include "PublicSuffix.h"
 #include "ResourceHandle.h"
 #include "SecurityOrigin.h"
 #include "SecurityOriginHash.h"
@@ -61,6 +62,22 @@ static const double cMinDelayBeforeLiveDecodedPrune = 1; // Seconds.
 static const float cTargetPrunePercentage = .95f; // Percentage of capacity toward which we prune, to avoid immediately pruning again.
 static const double cDefaultDecodedDataDeletionInterval = 0;
 
+#if ENABLE(CACHE_PARTITIONING)
+static String partitionName(String domain)
+{
+    if (domain.isNull())
+        return emptyString();
+#if ENABLE(PUBLIC_SUFFIX_LIST)
+    String highLevel = topPrivatelyControlledDomain(domain);
+    if (highLevel.isNull())
+        return emptyString();
+    return highLevel;
+#else
+    return domain;
+#endif
+}
+#endif
+
 MemoryCache* memoryCache()
 {
     static MemoryCache* staticCache = new MemoryCache;
@@ -103,7 +120,16 @@ bool MemoryCache::add(CachedResource* resource)
 
     ASSERT(WTF::isMainThread());
 
+#if ENABLE(CACHE_PARTITIONING)
+    CachedResourceItem* originMap = m_resources.get(resource->url());
+    if (!originMap) {
+        originMap = new CachedResourceItem;
+        m_resources.set(resource->url(), adoptPtr(originMap));
+    }
+    originMap->set(partitionName(resource->cachePartition()), resource);
+#else
     m_resources.set(resource->url(), resource);
+#endif
     resource->setInCache(true);
     
     resourceAccessed(resource);
@@ -127,8 +153,18 @@ void MemoryCache::revalidationSucceeded(CachedResource* revalidatingResource, co
 
     evict(revalidatingResource);
 
+#if ENABLE(CACHE_PARTITIONING)
+    ASSERT(!m_resources.get(resource->url()) || !m_resources.get(resource->url())->get(partitionName(resource->cachePartition())));
+    CachedResourceItem* originMap = m_resources.get(resource->url());
+    if (!originMap) {
+        originMap = new CachedResourceItem;
+        m_resources.set(resource->url(), adoptPtr(originMap));
+    }
+    originMap->set(partitionName(resource->cachePartition()), resource);
+#else
     ASSERT(!m_resources.get(resource->url()));
     m_resources.set(resource->url(), resource);
+#endif
     resource->setInCache(true);
     resource->updateResponseAfterRevalidation(response);
     insertInLRUList(resource);
@@ -154,9 +190,21 @@ void MemoryCache::revalidationFailed(CachedResource* revalidatingResource)
 
 CachedResource* MemoryCache::resourceForURL(const KURL& resourceURL)
 {
+    return resourceForRequest(ResourceRequest(resourceURL));
+}
+
+CachedResource* MemoryCache::resourceForRequest(const ResourceRequest& request)
+{
     ASSERT(WTF::isMainThread());
-    KURL url = removeFragmentIdentifierIfNeeded(resourceURL);
+    KURL url = removeFragmentIdentifierIfNeeded(request.url());
+#if ENABLE(CACHE_PARTITIONING)
+    CachedResourceItem* item = m_resources.get(url);
+    CachedResource* resource = 0;
+    if (item)
+        resource = item->get(partitionName(request.cachePartition()));
+#else
     CachedResource* resource = m_resources.get(url);
+#endif
     bool wasPurgeable = MemoryCache::shouldMakeResourcePurgeableOnEviction() && resource && resource->isPurgeable();
     if (resource && !resource->makePurgeable(false)) {
         ASSERT(!resource->hasClients());
@@ -395,7 +443,16 @@ void MemoryCache::evict(CachedResource* resource)
     // who needed a fresh copy for a reload. See <http://bugs.webkit.org/show_bug.cgi?id=12479#c6>.
     if (resource->inCache()) {
         // Remove from the resource map.
+#if ENABLE(CACHE_PARTITIONING)
+        CachedResourceItem* item = m_resources.get(resource->url());
+        if (item) {
+            item->remove(partitionName(resource->cachePartition()));
+            if (!item->size())
+                m_resources.remove(resource->url());
+        }
+#else
         m_resources.remove(resource->url());
+#endif
         resource->setInCache(false);
 
         // Remove from the appropriate LRU list.
@@ -408,7 +465,11 @@ void MemoryCache::evict(CachedResource* resource)
         if (!MemoryCache::shouldMakeResourcePurgeableOnEviction() || !resource->isPurgeable())
             adjustSize(resource->hasClients(), -static_cast<int>(resource->size()));
     } else
+#if ENABLE(CACHE_PARTITIONING)
+        ASSERT(!m_resources.get(resource->url()) || m_resources.get(resource->url())->get(partitionName(resource->cachePartition())) != resource);
+#else
         ASSERT(m_resources.get(resource->url()) != resource);
+#endif
 
     resource->deleteIfPossible();
 }
@@ -529,12 +590,20 @@ void MemoryCache::removeResourcesWithOrigin(SecurityOrigin* origin)
 
     CachedResourceMap::iterator e = m_resources.end();
     for (CachedResourceMap::iterator it = m_resources.begin(); it != e; ++it) {
-        CachedResource* resource = it->value;
-        RefPtr<SecurityOrigin> resourceOrigin = SecurityOrigin::createFromString(resource->url());
-        if (!resourceOrigin)
-            continue;
-        if (resourceOrigin->equal(origin))
-            resourcesWithOrigin.append(resource);
+#if ENABLE(CACHE_PARTITIONING)
+        for (CachedResourceItem::iterator itemIterator = it->value->begin(); itemIterator != it->value->end(); ++itemIterator) {
+            CachedResource* resource = itemIterator->value;
+#else
+            CachedResource* resource = it->value;
+#endif
+            RefPtr<SecurityOrigin> resourceOrigin = SecurityOrigin::createFromString(resource->url());
+            if (!resourceOrigin)
+                continue;
+            if (resourceOrigin->equal(origin))
+                resourcesWithOrigin.append(resource);
+#if ENABLE(CACHE_PARTITIONING)
+        }
+#endif
     }
 
     for (size_t i = 0; i < resourcesWithOrigin.size(); ++i)
@@ -545,7 +614,11 @@ void MemoryCache::getOriginsWithCache(SecurityOriginSet& origins)
 {
     CachedResourceMap::iterator e = m_resources.end();
     for (CachedResourceMap::iterator it = m_resources.begin(); it != e; ++it)
+#if ENABLE(CACHE_PARTITIONING)
+        origins.add(SecurityOrigin::createFromString(it->value->begin()->value->url()));
+#else
         origins.add(SecurityOrigin::createFromString(it->value->url()));
+#endif
 }
 
 void MemoryCache::removeFromLiveDecodedResourcesList(CachedResource* resource)
@@ -638,28 +711,36 @@ void MemoryCache::adjustSize(bool live, int delta)
     }
 }
 
+void MemoryCache::removeUrlFromCache(ScriptExecutionContext* context, const String& urlString)
+{
+    removeRequestFromCache(context, ResourceRequest(urlString));
+}
 
-void MemoryCache::removeUrlFromCache(ScriptExecutionContext* context, const String& urlString) 
+void MemoryCache::removeRequestFromCache(ScriptExecutionContext* context, const ResourceRequest& request)
 {
 #if ENABLE(WORKERS)
     if (context->isWorkerContext()) {
-      WorkerContext* workerContext = static_cast<WorkerContext*>(context);
-      workerContext->thread()->workerLoaderProxy().postTaskToLoader(
-          createCallbackTask(&removeUrlFromCacheImpl, urlString));
-      return;
+        WorkerContext* workerContext = static_cast<WorkerContext*>(context);
+        workerContext->thread()->workerLoaderProxy().postTaskToLoader(createCallbackTask(&crossThreadRemoveRequestFromCache, request));
+        return;
     }
 #endif
-    removeUrlFromCacheImpl(context, urlString);
+
+    removeRequestFromCacheImpl(context, request);
 }
 
-void MemoryCache::removeUrlFromCacheImpl(ScriptExecutionContext*, const String& urlString)
+void MemoryCache::removeRequestFromCacheImpl(ScriptExecutionContext*, const ResourceRequest& request)
 {
-    KURL url(KURL(), urlString);
-
-    if (CachedResource* resource = memoryCache()->resourceForURL(url))
+    if (CachedResource* resource = memoryCache()->resourceForRequest(request))
         memoryCache()->remove(resource);
 }
 
+void MemoryCache::crossThreadRemoveRequestFromCache(ScriptExecutionContext* context, PassOwnPtr<WebCore::CrossThreadResourceRequestData> requestData)
+{
+    OwnPtr<ResourceRequest> request(ResourceRequest::adopt(requestData));
+    MemoryCache::removeRequestFromCacheImpl(context, *request);
+}
+
 void MemoryCache::TypeStatistic::addResource(CachedResource* o)
 {
     bool purged = o->wasPurged();
@@ -678,28 +759,36 @@ MemoryCache::Statistics MemoryCache::getStatistics()
     Statistics stats;
     CachedResourceMap::iterator e = m_resources.end();
     for (CachedResourceMap::iterator i = m_resources.begin(); i != e; ++i) {
-        CachedResource* resource = i->value;
-        switch (resource->type()) {
-        case CachedResource::ImageResource:
-            stats.images.addResource(resource);
-            break;
-        case CachedResource::CSSStyleSheet:
-            stats.cssStyleSheets.addResource(resource);
-            break;
-        case CachedResource::Script:
-            stats.scripts.addResource(resource);
-            break;
+#if ENABLE(CACHE_PARTITIONING)
+        for (CachedResourceItem::iterator itemIterator = i->value->begin(); itemIterator != i->value->end(); ++itemIterator) {
+            CachedResource* resource = itemIterator->value;
+#else
+            CachedResource* resource = i->value;
+#endif
+            switch (resource->type()) {
+            case CachedResource::ImageResource:
+                stats.images.addResource(resource);
+                break;
+            case CachedResource::CSSStyleSheet:
+                stats.cssStyleSheets.addResource(resource);
+                break;
+            case CachedResource::Script:
+                stats.scripts.addResource(resource);
+                break;
 #if ENABLE(XSLT)
-        case CachedResource::XSLStyleSheet:
-            stats.xslStyleSheets.addResource(resource);
-            break;
+            case CachedResource::XSLStyleSheet:
+                stats.xslStyleSheets.addResource(resource);
+                break;
 #endif
-        case CachedResource::FontResource:
-            stats.fonts.addResource(resource);
-            break;
-        default:
-            break;
+            case CachedResource::FontResource:
+                stats.fonts.addResource(resource);
+                break;
+            default:
+                break;
+            }
+#if ENABLE(CACHE_PARTITIONING)
         }
+#endif
     }
     return stats;
 }
@@ -720,10 +809,15 @@ void MemoryCache::setDisabled(bool disabled)
         return;
 
     for (;;) {
-        CachedResourceMap::iterator i = m_resources.begin();
-        if (i == m_resources.end())
+        CachedResourceMap::iterator outerIterator = m_resources.begin();
+        if (outerIterator == m_resources.end())
             break;
-        evict(i->value);
+#if ENABLE(CACHE_PARTITIONING)
+        CachedResourceItem::iterator innerIterator = outerIterator->value->begin();
+        evict(innerIterator->value);
+#else
+        evict(outerIterator->value);
+#endif
     }
 }
 
index 2045856..f5f525f 100644 (file)
@@ -78,7 +78,12 @@ class MemoryCache {
 public:
     friend MemoryCache* memoryCache();
 
+#if ENABLE(CACHE_PARTITIONING)
+    typedef HashMap<String, CachedResource*> CachedResourceItem;
+    typedef HashMap<String, OwnPtr<CachedResourceItem> > CachedResourceMap;
+#else
     typedef HashMap<String, CachedResource*> CachedResourceMap;
+#endif
 
     struct LRUList {
         CachedResource* m_head;
@@ -104,8 +109,9 @@ public:
         TypeStatistic xslStyleSheets;
         TypeStatistic fonts;
     };
-    
+
     CachedResource* resourceForURL(const KURL&);
+    CachedResource* resourceForRequest(const ResourceRequest&);
     
     bool add(CachedResource* resource);
     void remove(CachedResource* resource) { evict(resource); }
@@ -153,6 +159,7 @@ public:
     static bool shouldMakeResourcePurgeableOnEviction();
 
     static void removeUrlFromCache(ScriptExecutionContext*, const String& urlString);
+    static void removeRequestFromCache(ScriptExecutionContext*, const ResourceRequest&);
 
     // Function to collect cache statistics for the caches window in the Safari Debug menu.
     Statistics getStatistics();
@@ -196,7 +203,8 @@ private:
     bool makeResourcePurgeable(CachedResource*);
     void evict(CachedResource*);
 
-    static void removeUrlFromCacheImpl(ScriptExecutionContext*, const String& urlString);
+    static void removeRequestFromCacheImpl(ScriptExecutionContext*, const ResourceRequest&);
+    static void crossThreadRemoveRequestFromCache(ScriptExecutionContext*, PassOwnPtr<WebCore::CrossThreadResourceRequestData>);
 
     bool m_disabled;  // Whether or not the cache is enabled.
     bool m_pruneEnabled;
@@ -220,7 +228,7 @@ private:
     
     // A URL-based map of all resources that are in the cache (including the freshest version of objects that are currently being 
     // referenced by a Web page).
-    HashMap<String, CachedResource*> m_resources;
+    CachedResourceMap m_resources;
 };
 
 inline bool MemoryCache::shouldMakeResourcePurgeableOnEviction()
index fe58e8e..c2057df 100644 (file)
@@ -438,6 +438,19 @@ void SecurityOrigin::grantUniversalAccess()
     m_universalAccess = true;
 }
 
+#if ENABLE(CACHE_PARTITIONING)
+String SecurityOrigin::cachePartition() const
+{
+    if (m_storageBlockingPolicy != BlockThirdPartyStorage)
+        return String();
+
+    if (m_protocol != "http" && m_protocol != "https")
+        return String();
+
+    return host();
+}
+#endif
+
 void SecurityOrigin::enforceFilePathSeparation()
 {
     ASSERT(isLocal());
index e8120ed..ff3b320 100644 (file)
@@ -142,6 +142,10 @@ public:
 
     void setStorageBlockingPolicy(StorageBlockingPolicy policy) { m_storageBlockingPolicy = policy; }
 
+#if ENABLE(CACHE_PARTITIONING)
+    String cachePartition() const;
+#endif
+
     bool canAccessDatabase(const SecurityOrigin* topOrigin = 0) const { return canAccessStorage(topOrigin); };
     bool canAccessLocalStorage(const SecurityOrigin* topOrigin) const { return canAccessStorage(topOrigin); };
     bool canAccessSharedWorkers(const SecurityOrigin* topOrigin) const { return canAccessStorage(topOrigin); }
diff --git a/Source/WebCore/platform/PublicSuffix.h b/Source/WebCore/platform/PublicSuffix.h
new file mode 100644 (file)
index 0000000..6b89af5
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2013 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 PublicSuffix_h
+#define PublicSuffix_h
+
+#include <wtf/text/WTFString.h>
+
+#if ENABLE(PUBLIC_SUFFIX_LIST)
+
+#if PLATFORM(CHROMIUM)
+#error "The public suffix list should not be enabled on the Chromium port."
+#endif
+
+namespace WebCore {
+
+bool isPublicSuffix(const String& domain);
+String topPrivatelyControlledDomain(const String& domain);
+
+}
+
+#endif
+
+#endif
diff --git a/Source/WebCore/platform/mac/PublicSuffixMac.mm b/Source/WebCore/platform/mac/PublicSuffixMac.mm
new file mode 100644 (file)
index 0000000..c5353f0
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2013 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 "config.h"
+#import "PublicSuffix.h"
+
+#import "WebCoreSystemInterface.h"
+#import "WebCoreNSURLExtras.h"
+#import <wtf/RetainPtr.h>
+
+#if ENABLE(PUBLIC_SUFFIX_LIST)
+
+@interface NSString (WebCoreNSURLExtras)
+- (BOOL)_web_looksLikeIPAddress;
+@end
+
+namespace WebCore {
+
+bool isPublicSuffix(const String& domain)
+{
+    return wkIsPublicSuffix(decodeHostName(domain));
+}
+
+String topPrivatelyControlledDomain(const String& domain)
+{
+    if (domain.isNull() || domain.isEmpty())
+        return String();
+
+    NSString *host = decodeHostName(domain);
+
+    if ([host _web_looksLikeIPAddress])
+        return domain;
+
+    // Match the longest possible suffix.
+    bool hasTopLevelDomain = false;
+    NSCharacterSet *dot = [[NSCharacterSet characterSetWithCharactersInString:@"."] retain];
+    NSRange nextDot = NSMakeRange(0, [host length]);
+    for (NSRange previousDot = [host rangeOfCharacterFromSet:dot]; previousDot.location != NSNotFound; nextDot = previousDot, previousDot = [host rangeOfCharacterFromSet:dot options:0 range:NSMakeRange(previousDot.location + previousDot.length, [host length] - (previousDot.location + previousDot.length))]) {
+        NSString *substring = [host substringFromIndex:previousDot.location + previousDot.length];
+        if (wkIsPublicSuffix(substring)) {
+            hasTopLevelDomain = true;
+            break;
+        }
+    }
+
+    [dot release];
+    if (!hasTopLevelDomain)
+        return String();
+
+    if (!nextDot.location)
+        return domain;
+
+    return encodeHostName([host substringFromIndex:nextDot.location + nextDot.length]);
+}
+
+}
+
+#endif
index ae1c11a..fb30ccb 100644 (file)
@@ -351,6 +351,13 @@ extern CGFloat (*wkNSElasticDeltaForReboundDelta)(CGFloat delta);
 extern CGFloat (*wkNSReboundDeltaForElasticDelta)(CGFloat delta);
 #endif
 
+#if ENABLE(PUBLIC_SUFFIX_LIST)
+extern bool (*wkIsPublicSuffix)(NSString *host);
+#endif
+
+#if ENABLE(CACHE_PARTITIONING)
+extern CFStringRef (*wkCachePartitionKey)(void);
+#endif
 }
 
 #endif
index 9283bf3..c6ebb49 100644 (file)
@@ -222,3 +222,11 @@ CGFloat (*wkNSElasticDeltaForTimeDelta)(CGFloat initialPosition, CGFloat initial
 CGFloat (*wkNSElasticDeltaForReboundDelta)(CGFloat delta);
 CGFloat (*wkNSReboundDeltaForElasticDelta)(CGFloat delta);
 #endif
+
+#if ENABLE(PUBLIC_SUFFIX_LIST)
+bool (*wkIsPublicSuffix)(NSString *host);
+#endif
+
+#if ENABLE(CACHE_PARTITIONING)
+CFStringRef (*wkCachePartitionKey)(void);
+#endif
index 5e3724c..e5b9392 100644 (file)
@@ -94,6 +94,11 @@ namespace WebCore {
         NSURLRequest *nsURLRequest() const;
 #endif
 
+#if ENABLE(CACHE_PARTITIONING)
+        const String& cachePartition() const { return m_cachePartition; }
+        void setCachePartition(const String& cachePartition) { m_cachePartition = cachePartition; }
+#endif
+
 #if PLATFORM(MAC) || USE(CFNETWORK)
         void setStorageSession(CFURLStorageSessionRef);
 #endif
@@ -111,8 +116,8 @@ namespace WebCore {
         void doUpdatePlatformRequest();
         void doUpdateResourceRequest();
 
-        PassOwnPtr<CrossThreadResourceRequestData> doPlatformCopyData(PassOwnPtr<CrossThreadResourceRequestData> data) const { return data; }
-        void doPlatformAdopt(PassOwnPtr<CrossThreadResourceRequestData>) { }
+        PassOwnPtr<CrossThreadResourceRequestData> doPlatformCopyData(PassOwnPtr<CrossThreadResourceRequestData>) const;
+        void doPlatformAdopt(PassOwnPtr<CrossThreadResourceRequestData>);
 
 #if USE(CFNETWORK)
         RetainPtr<CFURLRequestRef> m_cfRequest;
@@ -120,11 +125,17 @@ namespace WebCore {
 #if PLATFORM(MAC)
         RetainPtr<NSURLRequest> m_nsRequest;
 #endif
+#if ENABLE(CACHE_PARTITIONING)
+        String m_cachePartition;
+#endif
 
         static bool s_httpPipeliningEnabled;
     };
 
     struct CrossThreadResourceRequestData : public CrossThreadResourceRequestDataBase {
+#if ENABLE(CACHE_PARTITIONING)
+        String m_cachePartition;
+#endif
     };
 
 } // namespace WebCore
index 77beeb6..f67be49 100644 (file)
@@ -253,6 +253,23 @@ void ResourceRequest::setHTTPPipeliningEnabled(bool flag)
     s_httpPipeliningEnabled = flag;
 }
 
+PassOwnPtr<CrossThreadResourceRequestData> ResourceRequest::doPlatformCopyData(PassOwnPtr<CrossThreadResourceRequestData> data) const
+{
+#if ENABLE(CACHE_PARTITIONING)
+    data->m_cachePartition = m_cachePartition;
+#endif
+    return data;
+}
+
+void ResourceRequest::doPlatformAdopt(PassOwnPtr<CrossThreadResourceRequestData> data)
+{
+#if ENABLE(CACHE_PARTITIONING)
+    m_cachePartition = data->m_cachePartition;
+#else
+    UNUSED_PARAM(data);
+#endif
+}
+
 unsigned initializeMaximumHTTPConnectionCountPerHost()
 {
     static const unsigned preferredConnectionCount = 6;
index d6d4b42..4c917a8 100644 (file)
@@ -112,6 +112,12 @@ void ResourceRequest::doUpdateResourceRequest()
     else if (NSInputStream* bodyStream = [m_nsRequest.get() HTTPBodyStream])
         if (FormData* formData = httpBodyFromStream(bodyStream))
             m_httpBody = formData;
+
+#if ENABLE(CACHE_PARTITIONING)
+    NSString* cachePartition = [NSURLProtocol propertyForKey:(NSString *)wkCachePartitionKey() inRequest:m_nsRequest.get()];
+    if (cachePartition)
+        m_cachePartition = cachePartition;
+#endif
 }
 
 void ResourceRequest::doUpdatePlatformRequest()
@@ -175,7 +181,11 @@ void ResourceRequest::doUpdatePlatformRequest()
     RefPtr<FormData> formData = httpBody();
     if (formData && !formData->isEmpty())
         WebCore::setHTTPBody(nsRequest, formData);
-    
+
+#if ENABLE(CACHE_PARTITIONING)
+    [NSURLProtocol setProperty:m_cachePartition forKey:(NSString *)wkCachePartitionKey() inRequest:nsRequest];
+#endif
+
     m_nsRequest.adoptNS(nsRequest);
 }
 
index cb7a00b..be424d7 100644 (file)
@@ -1,3 +1,16 @@
+2013-02-21  Jeffrey Pfau  <jpfau@apple.com>
+
+        Optionally partition cache to prevent using cache for tracking
+        https://bugs.webkit.org/show_bug.cgi?id=110269
+
+        Reviewed by Maciej Stachowiak.
+
+        Update WKSI bindings and add feature defines.
+
+        * Configurations/FeatureDefines.xcconfig: Add defines for cache partitioning and public suffix list usage
+        * WebCoreSupport/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+
 2013-02-25  Jer Noble  <jer.noble@apple.com>
 
         Normalize ENABLE_ENCRYPTED_MEDIA definitions across all FeatureDefines files.
index 2b9f3c9..d850383 100644 (file)
 ENABLE_3D_RENDERING = ENABLE_3D_RENDERING;
 ENABLE_ACCELERATED_2D_CANVAS = ;
 ENABLE_BLOB = ENABLE_BLOB;
+ENABLE_CACHE_PARTITIONING = $(ENABLE_CACHE_PARTITIONING_$(PLATFORM_NAME));
+ENABLE_CACHE_PARTITIONING_macosx = $(ENABLE_CACHE_PARTITIONING_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+ENABLE_CACHE_PARTITIONING_macosx_1070 = ;
+ENABLE_CACHE_PARTITIONING_macosx_1080 = ;
+ENABLE_CACHE_PARTITIONING_macosx_1090 = ENABLE_CACHE_PARTITIONING;
 ENABLE_CANVAS_PATH = ENABLE_CANVAS_PATH;
 ENABLE_CANVAS_PROXY = ;
 ENABLE_CHANNEL_MESSAGING = ENABLE_CHANNEL_MESSAGING;
@@ -141,6 +146,11 @@ ENABLE_PLUGIN_PROXY_FOR_VIDEO_iphoneos = ENABLE_PLUGIN_PROXY_FOR_VIDEO;
 ENABLE_PLUGIN_PROXY_FOR_VIDEO_iphonesimulator = $(ENABLE_PLUGIN_PROXY_FOR_VIDEO_iphoneos);
 ENABLE_PROGRESS_ELEMENT = ENABLE_PROGRESS_ELEMENT;
 ENABLE_PROXIMITY_EVENTS = ;
+ENABLE_PUBLIC_SUFFIX_LIST = $(ENABLE_PUBLIC_SUFFIX_LIST_$(PLATFORM_NAME));
+ENABLE_PUBLIC_SUFFIX_LIST_macosx = $(ENABLE_PUBLIC_SUFFIX_LIST_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+ENABLE_PUBLIC_SUFFIX_LIST_macosx_1070 = ;
+ENABLE_PUBLIC_SUFFIX_LIST_macosx_1080 = ;
+ENABLE_PUBLIC_SUFFIX_LIST_macosx_1090 = ENABLE_PUBLIC_SUFFIX_LIST;
 ENABLE_QUOTA = ;
 ENABLE_REQUEST_ANIMATION_FRAME = ENABLE_REQUEST_ANIMATION_FRAME;
 ENABLE_RESOLUTION_MEDIA_QUERY = ;
@@ -171,4 +181,4 @@ ENABLE_WORKERS = ENABLE_WORKERS;
 ENABLE_XHR_TIMEOUT = ENABLE_XHR_TIMEOUT;
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_BLOB) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PLUGIN_PROXY_FOR_VIDEO) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(FEATURE_DEFINES_$(PLATFORM_NAME));
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_BLOB) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PLUGIN_PROXY_FOR_VIDEO) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(FEATURE_DEFINES_$(PLATFORM_NAME));
index 9ffbc42..5b19ef7 100644 (file)
@@ -220,6 +220,14 @@ void InitWebCoreSystemInterface(void)
     INIT(NSReboundDeltaForElasticDelta);
 #endif
 
+#if ENABLE(PUBLIC_SUFFIX_LIST)
+    INIT(IsPublicSuffix);
+#endif
+
+#if ENABLE(CACHE_PARTITIONING)
+    INIT(CachePartitionKey);
+#endif
+
 #endif
     didInit = true;
 }
index 6b02e7a..a3da1b2 100644 (file)
@@ -1,3 +1,16 @@
+2013-02-21  Jeffrey Pfau  <jpfau@apple.com>
+
+        Optionally partition cache to prevent using cache for tracking
+        https://bugs.webkit.org/show_bug.cgi?id=110269
+
+        Reviewed by Maciej Stachowiak.
+
+        Update WKSI bindings and add feature defines.
+
+        * Configurations/FeatureDefines.xcconfig: Add defines for cache partitioning and public suffix list usage
+        * WebCoreSupport/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+
 2013-02-25  Jer Noble  <jer.noble@apple.com>
 
         Normalize ENABLE_ENCRYPTED_MEDIA definitions across all FeatureDefines files.
index 2b9f3c9..d850383 100644 (file)
 ENABLE_3D_RENDERING = ENABLE_3D_RENDERING;
 ENABLE_ACCELERATED_2D_CANVAS = ;
 ENABLE_BLOB = ENABLE_BLOB;
+ENABLE_CACHE_PARTITIONING = $(ENABLE_CACHE_PARTITIONING_$(PLATFORM_NAME));
+ENABLE_CACHE_PARTITIONING_macosx = $(ENABLE_CACHE_PARTITIONING_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+ENABLE_CACHE_PARTITIONING_macosx_1070 = ;
+ENABLE_CACHE_PARTITIONING_macosx_1080 = ;
+ENABLE_CACHE_PARTITIONING_macosx_1090 = ENABLE_CACHE_PARTITIONING;
 ENABLE_CANVAS_PATH = ENABLE_CANVAS_PATH;
 ENABLE_CANVAS_PROXY = ;
 ENABLE_CHANNEL_MESSAGING = ENABLE_CHANNEL_MESSAGING;
@@ -141,6 +146,11 @@ ENABLE_PLUGIN_PROXY_FOR_VIDEO_iphoneos = ENABLE_PLUGIN_PROXY_FOR_VIDEO;
 ENABLE_PLUGIN_PROXY_FOR_VIDEO_iphonesimulator = $(ENABLE_PLUGIN_PROXY_FOR_VIDEO_iphoneos);
 ENABLE_PROGRESS_ELEMENT = ENABLE_PROGRESS_ELEMENT;
 ENABLE_PROXIMITY_EVENTS = ;
+ENABLE_PUBLIC_SUFFIX_LIST = $(ENABLE_PUBLIC_SUFFIX_LIST_$(PLATFORM_NAME));
+ENABLE_PUBLIC_SUFFIX_LIST_macosx = $(ENABLE_PUBLIC_SUFFIX_LIST_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+ENABLE_PUBLIC_SUFFIX_LIST_macosx_1070 = ;
+ENABLE_PUBLIC_SUFFIX_LIST_macosx_1080 = ;
+ENABLE_PUBLIC_SUFFIX_LIST_macosx_1090 = ENABLE_PUBLIC_SUFFIX_LIST;
 ENABLE_QUOTA = ;
 ENABLE_REQUEST_ANIMATION_FRAME = ENABLE_REQUEST_ANIMATION_FRAME;
 ENABLE_RESOLUTION_MEDIA_QUERY = ;
@@ -171,4 +181,4 @@ ENABLE_WORKERS = ENABLE_WORKERS;
 ENABLE_XHR_TIMEOUT = ENABLE_XHR_TIMEOUT;
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_BLOB) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PLUGIN_PROXY_FOR_VIDEO) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(FEATURE_DEFINES_$(PLATFORM_NAME));
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_BLOB) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PLUGIN_PROXY_FOR_VIDEO) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(FEATURE_DEFINES_$(PLATFORM_NAME));
index 7b4c1ad..6d41fe6 100644 (file)
@@ -183,5 +183,12 @@ void InitWebCoreSystemInterface(void)
         INIT(NSReboundDeltaForElasticDelta);
 #endif
 
+#if ENABLE(PUBLIC_SUFFIX_LIST)
+        INIT(IsPublicSuffix);
+#endif
+
+#if ENABLE(CACHE_PARTITIONING)
+        INIT(CachePartitionKey);
+#endif
     });
 }
index 5ed904e..19d1512 100644 (file)
@@ -1,3 +1,17 @@
+2013-02-21  Jeffrey Pfau  <jpfau@apple.com>
+
+        Optionally partition cache to prevent using cache for tracking
+        https://bugs.webkit.org/show_bug.cgi?id=110269
+
+        Reviewed by Maciej Stachowiak.
+
+        Add test suite for public suffix functions on Mac.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/mac/PublicSuffix.mm: Added.
+        (TestWebKitAPI):
+        (TestWebKitAPI::TEST_F):
+
 2013-02-25  Dirk Pranke  <dpranke@chromium.org>
 
         nrwt: reenable multiple http shards on chromium win
index d3733df..4d8d816 100644 (file)
@@ -7,6 +7,7 @@
        objects = {
 
 /* Begin PBXBuildFile section */
+               00BC16871680FE810065F1E5 /* PublicSuffix.mm in Sources */ = {isa = PBXBuildFile; fileRef = 00BC16851680FE810065F1E5 /* PublicSuffix.mm */; };
                00CD9F6315BE312C002DA2CE /* BackForwardList.mm in Sources */ = {isa = PBXBuildFile; fileRef = 00CD9F6215BE312C002DA2CE /* BackForwardList.mm */; };
                0BCD833514857CE400EA2003 /* HashMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0BCD833414857CE400EA2003 /* HashMap.cpp */; };
                0BCD856A1485C98B00EA2003 /* TemporaryChange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0BCD85691485C98B00EA2003 /* TemporaryChange.cpp */; };
 /* End PBXCopyFilesBuildPhase section */
 
 /* Begin PBXFileReference section */
+               00BC16851680FE810065F1E5 /* PublicSuffix.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PublicSuffix.mm; path = PublicSuffix.mm; sourceTree = "<group>"; };
                00CD9F6215BE312C002DA2CE /* BackForwardList.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BackForwardList.mm; sourceTree = "<group>"; };
                0BCD833414857CE400EA2003 /* HashMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HashMap.cpp; path = WTF/HashMap.cpp; sourceTree = "<group>"; };
                0BCD85691485C98B00EA2003 /* TemporaryChange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TemporaryChange.cpp; path = WTF/TemporaryChange.cpp; sourceTree = "<group>"; };
                                E1220D9F155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm */,
                                517E7DFB15110EA600D0B008 /* MemoryCachePruneWithinResourceLoadDelegate.mm */,
                                A57A34EF16AF677200C2501F /* PageVisibilityStateWithWindowChanges.mm */,
+                               00BC16851680FE810065F1E5 /* PublicSuffix.mm */,
                                3722C8681461E03E00C45D00 /* RenderedImageFromDOMRange.mm */,
                                261516D515B0E60500A2C201 /* SetAndUpdateCacheModel.mm */,
                                52B8CF9515868CF000281053 /* SetDocumentURI.mm */,
                                BC90955D125548AA00083756 /* PlatformWebViewMac.mm in Sources */,
                                333B9CE21277F23100FEFCE3 /* PreventEmptyUserAgent.cpp in Sources */,
                                F6FDDDD314241AD4004F1729 /* PrivateBrowsingPushStateNoHistoryCallback.cpp in Sources */,
+                               00BC16871680FE810065F1E5 /* PublicSuffix.mm in Sources */,
                                0FC6C4CC141027E0005B7F0C /* RedBlackTree.cpp in Sources */,
                                8A3AF93B16C9ED2700D248C1 /* ReloadPageAfterCrash.cpp in Sources */,
                                8A2C750E16CED9550024F352 /* ResizeWindowAfterCrash.cpp in Sources */,
diff --git a/Tools/TestWebKitAPI/Tests/mac/PublicSuffix.mm b/Tools/TestWebKitAPI/Tests/mac/PublicSuffix.mm
new file mode 100644 (file)
index 0000000..cb72414
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2012 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 "config.h"
+
+#if USE(PUBLIC_SUFFIX_LIST)
+
+#include "WTFStringUtilities.h"
+#include <WebCore/PublicSuffix.h>
+#include <wtf/MainThread.h>
+
+using namespace WebCore;
+
+namespace TestWebKitAPI {
+
+class PublicSuffix: public testing::Test {
+public:
+    virtual void SetUp()
+    {
+        WTF::initializeMainThread();
+        [WebView initialize];
+    }
+};
+
+TEST_F(PublicSuffix, IsPublicSuffix)
+{
+    EXPECT_TRUE(isPublicSuffix("com"));
+    EXPECT_FALSE(isPublicSuffix("test.com"));
+    EXPECT_FALSE(isPublicSuffix("com.com"));
+    EXPECT_TRUE(isPublicSuffix("net"));
+    EXPECT_TRUE(isPublicSuffix("org"));
+    EXPECT_TRUE(isPublicSuffix("co.uk"));
+    EXPECT_FALSE(isPublicSuffix("bl.uk"));
+    EXPECT_FALSE(isPublicSuffix("test.co.uk"));
+    EXPECT_TRUE(isPublicSuffix("xn--zf0ao64a.tw"));
+}
+
+TEST_F(PublicSuffix, TopPrivatelyControlledDomain)
+{
+    EXPECT_EQ(String("test.com"), topPrivatelyControlledDomain("test.com"));
+    EXPECT_EQ(String("test.com"), topPrivatelyControlledDomain("com.test.com"));
+    EXPECT_EQ(String("test.com"), topPrivatelyControlledDomain("subdomain.test.com"));
+    EXPECT_EQ(String("com.com"), topPrivatelyControlledDomain("www.com.com"));
+    EXPECT_EQ(String("test.co.uk"), topPrivatelyControlledDomain("test.co.uk"));
+    EXPECT_EQ(String("test.co.uk"), topPrivatelyControlledDomain("subdomain.test.co.uk"));
+    EXPECT_EQ(String("bl.uk"), topPrivatelyControlledDomain("bl.uk"));
+    EXPECT_EQ(String("bl.uk"), topPrivatelyControlledDomain("subdomain.bl.uk"));
+    EXPECT_EQ(String("test.xn--zf0ao64a.tw"), topPrivatelyControlledDomain("test.xn--zf0ao64a.tw"));
+    EXPECT_EQ(String("test.xn--zf0ao64a.tw"), topPrivatelyControlledDomain("www.test.xn--zf0ao64a.tw"));
+    EXPECT_EQ(String("127.0.0.1"), topPrivatelyControlledDomain("127.0.0.1"));
+    EXPECT_EQ(String(), topPrivatelyControlledDomain("1"));
+    EXPECT_EQ(String(), topPrivatelyControlledDomain("com"));
+}
+
+}
+
+#endif
index 7a68c3d..17a323c 100644 (file)
@@ -1,3 +1,16 @@
+2013-02-21  Jeffrey Pfau  <jpfau@apple.com>
+
+        Optionally partition cache to prevent using cache for tracking
+        https://bugs.webkit.org/show_bug.cgi?id=110269
+
+        Reviewed by Maciej Stachowiak.
+
+        Update WKSI bindings.
+
+        * WebKitSystemInterface.h:
+        * libWebKitSystemInterfaceLion.a:
+        * libWebKitSystemInterfaceMountainLion.a:
+
 2013-02-22  Aaron Colwell  <acolwell@chromium.org>
 
         Disable MediaSource on Apple Windows port
index 3f81496..8bc98fb 100644 (file)
@@ -1,6 +1,6 @@
 /*      
     WebKitSystemInterface.h
-    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
+    Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
 
     Public header file.
 */
@@ -341,14 +341,6 @@ WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
 void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
 void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
 
-typedef struct __WKCARemoteLayerClientRef *WKCARemoteLayerClientRef;
-
-WKCARemoteLayerClientRef WKCARemoteLayerClientMakeWithServerPort(mach_port_t port);
-void WKCARemoteLayerClientInvalidate(WKCARemoteLayerClientRef);
-uint32_t WKCARemoteLayerClientGetClientId(WKCARemoteLayerClientRef);
-void WKCARemoteLayerClientSetLayer(WKCARemoteLayerClientRef, CALayer *);
-CALayer *WKCARemoteLayerClientGetLayer(WKCARemoteLayerClientRef);
-
 typedef struct __WKCAContextRef *WKCAContextRef;
 
 WKCAContextRef WKCAContextMakeRemoteWithServerPort(mach_port_t port);
@@ -483,41 +475,6 @@ CGFloat WKNSElasticDeltaForReboundDelta(CGFloat delta);
 CGFloat WKNSReboundDeltaForElasticDelta(CGFloat delta);
 #endif
 
-typedef enum {
-    WKCaptionFontStyleDefault = 0,
-    WKCaptionFontStyleMonospacedWithSerif,
-    WKCaptionFontStyleProportionalWithSerif,
-    WKCaptionFontStyleMonospacedWithoutSerif,
-    WKCaptionFontStyleProportionalWithoutSerif,
-    WKCaptionFontStyleCasual,
-    WKCaptionFontStyleCursive,
-    WKCaptionFontStyleSmallCapital,
-    WKCaptionFontStyleMax
-} WKCaptionFontStyle;
-
-typedef enum {
-    WKCaptionTextEdgeStyleUndefined = 0,
-    WKCaptionTextEdgeStyleNone,
-    WKCaptionTextEdgeStyleRaised,
-    WKCaptionTextEdgeStyleDepressed,
-    WKCaptionTextEdgeStyleUniform,
-    WKCaptionTextEdgeStyleDropShadow,
-    WKCaptionTextEdgeStyleMax
-} WKCaptionTextEdgeStyle;
-
-bool WKCaptionAppearanceHasUserPreferences(void);
-bool WKCaptionAppearanceShowCaptionsWhenAvailable(void);
-CGColorRef WKCaptionAppearanceCopyForegroundColor(void);
-CGColorRef WKCaptionAppearanceCopyBackgroundColor(void);
-CGColorRef WKCaptionAppearanceCopyWindowColor(void);
-bool WKCaptionAppearanceGetForegroundOpacity(CGFloat*);
-bool WKCaptionAppearanceGetBackgroundOpacity(CGFloat*);
-bool WKCaptionAppearanceGetWindowOpacity(CGFloat*);
-CGFontRef WKCaptionAppearanceCopyFontForStyle(int fontStyle);
-bool WKCaptionAppearanceGetRelativeCharacterSize(CGFloat*);
-int WKCaptionAppearanceGetTextEdgeStyle(void);
-CFStringRef WKCaptionAppearanceGetSettingsChangedNotification(void);
-
 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
 typedef enum {
     WKOcclusionNotificationTypeApplicationBecameVisible,
@@ -547,6 +504,12 @@ void WKActivateJavaPlugIn(void);
 
 void WKCFNetworkSetOverrideSystemProxySettings(CFDictionaryRef);
 
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
+bool WKIsPublicSuffix(NSString *domain);
+#endif
+
+CFStringRef WKCachePartitionKey(void);
+
 #ifdef __cplusplus
 }
 #endif
index 8683d9d..a5edb73 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLion.a and b/WebKitLibraries/libWebKitSystemInterfaceLion.a differ
index 68645e2..18924dc 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceMountainLion.a and b/WebKitLibraries/libWebKitSystemInterfaceMountainLion.a differ