Diff
Modified: trunk/Source/WebCore/ChangeLog (211945 => 211946)
--- trunk/Source/WebCore/ChangeLog 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/ChangeLog 2017-02-09 11:09:28 UTC (rev 211946)
@@ -1,3 +1,74 @@
+2017-02-09 Antti Koivisto <[email protected]>
+
+ Remove most cases of #if ENABLE(CACHE_PARTITIONING)
+ https://bugs.webkit.org/show_bug.cgi?id=167990
+
+ Reviewed by Sam Weinig.
+
+ We'll just return empty string for the partition if partitioning is not enabled.
+
+ * html/DOMURL.cpp:
+ (WebCore::DOMURL::revokeObjectURL):
+ * inspector/InspectorPageAgent.cpp:
+ (WebCore::InspectorPageAgent::cachedResource):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::loadURL):
+ * loader/archive/cf/LegacyWebArchive.cpp:
+ (WebCore::LegacyWebArchive::create):
+ * loader/cache/CachedResource.h:
+ (WebCore::CachedResource::url):
+ (WebCore::CachedResource::cachePartition):
+ * loader/cache/CachedResourceLoader.cpp:
+ (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
+ (WebCore::CachedResourceLoader::requestResource):
+ * loader/cache/CachedResourceRequest.cpp:
+ (WebCore::CachedResourceRequest::setDomainForCachePartition):
+ * loader/cache/CachedResourceRequest.h:
+ * loader/cache/MemoryCache.cpp:
+ (WebCore::MemoryCache::add):
+ (WebCore::MemoryCache::revalidationSucceeded):
+ (WebCore::MemoryCache::resourceForRequestImpl):
+ (WebCore::MemoryCache::addImageToCache):
+ (WebCore::MemoryCache::removeImageFromCache):
+ (WebCore::MemoryCache::remove):
+ (WebCore::MemoryCache::removeResourcesWithOrigin):
+ (WebCore::MemoryCache::removeResourcesWithOrigins):
+ (WebCore::MemoryCache::getOriginsWithCache):
+ (WebCore::MemoryCache::originsWithCache):
+ * loader/cache/MemoryCache.h:
+ * page/SecurityOrigin.cpp:
+ (WebCore::SecurityOrigin::domainForCachePartition):
+ * page/SecurityOrigin.h:
+ * platform/SchemeRegistry.cpp:
+ (WebCore::cachePartitioningSchemes):
+ (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme):
+ * platform/SchemeRegistry.h:
+ * platform/ios/WebCoreSystemInterfaceIOS.mm:
+ * platform/mac/WebCoreSystemInterface.h:
+ * platform/mac/WebCoreSystemInterface.mm:
+ * platform/network/ResourceRequestBase.cpp:
+ (WebCore::ResourceRequestBase::setAsIsolatedCopy):
+ (WebCore::ResourceRequestBase::setCachePartition):
+ (WebCore::ResourceRequestBase::partitionName):
+ * platform/network/ResourceRequestBase.h:
+ (WebCore::ResourceRequestBase::cachePartition):
+ (WebCore::ResourceRequestBase::setDomainForCachePartition):
+ * platform/network/cf/ResourceRequest.h:
+ (WebCore::ResourceRequest::cachePartition): Deleted.
+ (WebCore::ResourceRequest::setCachePartition): Deleted.
+ (WebCore::ResourceRequest::setDomainForCachePartition): Deleted.
+ * platform/network/cf/ResourceRequestCFNet.cpp:
+ (WebCore::ResourceRequest::doUpdatePlatformRequest):
+ (WebCore::ResourceRequest::doUpdateResourceRequest):
+ (WebCore::ResourceRequest::partitionName): Deleted.
+ (WebCore::ResourceRequest::doPlatformSetAsIsolatedCopy): Deleted.
+ * platform/network/cf/ResourceResponse.h:
+ * platform/network/cocoa/ResourceRequestCocoa.mm:
+ (WebCore::ResourceRequest::doUpdateResourceRequest):
+ (WebCore::ResourceRequest::doUpdatePlatformRequest):
+ * testing/Internals.cpp:
+ (WebCore::Internals::isLoadingFromMemoryCache):
+
2017-02-09 Ryosuke Niwa <[email protected]>
Add Web Bluetooth as Not Considering
Modified: trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp (211945 => 211946)
--- trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -124,11 +124,7 @@
ref();
Page* page = frame->page();
SessionID sessionID = page ? page->sessionID() : SessionID::defaultSessionID();
-#if ENABLE(CACHE_PARTITIONING)
String partition = m_document->topDocument().securityOrigin().domainForCachePartition();
-#else
- String partition = emptyString();
-#endif
m_handle = m_socketProvider->createSocketStreamHandle(m_handshake->url(), *this, sessionID, partition);
}
}
Modified: trunk/Source/WebCore/html/DOMURL.cpp (211945 => 211946)
--- trunk/Source/WebCore/html/DOMURL.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/html/DOMURL.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -120,9 +120,8 @@
{
URL url(URL(), urlString);
ResourceRequest request(url);
-#if ENABLE(CACHE_PARTITIONING)
request.setDomainForCachePartition(scriptExecutionContext.topOrigin().domainForCachePartition());
-#endif
+
MemoryCache::removeRequestFromSessionCaches(scriptExecutionContext, request);
scriptExecutionContext.publicURLManager().revoke(url);
Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (211945 => 211946)
--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -260,9 +260,7 @@
CachedResource* cachedResource = frame->document()->cachedResourceLoader().cachedResource(MemoryCache::removeFragmentIdentifierIfNeeded(url));
if (!cachedResource) {
ResourceRequest request(url);
-#if ENABLE(CACHE_PARTITIONING)
request.setDomainForCachePartition(frame->document()->topOrigin().domainForCachePartition());
-#endif
cachedResource = MemoryCache::singleton().resourceForRequest(request, frame->page()->sessionID());
}
Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (211945 => 211946)
--- trunk/Source/WebCore/loader/FrameLoader.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -1201,10 +1201,9 @@
RefPtr<SecurityOrigin> referrerOrigin = SecurityOrigin::createFromString(referrer);
addHTTPOriginIfNeeded(request, referrerOrigin->toString());
}
-#if ENABLE(CACHE_PARTITIONING)
if (&m_frame.tree().top() != &m_frame)
request.setDomainForCachePartition(m_frame.tree().top().document()->securityOrigin().domainForCachePartition());
-#endif
+
addExtraFieldsToRequest(request, newLoadType, true);
if (newLoadType == FrameLoadType::Reload || newLoadType == FrameLoadType::ReloadFromOrigin)
request.setCachePolicy(ReloadIgnoringCacheData);
Modified: trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp (211945 => 211946)
--- trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -514,9 +514,8 @@
}
ResourceRequest request(subresourceURL);
-#if ENABLE(CACHE_PARTITIONING)
request.setDomainForCachePartition(frame.document()->topOrigin().domainForCachePartition());
-#endif
+
if (auto* cachedResource = MemoryCache::singleton().resourceForRequest(request, frame.page()->sessionID())) {
if (auto resource = ArchiveResource::create(cachedResource->resourceBuffer(), subresourceURL, cachedResource->response())) {
subresources.append(resource.releaseNonNull());
Modified: trunk/Source/WebCore/loader/cache/CachedResource.h (211945 => 211946)
--- trunk/Source/WebCore/loader/cache/CachedResource.h 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/loader/cache/CachedResource.h 2017-02-09 11:09:28 UTC (rev 211946)
@@ -114,9 +114,7 @@
const ResourceRequest& resourceRequest() const { return m_resourceRequest; }
ResourceRequest& resourceRequest() { return m_resourceRequest; }
const URL& url() const { return m_resourceRequest.url();}
-#if ENABLE(CACHE_PARTITIONING)
const String& cachePartition() const { return m_resourceRequest.cachePartition(); }
-#endif
SessionID sessionID() const { return m_sessionID; }
Type type() const { return m_type; }
Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (211945 => 211946)
--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -217,10 +217,8 @@
CachedResourceHandle<CachedCSSStyleSheet> CachedResourceLoader::requestUserCSSStyleSheet(CachedResourceRequest&& request)
{
-#if ENABLE(CACHE_PARTITIONING)
ASSERT(document());
request.setDomainForCachePartition(*document());
-#endif
auto& memoryCache = MemoryCache::singleton();
if (request.allowsCaching()) {
@@ -733,10 +731,8 @@
// See if we can use an existing resource from the cache.
CachedResourceHandle<CachedResource> resource;
-#if ENABLE(CACHE_PARTITIONING)
if (document())
request.setDomainForCachePartition(*document());
-#endif
if (request.allowsCaching())
resource = memoryCache.resourceForRequest(request.resourceRequest(), sessionID());
Modified: trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp (211945 => 211946)
--- trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -129,12 +129,10 @@
upgradeInsecureResourceRequestIfNeeded(m_resourceRequest, document);
}
-#if ENABLE(CACHE_PARTITIONING)
void CachedResourceRequest::setDomainForCachePartition(Document& document)
{
m_resourceRequest.setDomainForCachePartition(document.topOrigin().domainForCachePartition());
}
-#endif
static inline String acceptHeaderValueFromType(CachedResource::Type type)
{
Modified: trunk/Source/WebCore/loader/cache/CachedResourceRequest.h (211945 => 211946)
--- trunk/Source/WebCore/loader/cache/CachedResourceRequest.h 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/loader/cache/CachedResourceRequest.h 2017-02-09 11:09:28 UTC (rev 211946)
@@ -75,9 +75,7 @@
#if ENABLE(CONTENT_EXTENSIONS)
void applyBlockedStatus(const ContentExtensions::BlockedStatus&);
#endif
-#if ENABLE(CACHE_PARTITIONING)
void setDomainForCachePartition(Document&);
-#endif
bool isLinkPreload() const { return m_isLinkPreload; }
void setIsLinkPreload() { m_isLinkPreload = true; }
Modified: trunk/Source/WebCore/loader/cache/MemoryCache.cpp (211945 => 211946)
--- trunk/Source/WebCore/loader/cache/MemoryCache.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -115,11 +115,8 @@
ASSERT(WTF::isMainThread());
-#if ENABLE(CACHE_PARTITIONING)
auto key = std::make_pair(resource.url(), resource.cachePartition());
-#else
- auto& key = resource.url();
-#endif
+
ensureSessionResourceMap(resource.sessionID()).set(key, &resource);
resource.setInCache(true);
@@ -144,11 +141,8 @@
remove(revalidatingResource);
auto& resources = ensureSessionResourceMap(resource.sessionID());
-#if ENABLE(CACHE_PARTITIONING)
auto key = std::make_pair(resource.url(), resource.cachePartition());
-#else
- auto& key = resource.url();
-#endif
+
ASSERT(!resources.get(key));
resources.set(key, &resource);
resource.setInCache(true);
@@ -189,11 +183,7 @@
ASSERT(WTF::isMainThread());
URL url = ""
-#if ENABLE(CACHE_PARTITIONING)
auto key = std::make_pair(url, request.cachePartition());
-#else
- auto& key = url;
-#endif
return resources.get(key);
}
@@ -232,9 +222,8 @@
cachedImage->addClient(dummyCachedImageClient());
cachedImage->setDecodedSize(bitmapImage->decodedSize());
-#if ENABLE(CACHE_PARTITIONING)
cachedImage->resourceRequest().setDomainForCachePartition(domainForCachePartition);
-#endif
+
return add(*cachedImage.release());
}
@@ -244,12 +233,8 @@
if (!resources)
return;
-#if ENABLE(CACHE_PARTITIONING)
auto key = std::make_pair(url, ResourceRequest::partitionName(domainForCachePartition));
-#else
- UNUSED_PARAM(domainForCachePartition);
- auto& key = url;
-#endif
+
CachedResource* resource = resources->get(key);
if (!resource)
return;
@@ -439,11 +424,8 @@
// The resource may have already been removed by someone other than our caller,
// who needed a fresh copy for a reload. See <http://bugs.webkit.org/show_bug.cgi?id=12479#c6>.
if (auto* resources = sessionResourceMap(resource.sessionID())) {
-#if ENABLE(CACHE_PARTITIONING)
auto key = std::make_pair(resource.url(), resource.cachePartition());
-#else
- auto& key = resource.url();
-#endif
+
if (resource.inCache()) {
// Remove resource from the resource map.
resources->remove(key);
@@ -527,21 +509,17 @@
void MemoryCache::removeResourcesWithOrigin(SecurityOrigin& origin)
{
-#if ENABLE(CACHE_PARTITIONING)
String originPartition = ResourceRequest::partitionName(origin.host());
-#endif
Vector<CachedResource*> resourcesWithOrigin;
for (auto& resources : m_sessionResources.values()) {
for (auto& keyValue : *resources) {
auto& resource = *keyValue.value;
-#if ENABLE(CACHE_PARTITIONING)
auto& partitionName = keyValue.key.second;
if (partitionName == originPartition) {
resourcesWithOrigin.append(&resource);
continue;
}
-#endif
RefPtr<SecurityOrigin> resourceOrigin = SecurityOrigin::create(resource.url());
if (resourceOrigin->equal(&origin))
resourcesWithOrigin.append(&resource);
@@ -558,25 +536,19 @@
if (!resourceMap)
return;
-#if ENABLE(CACHE_PARTITIONING)
HashSet<String> originPartitions;
for (auto& origin : origins)
originPartitions.add(ResourceRequest::partitionName(origin->host()));
-#endif
Vector<CachedResource*> resourcesToRemove;
for (auto& keyValuePair : *resourceMap) {
auto& resource = *keyValuePair.value;
-
-#if ENABLE(CACHE_PARTITIONING)
auto& partitionName = keyValuePair.key.second;
if (originPartitions.contains(partitionName)) {
resourcesToRemove.append(&resource);
continue;
}
-#endif
-
if (origins.contains(SecurityOrigin::create(resource.url()).ptr()))
resourcesToRemove.append(&resource);
}
@@ -587,19 +559,14 @@
void MemoryCache::getOriginsWithCache(SecurityOriginSet& origins)
{
-#if ENABLE(CACHE_PARTITIONING)
- static NeverDestroyed<String> httpString("http");
-#endif
for (auto& resources : m_sessionResources.values()) {
for (auto& keyValue : *resources) {
auto& resource = *keyValue.value;
-#if ENABLE(CACHE_PARTITIONING)
auto& partitionName = keyValue.key.second;
if (!partitionName.isEmpty())
- origins.add(SecurityOrigin::create(httpString, partitionName, 0));
+ origins.add(SecurityOrigin::create(ASCIILiteral("http"), partitionName, 0));
else
-#endif
- origins.add(SecurityOrigin::create(resource.url()));
+ origins.add(SecurityOrigin::create(resource.url()));
}
}
}
@@ -612,13 +579,11 @@
if (it != m_sessionResources.end()) {
for (auto& keyValue : *it->value) {
auto& resource = *keyValue.value;
-#if ENABLE(CACHE_PARTITIONING)
auto& partitionName = keyValue.key.second;
if (!partitionName.isEmpty())
origins.add(SecurityOrigin::create("http", partitionName, 0));
else
-#endif
- origins.add(SecurityOrigin::create(resource.url()));
+ origins.add(SecurityOrigin::create(resource.url()));
}
}
Modified: trunk/Source/WebCore/loader/cache/MemoryCache.h (211945 => 211946)
--- trunk/Source/WebCore/loader/cache/MemoryCache.h 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.h 2017-02-09 11:09:28 UTC (rev 211946)
@@ -168,11 +168,7 @@
WEBCORE_EXPORT void pruneLiveResourcesToSize(unsigned targetSize, bool shouldDestroyDecodedDataForAllLiveResources = false);
private:
-#if ENABLE(CACHE_PARTITIONING)
typedef HashMap<std::pair<URL, String /* partitionName */>, CachedResource*> CachedResourceMap;
-#else
- typedef HashMap<URL, CachedResource*> CachedResourceMap;
-#endif
typedef ListHashSet<CachedResource*> LRUList;
MemoryCache();
Modified: trunk/Source/WebCore/page/SecurityOrigin.cpp (211945 => 211946)
--- trunk/Source/WebCore/page/SecurityOrigin.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/page/SecurityOrigin.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -395,7 +395,6 @@
m_needsStorageAccessFromFileURLsQuirk = true;
}
-#if ENABLE(CACHE_PARTITIONING)
String SecurityOrigin::domainForCachePartition() const
{
if (m_storageBlockingPolicy != BlockThirdPartyStorage)
@@ -409,7 +408,6 @@
return emptyString();
}
-#endif
void SecurityOrigin::enforceFilePathSeparation()
{
Modified: trunk/Source/WebCore/page/SecurityOrigin.h (211945 => 211946)
--- trunk/Source/WebCore/page/SecurityOrigin.h 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/page/SecurityOrigin.h 2017-02-09 11:09:28 UTC (rev 211946)
@@ -138,9 +138,7 @@
void grantStorageAccessFromFileURLsQuirk();
bool needsStorageAccessFromFileURLsQuirk() const { return m_needsStorageAccessFromFileURLsQuirk; }
-#if ENABLE(CACHE_PARTITIONING)
WEBCORE_EXPORT String domainForCachePartition() const;
-#endif
bool canAccessDatabase(const SecurityOrigin& topOrigin) const { return canAccessStorage(&topOrigin); };
bool canAccessSessionStorage(const SecurityOrigin& topOrigin) const { return canAccessStorage(&topOrigin, AlwaysAllowFromThirdParty); }
Modified: trunk/Source/WebCore/platform/SchemeRegistry.cpp (211945 => 211946)
--- trunk/Source/WebCore/platform/SchemeRegistry.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/platform/SchemeRegistry.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -167,13 +167,11 @@
return schemes;
}
-#if ENABLE(CACHE_PARTITIONING)
static URLSchemesMap& cachePartitioningSchemes()
{
static NeverDestroyed<URLSchemesMap> schemes;
return schemes;
}
-#endif
static URLSchemesMap& alwaysRevalidatedSchemes()
{
@@ -343,7 +341,6 @@
return alwaysRevalidatedSchemes().contains(scheme);
}
-#if ENABLE(CACHE_PARTITIONING)
void SchemeRegistry::registerURLSchemeAsCachePartitioned(const String& scheme)
{
cachePartitioningSchemes().add(scheme);
@@ -355,7 +352,6 @@
return false;
return cachePartitioningSchemes().contains(scheme);
}
-#endif
bool SchemeRegistry::isUserExtensionScheme(const String& scheme)
{
Modified: trunk/Source/WebCore/platform/SchemeRegistry.h (211945 => 211946)
--- trunk/Source/WebCore/platform/SchemeRegistry.h 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/platform/SchemeRegistry.h 2017-02-09 11:09:28 UTC (rev 211946)
@@ -94,11 +94,9 @@
WEBCORE_EXPORT static void registerURLSchemeAsAlwaysRevalidated(const String&);
static bool shouldAlwaysRevalidateURLScheme(const String&);
-#if ENABLE(CACHE_PARTITIONING)
// Schemes whose requests should be partitioned in the cache
WEBCORE_EXPORT static void registerURLSchemeAsCachePartitioned(const String& scheme);
static bool shouldPartitionCacheForURLScheme(const String& scheme);
-#endif
static bool isUserExtensionScheme(const String& scheme);
};
Modified: trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm (211945 => 211946)
--- trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm 2017-02-09 11:09:28 UTC (rev 211946)
@@ -66,9 +66,7 @@
WEBCORE_EXPORT bool (*wkIsPublicSuffix)(NSString *host);
#endif
-#if ENABLE(CACHE_PARTITIONING)
WEBCORE_EXPORT CFStringRef (*wkCachePartitionKey)(void);
-#endif
WEBCORE_EXPORT int (*wkExernalDeviceTypeForPlayer)(AVPlayer *);
WEBCORE_EXPORT NSString *(*wkExernalDeviceDisplayNameForPlayer)(AVPlayer *);
Modified: trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h (211945 => 211946)
--- trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h 2017-02-09 11:09:28 UTC (rev 211946)
@@ -235,9 +235,7 @@
extern bool (*wkIsPublicSuffix)(NSString *host);
#endif
-#if ENABLE(CACHE_PARTITIONING)
extern CFStringRef (*wkCachePartitionKey)(void);
-#endif
typedef enum {
wkExternalPlaybackTypeNone,
Modified: trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm (211945 => 211946)
--- trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm 2017-02-09 11:09:28 UTC (rev 211946)
@@ -113,9 +113,7 @@
bool (*wkIsPublicSuffix)(NSString *host);
#endif
-#if ENABLE(CACHE_PARTITIONING)
CFStringRef (*wkCachePartitionKey)(void);
-#endif
int (*wkExernalDeviceTypeForPlayer)(AVPlayer *);
NSString *(*wkExernalDeviceDisplayNameForPlayer)(AVPlayer *);
Modified: trunk/Source/WebCore/platform/network/ResourceHandleInternal.h (211945 => 211946)
--- trunk/Source/WebCore/platform/network/ResourceHandleInternal.h 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/platform/network/ResourceHandleInternal.h 2017-02-09 11:09:28 UTC (rev 211946)
@@ -79,11 +79,7 @@
, m_client(client)
, m_firstRequest(request)
, m_lastHTTPMethod(request.httpMethod())
-#if ENABLE(CACHE_PARTITIONING)
, m_partition(request.cachePartition())
-#else
- , m_partition(emptyString())
-#endif
, m_defersLoading(defersLoading)
, m_shouldContentSniff(shouldContentSniff)
, m_usesAsyncCallbacks(client && client->usesAsyncCallbacks())
Modified: trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp (211945 => 211946)
--- trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -27,6 +27,7 @@
#include "ResourceRequestBase.h"
#include "HTTPHeaderNames.h"
+#include "PublicSuffix.h"
#include "ResourceRequest.h"
#include <wtf/PointerComparison.h>
@@ -66,6 +67,7 @@
setPriority(other.priority());
setRequester(other.requester());
setInitiatorIdentifier(other.initiatorIdentifier().isolatedCopy());
+ setCachePartition(other.cachePartition());
updateResourceRequest();
m_httpHeaderFields = other.httpHeaderFields().isolatedCopy();
@@ -86,8 +88,6 @@
if (other.m_httpBody)
setHTTPBody(other.m_httpBody->isolatedCopy());
setAllowCookies(other.m_allowCookies);
-
- const_cast<ResourceRequest&>(asResourceRequest()).doPlatformSetAsIsolatedCopy(other);
}
bool ResourceRequestBase::isEmpty() const
@@ -640,4 +640,32 @@
}
#endif
+void ResourceRequestBase::setCachePartition(const String& cachePartition)
+{
+#if ENABLE(CACHE_PARTITIONING)
+ ASSERT(!cachePartition.isNull());
+ ASSERT(cachePartition == partitionName(cachePartition));
+ m_cachePartition = cachePartition;
+#else
+ UNUSED_PARAM(cachePartition);
+#endif
}
+
+String ResourceRequestBase::partitionName(const String& domain)
+{
+#if ENABLE(PUBLIC_SUFFIX_LIST)
+ if (domain.isNull())
+ return emptyString();
+ String highLevel = topPrivatelyControlledDomain(domain);
+ if (highLevel.isNull())
+ return emptyString();
+ return highLevel;
+#else
+#if ENABLE(CACHE_PARTITIONING)
+#error Cache partitioning requires PUBLIC_SUFFIX_LIST
+#endif
+ return emptyString();
+#endif
+}
+
+}
Modified: trunk/Source/WebCore/platform/network/ResourceRequestBase.h (211945 => 211946)
--- trunk/Source/WebCore/platform/network/ResourceRequestBase.h 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/platform/network/ResourceRequestBase.h 2017-02-09 11:09:28 UTC (rev 211946)
@@ -136,6 +136,11 @@
WEBCORE_EXPORT ResourceLoadPriority priority() const;
WEBCORE_EXPORT void setPriority(ResourceLoadPriority);
+ WEBCORE_EXPORT static String partitionName(const String& domain);
+ const String& cachePartition() const { return m_cachePartition; }
+ WEBCORE_EXPORT void setCachePartition(const String&);
+ void setDomainForCachePartition(const String& domain) { setCachePartition(partitionName(domain)); }
+
WEBCORE_EXPORT bool isConditional() const;
WEBCORE_EXPORT void makeUnconditional();
@@ -237,6 +242,7 @@
ResourceLoadPriority m_priority { ResourceLoadPriority::Low };
Requester m_requester { Requester::Unspecified };
String m_initiatorIdentifier;
+ String m_cachePartition { emptyString() };
private:
const ResourceRequest& asResourceRequest() const;
Modified: trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp (211945 => 211946)
--- trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -137,11 +137,7 @@
firstRequest().setURL(urlWithCredentials);
}
-#if ENABLE(CACHE_PARTITIONING)
String partition = firstRequest().cachePartition();
-#else
- String partition = emptyString();
-#endif
// <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication,
// try and reuse the credential preemptively, as allowed by RFC 2617.
@@ -306,11 +302,7 @@
d->m_lastHTTPMethod = request.httpMethod();
request.removeCredentials();
-#if ENABLE(CACHE_PARTITIONING)
String partition = firstRequest().cachePartition();
-#else
- String partition = emptyString();
-#endif
if (!protocolHostAndPortAreEqual(request.url(), redirectResponse.url())) {
// The network layer might carry over some headers from the original request that
@@ -395,11 +387,7 @@
if (!challenge.protectionSpace().isPasswordBased())
return false;
-#if ENABLE(CACHE_PARTITIONING)
String partition = firstRequest().cachePartition();
-#else
- String partition = emptyString();
-#endif
if (!d->m_user.isNull() && !d->m_pass.isNull()) {
RetainPtr<CFURLCredentialRef> cfCredential = adoptCF(CFURLCredentialCreate(kCFAllocatorDefault, d->m_user.createCFString().get(), d->m_pass.createCFString().get(), 0, kCFURLCredentialPersistenceNone));
@@ -490,14 +478,8 @@
if (challenge.failureResponse().httpStatusCode() == 401)
urlToStore = challenge.failureResponse().url();
-#if ENABLE(CACHE_PARTITIONING)
- String partition = firstRequest().cachePartition();
-#else
- String partition = emptyString();
-#endif
+ d->m_context->storageSession().credentialStorage().set(firstRequest().cachePartition(), webCredential, challenge.protectionSpace(), urlToStore);
- d->m_context->storageSession().credentialStorage().set(partition, webCredential, challenge.protectionSpace(), urlToStore);
-
if (d->m_connection) {
#if PLATFORM(COCOA)
CFURLConnectionUseCredential(d->m_connection.get(), webCredential.cfCredential(), challenge.cfURLAuthChallengeRef());
Modified: trunk/Source/WebCore/platform/network/cf/ResourceRequest.h (211945 => 211946)
--- trunk/Source/WebCore/platform/network/cf/ResourceRequest.h 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/platform/network/cf/ResourceRequest.h 2017-02-09 11:09:28 UTC (rev 211946)
@@ -94,17 +94,6 @@
WEBCORE_EXPORT static CFStringRef isUserInitiatedKey();
#endif
-#if ENABLE(CACHE_PARTITIONING)
- WEBCORE_EXPORT static String partitionName(const String& domain);
- const String& cachePartition() const { return m_cachePartition.isNull() ? emptyString() : m_cachePartition; }
- void setCachePartition(const String& cachePartition)
- {
- ASSERT(cachePartition == partitionName(cachePartition));
- m_cachePartition = cachePartition;
- }
- void setDomainForCachePartition(const String& domain) { m_cachePartition = partitionName(domain); }
-#endif
-
#if PLATFORM(COCOA) || USE(CFURLCONNECTION)
WEBCORE_EXPORT CFURLRequestRef cfURLRequest(HTTPBodyUpdatePolicy) const;
void setStorageSession(CFURLStorageSessionRef);
@@ -131,9 +120,6 @@
#if PLATFORM(COCOA)
RetainPtr<NSURLRequest> m_nsRequest;
#endif
-#if ENABLE(CACHE_PARTITIONING)
- String m_cachePartition;
-#endif
static bool s_httpPipeliningEnabled;
};
Modified: trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp (211945 => 211946)
--- trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -361,32 +361,6 @@
s_httpPipeliningEnabled = flag;
}
-#if ENABLE(CACHE_PARTITIONING)
-String ResourceRequest::partitionName(const 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
-
-void ResourceRequest::doPlatformSetAsIsolatedCopy(const ResourceRequest& other)
-{
-#if ENABLE(CACHE_PARTITIONING)
- m_cachePartition = other.m_cachePartition.isolatedCopy();
-#else
- UNUSED_PARAM(other);
-#endif
-}
-
-
// FIXME: It is confusing that this function both sets connection count and determines maximum request count at network layer. This can and should be done separately.
unsigned initializeMaximumHTTPConnectionCountPerHost()
{
Modified: trunk/Source/WebCore/platform/network/cf/ResourceResponse.h (211945 => 211946)
--- trunk/Source/WebCore/platform/network/cf/ResourceResponse.h 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/platform/network/cf/ResourceResponse.h 2017-02-09 11:09:28 UTC (rev 211946)
@@ -103,8 +103,6 @@
String platformSuggestedFilename() const;
CertificateInfo platformCertificateInfo() const;
- void doPlatformSetAsIsolatedCopy(const ResourceResponse&) const;
-
#if PLATFORM(COCOA)
void initNSURLResponse() const;
#endif
Modified: trunk/Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm (211945 => 211946)
--- trunk/Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm 2017-02-09 11:09:28 UTC (rev 211946)
@@ -148,13 +148,11 @@
m_responseContentDispositionEncodingFallbackArray.uncheckedAppend(CFStringConvertEncodingToIANACharSetName(encoding));
}
-#if ENABLE(CACHE_PARTITIONING)
if (m_nsRequest) {
NSString* cachePartition = [NSURLProtocol propertyForKey:(NSString *)wkCachePartitionKey() inRequest:m_nsRequest.get()];
if (cachePartition)
m_cachePartition = cachePartition;
}
-#endif
}
void ResourceRequest::doUpdateResourceHTTPBody()
@@ -218,13 +216,11 @@
}
[nsRequest setContentDispositionEncodingFallbackArray:encodingFallbacks];
-#if ENABLE(CACHE_PARTITIONING)
String partition = cachePartition();
if (!partition.isNull() && !partition.isEmpty()) {
NSString *partitionValue = [NSString stringWithUTF8String:partition.utf8().data()];
[NSURLProtocol setProperty:partitionValue forKey:(NSString *)wkCachePartitionKey() inRequest:nsRequest];
}
-#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200)
if (m_url.isLocalFile()) {
Modified: trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp (211945 => 211946)
--- trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -179,11 +179,7 @@
void ResourceHandle::didReceiveAuthenticationChallenge(const AuthenticationChallenge& challenge)
{
-#if ENABLE(CACHE_PARTITIONING)
String partition = firstRequest().cachePartition();
-#else
- String partition = emptyString();
-#endif
if (!d->m_user.isNull() && !d->m_pass.isNull()) {
Credential credential(d->m_user, d->m_pass, CredentialPersistenceNone);
@@ -241,11 +237,7 @@
return;
}
-#if ENABLE(CACHE_PARTITIONING)
String partition = firstRequest().cachePartition();
-#else
- String partition = emptyString();
-#endif
if (shouldUseCredentialStorage()) {
if (challenge.failureResponse().httpStatusCode() == 401) {
Modified: trunk/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp (211945 => 211946)
--- trunk/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/platform/network/curl/ResourceHandleManager.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -1041,11 +1041,7 @@
// m_user/m_pass are credentials given manually, for instance, by the arguments passed to XMLHttpRequest.open().
ResourceHandleInternal* d = handle->getInternal();
-#if ENABLE(CACHE_PARTITIONING)
String partition = handle->firstRequest().cachePartition();
-#else
- String partition = emptyString();
-#endif
if (handle->shouldUseCredentialStorage()) {
if (d->m_user.isEmpty() && d->m_pass.isEmpty()) {
Modified: trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm (211945 => 211946)
--- trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm 2017-02-09 11:09:28 UTC (rev 211946)
@@ -151,12 +151,7 @@
if (d->m_user.isEmpty() && d->m_pass.isEmpty()) {
// <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication,
// try and reuse the credential preemptively, as allowed by RFC 2617.
-#if ENABLE(CACHE_PARTITIONING)
- String partition = firstRequest().cachePartition();
-#else
- String partition = emptyString();
-#endif
- d->m_initialCredential = d->m_context->storageSession().credentialStorage().get(partition, firstRequest().url());
+ d->m_initialCredential = d->m_context->storageSession().credentialStorage().get(firstRequest().cachePartition(), firstRequest().url());
} else {
// If there is already a protection space known for the URL, update stored credentials before sending a request.
// This makes it possible to implement logout by sending an XMLHttpRequest with known incorrect credentials, and aborting it immediately
Modified: trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp (211945 => 211946)
--- trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -201,11 +201,7 @@
// m_user/m_pass are credentials given manually, for instance, by the arguments passed to XMLHttpRequest.open().
ResourceHandleInternal* d = handle->getInternal();
-#if ENABLE(CACHE_PARTITIONING)
- String partition = firstRequest().cachePartition();
-#else
- String partition = emptyString();
-#endif
+ String partition = request.cachePartition();
if (handle->shouldUseCredentialStorage()) {
if (d->m_user.isEmpty() && d->m_pass.isEmpty())
@@ -829,11 +825,7 @@
{
ASSERT(d->m_currentWebChallenge.isNull());
-#if ENABLE(CACHE_PARTITIONING)
String partition = firstRequest().cachePartition();
-#else
- String partition = emptyString();
-#endif
// FIXME: Per the specification, the user shouldn't be asked for credentials if there were incorrect ones provided explicitly.
bool useCredentialStorage = shouldUseCredentialStorage();
@@ -899,11 +891,7 @@
return;
}
-#if ENABLE(CACHE_PARTITIONING)
String partition = firstRequest().cachePartition();
-#else
- String partition = emptyString();
-#endif
if (shouldUseCredentialStorage()) {
// Eventually we will manage per-session credentials only internally or use some newly-exposed API from libsoup,
Modified: trunk/Source/WebCore/testing/Internals.cpp (211945 => 211946)
--- trunk/Source/WebCore/testing/Internals.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebCore/testing/Internals.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -563,9 +563,8 @@
return false;
ResourceRequest request(contextDocument()->completeURL(url));
-#if ENABLE(CACHE_PARTITIONING)
request.setDomainForCachePartition(contextDocument()->topOrigin().domainForCachePartition());
-#endif
+
CachedResource* resource = MemoryCache::singleton().resourceForRequest(request, contextDocument()->page()->sessionID());
return resource && resource->status() == CachedResource::Cached;
}
Modified: trunk/Source/WebKit/mac/ChangeLog (211945 => 211946)
--- trunk/Source/WebKit/mac/ChangeLog 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit/mac/ChangeLog 2017-02-09 11:09:28 UTC (rev 211946)
@@ -1,3 +1,16 @@
+2017-02-09 Antti Koivisto <[email protected]>
+
+ Remove most cases of #if ENABLE(CACHE_PARTITIONING)
+ https://bugs.webkit.org/show_bug.cgi?id=167990
+
+ Reviewed by Sam Weinig.
+
+ * Misc/WebCache.mm:
+ (+[WebCache addImageToCache:forURL:forFrame:]):
+ (+[WebCache removeImageFromCacheForURL:forFrame:]):
+ * WebCoreSupport/WebSystemInterface.mm:
+ (InitWebCoreSystemInterface):
+
2017-02-07 Alexey Proskuryakov <[email protected]>
Don't migrate WebKit DOM headers in MigrateHeaders.make
Modified: trunk/Source/WebKit/mac/Misc/WebCache.mm (211945 => 211946)
--- trunk/Source/WebKit/mac/Misc/WebCache.mm 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit/mac/Misc/WebCache.mm 2017-02-09 11:09:28 UTC (rev 211946)
@@ -34,6 +34,7 @@
#import <WebCore/ApplicationCacheStorage.h>
#import <WebCore/CredentialStorage.h>
#import <WebCore/CrossOriginPreflightResultCache.h>
+#import <WebCore/Document.h>
#import <WebCore/MemoryCache.h>
#import <runtime/InitializeThreading.h>
#import <wtf/MainThread.h>
@@ -48,10 +49,6 @@
#import <WebCore/WebCoreThreadRun.h>
#endif
-#if ENABLE(CACHE_PARTITIONING)
-#import <WebCore/Document.h>
-#endif
-
@implementation WebCache
+ (void)initialize
@@ -168,10 +165,8 @@
if (!image || !url || ![[url absoluteString] length])
return false;
WebCore::SecurityOrigin* topOrigin = nullptr;
-#if ENABLE(CACHE_PARTITIONING)
if (frame)
topOrigin = &core(frame)->document()->topOrigin();
-#endif
return WebCore::MemoryCache::singleton().addImageToCache(RetainPtr<CGImageRef>(image), url, topOrigin ? topOrigin->domainForCachePartition() : emptyString());
}
@@ -185,10 +180,8 @@
if (!url)
return;
WebCore::SecurityOrigin* topOrigin = nullptr;
-#if ENABLE(CACHE_PARTITIONING)
if (frame)
topOrigin = &core(frame)->document()->topOrigin();
-#endif
WebCore::MemoryCache::singleton().removeImageFromCache(url, topOrigin ? topOrigin->domainForCachePartition() : emptyString());
}
Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm (211945 => 211946)
--- trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm 2017-02-09 11:09:28 UTC (rev 211946)
@@ -124,9 +124,7 @@
INIT(IsPublicSuffix);
#endif
-#if ENABLE(CACHE_PARTITIONING)
INIT(CachePartitionKey);
-#endif
INIT(ExernalDeviceTypeForPlayer);
INIT(ExernalDeviceDisplayNameForPlayer);
Modified: trunk/Source/WebKit2/ChangeLog (211945 => 211946)
--- trunk/Source/WebKit2/ChangeLog 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit2/ChangeLog 2017-02-09 11:09:28 UTC (rev 211946)
@@ -1,3 +1,38 @@
+2017-02-09 Antti Koivisto <[email protected]>
+
+ Remove most cases of #if ENABLE(CACHE_PARTITIONING)
+ https://bugs.webkit.org/show_bug.cgi?id=167990
+
+ Reviewed by Sam Weinig.
+
+ * NetworkProcess/NetworkResourceLoader.cpp:
+ (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
+ * NetworkProcess/cache/NetworkCache.cpp:
+ (WebKit::NetworkCache::Cache::makeCacheKey):
+ * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
+ (WebKit::NetworkCache::constructRevalidationRequest):
+ * Shared/WebCoreArgumentCoders.cpp:
+ (IPC::ArgumentCoder<ResourceRequest>::encode):
+ (IPC::ArgumentCoder<ResourceRequest>::decode):
+ * Shared/WebProcessCreationParameters.cpp:
+ (WebKit::WebProcessCreationParameters::encode):
+ (WebKit::WebProcessCreationParameters::decode):
+ * Shared/WebProcessCreationParameters.h:
+ * UIProcess/API/C/WKContext.cpp:
+ (WKContextRegisterURLSchemeAsCachePartitioned):
+ * UIProcess/WebProcessPool.cpp:
+ (WebKit::m_hiddenPageThrottlingTimer):
+ (WebKit::WebProcessPool::createNewWebProcess):
+ (WebKit::WebProcessPool::registerURLSchemeAsCachePartitioned):
+ * UIProcess/WebProcessPool.h:
+ * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+ (InitWebCoreSystemInterface):
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::initializeWebProcess):
+ (WebKit::WebProcess::registerURLSchemeAsCachePartitioned):
+ * WebProcess/WebProcess.h:
+ * WebProcess/WebProcess.messages.in:
+
2017-02-08 Simon Fraser <[email protected]>
Put names on more UIViews for ease of debugging
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkDataTask.cpp (211945 => 211946)
--- trunk/Source/WebKit2/NetworkProcess/NetworkDataTask.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkDataTask.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -63,11 +63,7 @@
: m_failureTimer(*this, &NetworkDataTask::failureTimerFired)
, m_session(session)
, m_client(&client)
-#if ENABLE(CACHE_PARTITIONING)
, m_partition(requestWithCredentials.cachePartition())
-#else
- , m_partition(emptyString())
-#endif
, m_storedCredentials(storedCredentials)
, m_lastHTTPMethod(requestWithCredentials.httpMethod())
, m_firstRequest(requestWithCredentials)
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (211945 => 211946)
--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -572,17 +572,12 @@
send(Messages::WebResourceLoader::DidReceiveResponse(entry->response(), needsContinueDidReceiveResponseMessage));
if (entry->sourceStorageRecord().bodyHash && !m_parameters.derivedCachedDataTypesToRetrieve.isEmpty()) {
-#if ENABLE(CACHE_PARTITIONING)
- String partition = originalRequest().cachePartition();
-#else
- String partition;
-#endif
auto bodyHash = *entry->sourceStorageRecord().bodyHash;
auto* entryPtr = entry.release();
auto retrieveCount = m_parameters.derivedCachedDataTypesToRetrieve.size();
for (auto& type : m_parameters.derivedCachedDataTypesToRetrieve) {
- NetworkCache::DataKey key { partition, type, bodyHash };
+ NetworkCache::DataKey key { originalRequest().cachePartition(), type, bodyHash };
NetworkCache::singleton().retrieveData(key, [loader = makeRef(*this), entryPtr, type, retrieveCount] (const uint8_t* data, size_t size) mutable {
loader->m_retrievedDerivedDataCount++;
bool retrievedAll = loader->m_retrievedDerivedDataCount == retrieveCount;
Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp (211945 => 211946)
--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -116,16 +116,10 @@
Key Cache::makeCacheKey(const WebCore::ResourceRequest& request)
{
-#if ENABLE(CACHE_PARTITIONING)
- String partition = request.cachePartition();
-#else
- String partition;
-#endif
-
// FIXME: This implements minimal Range header disk cache support. We don't parse
// ranges so only the same exact range request will be served from the cache.
String range = request.httpHeaderField(WebCore::HTTPHeaderName::Range);
- return { partition, resourceType(), range, request.url().string(), m_storage->salt() };
+ return { request.cachePartition(), resourceType(), range, request.url().string(), m_storage->salt() };
}
static bool cachePolicyAllowsExpired(WebCore::ResourceRequestCachePolicy policy)
Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp (211945 => 211946)
--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -89,12 +89,10 @@
ResourceRequest revalidationRequest(key.identifier());
revalidationRequest.setHTTPHeaderFields(subResourceInfo.requestHeaders());
revalidationRequest.setFirstPartyForCookies(subResourceInfo.firstPartyForCookies());
-#if ENABLE(CACHE_PARTITIONING)
if (!key.partition().isEmpty())
revalidationRequest.setCachePartition(key.partition());
-#endif
ASSERT_WITH_MESSAGE(key.range().isEmpty(), "range is not supported");
-
+
revalidationRequest.makeUnconditional();
if (entry) {
String eTag = entry->response().httpHeaderField(HTTPHeaderName::ETag);
Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (211945 => 211946)
--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -979,10 +979,7 @@
void ArgumentCoder<ResourceRequest>::encode(Encoder& encoder, const ResourceRequest& resourceRequest)
{
-#if ENABLE(CACHE_PARTITIONING)
encoder << resourceRequest.cachePartition();
-#endif
-
encoder << resourceRequest.hiddenFromInspector();
if (resourceRequest.encodingRequiresPlatformData()) {
@@ -996,12 +993,10 @@
bool ArgumentCoder<ResourceRequest>::decode(Decoder& decoder, ResourceRequest& resourceRequest)
{
-#if ENABLE(CACHE_PARTITIONING)
String cachePartition;
if (!decoder.decode(cachePartition))
return false;
resourceRequest.setCachePartition(cachePartition);
-#endif
bool isHiddenFromInspector;
if (!decoder.decode(isHiddenFromInspector))
Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp (211945 => 211946)
--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -91,9 +91,7 @@
encoder << urlSchemesRegisteredAsDisplayIsolated;
encoder << urlSchemesRegisteredAsCORSEnabled;
encoder << urlSchemesRegisteredAsAlwaysRevalidated;
-#if ENABLE(CACHE_PARTITIONING)
encoder << urlSchemesRegisteredAsCachePartitioned;
-#endif
encoder.encodeEnum(cacheModel);
encoder << shouldAlwaysUseComplexTextCodePath;
encoder << shouldEnableMemoryPressureReliefLogging;
@@ -221,10 +219,8 @@
return false;
if (!decoder.decode(parameters.urlSchemesRegisteredAsAlwaysRevalidated))
return false;
-#if ENABLE(CACHE_PARTITIONING)
if (!decoder.decode(parameters.urlSchemesRegisteredAsCachePartitioned))
return false;
-#endif
if (!decoder.decodeEnum(parameters.cacheModel))
return false;
if (!decoder.decode(parameters.shouldAlwaysUseComplexTextCodePath))
Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h (211945 => 211946)
--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h 2017-02-09 11:09:28 UTC (rev 211946)
@@ -100,9 +100,7 @@
Vector<String> urlSchemesRegisteredAsDisplayIsolated;
Vector<String> urlSchemesRegisteredAsCORSEnabled;
Vector<String> urlSchemesRegisteredAsAlwaysRevalidated;
-#if ENABLE(CACHE_PARTITIONING)
Vector<String> urlSchemesRegisteredAsCachePartitioned;
-#endif
CacheModel cacheModel;
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp (211945 => 211946)
--- trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -379,12 +379,7 @@
void WKContextRegisterURLSchemeAsCachePartitioned(WKContextRef contextRef, WKStringRef urlScheme)
{
-#if ENABLE(CACHE_PARTITIONING)
toImpl(contextRef)->registerURLSchemeAsCachePartitioned(toImpl(urlScheme)->string());
-#else
- UNUSED_PARAM(contextRef);
- UNUSED_PARAM(urlScheme);
-#endif
}
void WKContextSetDomainRelaxationForbiddenForURLScheme(WKContextRef contextRef, WKStringRef urlScheme)
Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp (211945 => 211946)
--- trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -187,10 +187,8 @@
for (auto& scheme : m_configuration->alwaysRevalidatedURLSchemes())
m_schemesToRegisterAsAlwaysRevalidated.add(scheme);
-#if ENABLE(CACHE_PARTITIONING)
for (const auto& urlScheme : m_configuration->cachePartitionedURLSchemes())
m_schemesToRegisterAsCachePartitioned.add(urlScheme);
-#endif
platformInitialize();
@@ -596,9 +594,7 @@
copyToVector(m_schemesToRegisterAsDisplayIsolated, parameters.urlSchemesRegisteredAsDisplayIsolated);
copyToVector(m_schemesToRegisterAsCORSEnabled, parameters.urlSchemesRegisteredAsCORSEnabled);
copyToVector(m_schemesToRegisterAsAlwaysRevalidated, parameters.urlSchemesRegisteredAsAlwaysRevalidated);
-#if ENABLE(CACHE_PARTITIONING)
copyToVector(m_schemesToRegisterAsCachePartitioned, parameters.urlSchemesRegisteredAsCachePartitioned);
-#endif
parameters.shouldAlwaysUseComplexTextCodePath = m_alwaysUsesComplexTextCodePath;
parameters.shouldUseFontSmoothing = m_shouldUseFontSmoothing;
@@ -1004,13 +1000,11 @@
processPool->unregisterSchemeForCustomProtocol(urlScheme);
}
-#if ENABLE(CACHE_PARTITIONING)
void WebProcessPool::registerURLSchemeAsCachePartitioned(const String& urlScheme)
{
m_schemesToRegisterAsCachePartitioned.add(urlScheme);
sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsCachePartitioned(urlScheme));
}
-#endif
void WebProcessPool::setCacheModel(CacheModel cacheModel)
{
Modified: trunk/Source/WebKit2/UIProcess/WebProcessPool.h (211945 => 211946)
--- trunk/Source/WebKit2/UIProcess/WebProcessPool.h 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit2/UIProcess/WebProcessPool.h 2017-02-09 11:09:28 UTC (rev 211946)
@@ -210,9 +210,7 @@
void registerURLSchemeAsNoAccess(const String&);
void registerURLSchemeAsDisplayIsolated(const String&);
void registerURLSchemeAsCORSEnabled(const String&);
-#if ENABLE(CACHE_PARTITIONING)
void registerURLSchemeAsCachePartitioned(const String&);
-#endif
VisitedLinkStore& visitedLinkStore() { return m_visitedLinkStore.get(); }
@@ -499,9 +497,7 @@
HashSet<String> m_schemesToRegisterAsDisplayIsolated;
HashSet<String> m_schemesToRegisterAsCORSEnabled;
HashSet<String> m_schemesToRegisterAsAlwaysRevalidated;
-#if ENABLE(CACHE_PARTITIONING)
HashSet<String> m_schemesToRegisterAsCachePartitioned;
-#endif
bool m_alwaysUsesComplexTextCodePath;
bool m_shouldUseFontSmoothing;
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (211945 => 211946)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -1589,11 +1589,7 @@
bool PluginView::getAuthenticationInfo(const ProtectionSpace& protectionSpace, String& username, String& password)
{
-#if ENABLE(CACHE_PARTITIONING)
String partitionName = m_pluginElement->contentDocument()->topDocument().securityOrigin().domainForCachePartition();
-#else
- String partitionName = emptyString();
-#endif
Credential credential = CredentialStorage::defaultCredentialStorage().get(partitionName, protectionSpace);
if (credential.isEmpty())
credential = CredentialStorage::defaultCredentialStorage().getFromPersistentStorage(protectionSpace);
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm (211945 => 211946)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm 2017-02-09 11:09:28 UTC (rev 211946)
@@ -111,9 +111,7 @@
INIT(IsPublicSuffix);
#endif
-#if ENABLE(CACHE_PARTITIONING)
INIT(CachePartitionKey);
-#endif
INIT(ExernalDeviceTypeForPlayer);
INIT(ExernalDeviceDisplayNameForPlayer);
Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (211945 => 211946)
--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp 2017-02-09 11:09:28 UTC (rev 211946)
@@ -337,10 +337,8 @@
for (auto& scheme : parameters.urlSchemesRegisteredAsAlwaysRevalidated)
registerURLSchemeAsAlwaysRevalidated(scheme);
-#if ENABLE(CACHE_PARTITIONING)
for (auto& scheme : parameters.urlSchemesRegisteredAsCachePartitioned)
registerURLSchemeAsCachePartitioned(scheme);
-#endif
setDefaultRequestTimeoutInterval(parameters.defaultRequestTimeoutInterval);
@@ -462,12 +460,10 @@
SchemeRegistry::registerURLSchemeAsAlwaysRevalidated(urlScheme);
}
-#if ENABLE(CACHE_PARTITIONING)
void WebProcess::registerURLSchemeAsCachePartitioned(const String& urlScheme) const
{
SchemeRegistry::registerURLSchemeAsCachePartitioned(urlScheme);
}
-#endif
void WebProcess::setDefaultRequestTimeoutInterval(double timeoutInterval)
{
Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (211945 => 211946)
--- trunk/Source/WebKit2/WebProcess/WebProcess.h 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h 2017-02-09 11:09:28 UTC (rev 211946)
@@ -257,9 +257,7 @@
void registerURLSchemeAsDisplayIsolated(const String&) const;
void registerURLSchemeAsCORSEnabled(const String&) const;
void registerURLSchemeAsAlwaysRevalidated(const String&) const;
-#if ENABLE(CACHE_PARTITIONING)
void registerURLSchemeAsCachePartitioned(const String&) const;
-#endif
void setDefaultRequestTimeoutInterval(double);
void setAlwaysUsesComplexTextCodePath(bool);
void setShouldUseFontSmoothing(bool);
Modified: trunk/Source/WebKit2/WebProcess/WebProcess.messages.in (211945 => 211946)
--- trunk/Source/WebKit2/WebProcess/WebProcess.messages.in 2017-02-09 10:41:16 UTC (rev 211945)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.messages.in 2017-02-09 11:09:28 UTC (rev 211946)
@@ -36,9 +36,7 @@
RegisterURLSchemeAsNoAccess(String scheme)
RegisterURLSchemeAsDisplayIsolated(String scheme)
RegisterURLSchemeAsCORSEnabled(String scheme)
-#if ENABLE(CACHE_PARTITIONING)
RegisterURLSchemeAsCachePartitioned(String scheme)
-#endif
SetDefaultRequestTimeoutInterval(double timeoutInterval)
SetAlwaysUsesComplexTextCodePath(bool alwaysUseComplexText)
SetShouldUseFontSmoothing(bool useFontSmoothing)