Title: [146701] trunk/Source/WebCore
Revision
146701
Author
[email protected]
Date
2013-03-22 18:19:35 -0700 (Fri, 22 Mar 2013)

Log Message

Set the cache partition property on CFURLRequests
https://bugs.webkit.org/show_bug.cgi?id=113116

Patch by Jeffrey Pfau
Reviewed by David Kilzer.

* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdateResourceRequest):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (146700 => 146701)


--- trunk/Source/WebCore/ChangeLog	2013-03-23 01:17:43 UTC (rev 146700)
+++ trunk/Source/WebCore/ChangeLog	2013-03-23 01:19:35 UTC (rev 146701)
@@ -1,3 +1,15 @@
+2013-03-22  Andy Estes  <[email protected]>
+
+        Set the cache partition property on CFURLRequests
+        https://bugs.webkit.org/show_bug.cgi?id=113116
+
+        Patch by Jeffrey Pfau
+        Reviewed by David Kilzer.
+
+        * platform/network/cf/ResourceRequestCFNet.cpp:
+        (WebCore::ResourceRequest::doUpdatePlatformRequest):
+        (WebCore::ResourceRequest::doUpdateResourceRequest):
+
 2013-03-22  Julien Chaffraix  <[email protected]>
 
         [CSS Grid Layout] content-sized row tracks with percentage logical height grid items don't resolve properly

Modified: trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp (146700 => 146701)


--- trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp	2013-03-23 01:17:43 UTC (rev 146700)
+++ trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp	2013-03-23 01:19:35 UTC (rev 146701)
@@ -36,6 +36,7 @@
 #if USE(CFNETWORK)
 #include "FormDataStreamCFNet.h"
 #include <CFNetwork/CFURLRequestPriv.h>
+#include <wtf/text/CString.h>
 #endif
 
 #if PLATFORM(MAC)
@@ -171,6 +172,15 @@
         CFURLRequestSetSSLProperties(cfRequest, CFURLRequestGetSSLProperties(m_cfRequest.get()));
     }
 
+#if ENABLE(CACHE_PARTITIONING)
+    String partition = cachePartition();
+    if (!partition.isNull() && !partition.isEmpty()) {
+        CString utf8String = partition.utf8();
+        RetainPtr<CFStringRef> partitionValue(AdoptCF, CFStringCreateWithBytes(0, reinterpret_cast<const UInt8*>(utf8String.data()), utf8String.length(), kCFStringEncodingUTF8, false));
+        _CFURLRequestSetProtocolProperty(cfRequest, wkCachePartitionKey(), partitionValue.get());
+    }
+#endif
+
     m_cfRequest.adoptCF(cfRequest);
 #if PLATFORM(MAC)
     updateNSURLRequest();
@@ -255,6 +265,12 @@
                 m_responseContentDispositionEncodingFallbackArray.append(CFStringConvertEncodingToIANACharSetName(encoding));
         }
     }
+
+#if ENABLE(CACHE_PARTITIONING)
+    RetainPtr<CFStringRef> cachePartition(AdoptCF, static_cast<CFStringRef>(_CFURLRequestCopyProtocolPropertyForKey(m_cfRequest.get(), wkCachePartitionKey())));
+    if (cachePartition)
+        m_cachePartition = cachePartition.get();
+#endif
 }
 
 void ResourceRequest::doUpdateResourceHTTPBody()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to