Title: [170642] trunk/Source/WebCore
Revision
170642
Author
psola...@apple.com
Date
2014-07-01 09:45:03 -0700 (Tue, 01 Jul 2014)

Log Message

Create NSURLRequest lazily when USE(CFNETWORK) is enabled
https://bugs.webkit.org/show_bug.cgi?id=134441

Reviewed by Andreas Kling.

No new tests. Should be covered by existing tests.

* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::ResourceRequest):
(WebCore::ResourceRequest::encodingRequiresPlatformData):
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
(WebCore::ResourceRequest::setStorageSession):
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::nsURLRequest):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (170641 => 170642)


--- trunk/Source/WebCore/ChangeLog	2014-07-01 16:43:03 UTC (rev 170641)
+++ trunk/Source/WebCore/ChangeLog	2014-07-01 16:45:03 UTC (rev 170642)
@@ -1,3 +1,22 @@
+2014-07-01  Pratik Solanki  <psola...@apple.com>
+
+        Create NSURLRequest lazily when USE(CFNETWORK) is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=134441
+
+        Reviewed by Andreas Kling.
+
+        No new tests. Should be covered by existing tests.
+
+        * platform/network/cf/ResourceRequest.h:
+        (WebCore::ResourceRequest::ResourceRequest):
+        (WebCore::ResourceRequest::encodingRequiresPlatformData):
+        * platform/network/cf/ResourceRequestCFNet.cpp:
+        (WebCore::ResourceRequest::doUpdatePlatformRequest):
+        (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
+        (WebCore::ResourceRequest::setStorageSession):
+        * platform/network/cocoa/ResourceRequestCocoa.mm:
+        (WebCore::ResourceRequest::nsURLRequest):
+
 2014-07-01  Brady Eidson  <beid...@apple.com>
 
         Combine the Telephone and Selection overlay controllers, updating UI behavior.

Modified: trunk/Source/WebCore/platform/network/cf/ResourceRequest.h (170641 => 170642)


--- trunk/Source/WebCore/platform/network/cf/ResourceRequest.h	2014-07-01 16:43:03 UTC (rev 170641)
+++ trunk/Source/WebCore/platform/network/cf/ResourceRequest.h	2014-07-01 16:45:03 UTC (rev 170642)
@@ -72,9 +72,6 @@
             : ResourceRequestBase()
             , m_cfRequest(cfRequest)
         {
-#if PLATFORM(COCOA)
-            updateNSURLRequest();
-#endif
         }
 #else
         ResourceRequest(NSURLRequest *nsRequest)
@@ -90,7 +87,11 @@
         void applyWebArchiveHackForMail();
 #endif
 #if PLATFORM(COCOA)
+#if USE(CFNETWORK)
+        bool encodingRequiresPlatformData() const { return m_httpBody || m_cfRequest; }
+#else
         bool encodingRequiresPlatformData() const { return m_httpBody || m_nsRequest; }
+#endif
         NSURLRequest *nsURLRequest(HTTPBodyUpdatePolicy) const;
 #endif
 

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


--- trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp	2014-07-01 16:43:03 UTC (rev 170641)
+++ trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp	2014-07-01 16:45:03 UTC (rev 170642)
@@ -196,7 +196,7 @@
 
     m_cfRequest = adoptCF(cfRequest);
 #if PLATFORM(COCOA)
-    updateNSURLRequest();
+    m_nsRequest = nullptr;
 #endif
 }
 
@@ -231,7 +231,7 @@
 
     m_cfRequest = adoptCF(cfRequest);
 #if PLATFORM(COCOA)
-    updateNSURLRequest();
+    m_nsRequest = nullptr;
 #endif
 }
 
@@ -343,7 +343,7 @@
     wkSetRequestStorageSession(storageSession, cfRequest);
     m_cfRequest = adoptCF(cfRequest);
 #if PLATFORM(COCOA)
-    updateNSURLRequest();
+    m_nsRequest = nullptr;
 #endif
 }
 

Modified: trunk/Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm (170641 => 170642)


--- trunk/Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm	2014-07-01 16:43:03 UTC (rev 170641)
+++ trunk/Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm	2014-07-01 16:45:03 UTC (rev 170642)
@@ -53,6 +53,10 @@
 NSURLRequest *ResourceRequest::nsURLRequest(HTTPBodyUpdatePolicy bodyPolicy) const
 {
     updatePlatformRequest(bodyPolicy);
+#if USE(CFNETWORK)
+    if (!m_nsRequest)
+        const_cast<ResourceRequest*>(this)->updateNSURLRequest();
+#endif
     return [[m_nsRequest.get() retain] autorelease];
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to