Title: [202888] trunk/Source
- Revision
- 202888
- Author
- [email protected]
- Date
- 2016-07-06 18:32:43 -0700 (Wed, 06 Jul 2016)
Log Message
[WK2][Cocoa] Disable ResourceResponse lazy initialization
https://bugs.webkit.org/show_bug.cgi?id=159497
<rdar://problem/27209066>
Reviewed by Alex Christensen.
Source/WebCore:
Add method to Cocoa's ResponseResponse header to disable
lazy initialization.
* platform/network/cf/ResourceResponse.h:
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::disableLazyInitialization):
Source/WebKit2:
Disable ResourceResponse lazy initialization for WebKit2 as
we always end up initializing all the fields anyway when
sending the response to the WebContent process via IPC.
Even worse, we always do a partial lazy initialization (common
fields only) before the IPC so we always do the initialization
in 2 steps. This normally would not be an issue but the 2 steps
actually have some overlap because both call
CFHTTPMessageCopyAllHeaderFields(), which is expensive (See
<rdar://problem/26796059>) to first get the common HTTP headers,
then ALL the HTTP headers.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (202887 => 202888)
--- trunk/Source/WebCore/ChangeLog 2016-07-07 01:02:57 UTC (rev 202887)
+++ trunk/Source/WebCore/ChangeLog 2016-07-07 01:32:43 UTC (rev 202888)
@@ -1,3 +1,18 @@
+2016-07-06 Chris Dumez <[email protected]>
+
+ [WK2][Cocoa] Disable ResourceResponse lazy initialization
+ https://bugs.webkit.org/show_bug.cgi?id=159497
+ <rdar://problem/27209066>
+
+ Reviewed by Alex Christensen.
+
+ Add method to Cocoa's ResponseResponse header to disable
+ lazy initialization.
+
+ * platform/network/cf/ResourceResponse.h:
+ * platform/network/cocoa/ResourceResponseCocoa.mm:
+ (WebCore::ResourceResponse::disableLazyInitialization):
+
2016-07-06 Brent Fulgham <[email protected]>
Return values of JSArray::createUninitialized (and related) are not consistently checked for nullptr
Modified: trunk/Source/WebCore/platform/network/cf/ResourceResponse.h (202887 => 202888)
--- trunk/Source/WebCore/platform/network/cf/ResourceResponse.h 2016-07-07 01:02:57 UTC (rev 202887)
+++ trunk/Source/WebCore/platform/network/cf/ResourceResponse.h 2016-07-07 01:32:43 UTC (rev 202888)
@@ -68,6 +68,10 @@
{
}
+#if PLATFORM(COCOA)
+ WEBCORE_EXPORT void disableLazyInitialization();
+#endif
+
unsigned memoryUsage() const
{
// FIXME: Find some programmatic lighweight way to calculate ResourceResponse and associated classes.
Modified: trunk/Source/WebCore/platform/network/cocoa/ResourceResponseCocoa.mm (202887 => 202888)
--- trunk/Source/WebCore/platform/network/cocoa/ResourceResponseCocoa.mm 2016-07-07 01:02:57 UTC (rev 202887)
+++ trunk/Source/WebCore/platform/network/cocoa/ResourceResponseCocoa.mm 2016-07-07 01:32:43 UTC (rev 202888)
@@ -68,6 +68,11 @@
[m_nsResponse.get() _setMIMEType:(NSString *)m_mimeType];
}
+void ResourceResponse::disableLazyInitialization()
+{
+ lazyInit(AllFields);
+}
+
CertificateInfo ResourceResponse::platformCertificateInfo() const
{
#if USE(CFNETWORK)
Modified: trunk/Source/WebKit2/ChangeLog (202887 => 202888)
--- trunk/Source/WebKit2/ChangeLog 2016-07-07 01:02:57 UTC (rev 202887)
+++ trunk/Source/WebKit2/ChangeLog 2016-07-07 01:32:43 UTC (rev 202888)
@@ -1,3 +1,26 @@
+2016-07-06 Chris Dumez <[email protected]>
+
+ [WK2][Cocoa] Disable ResourceResponse lazy initialization
+ https://bugs.webkit.org/show_bug.cgi?id=159497
+ <rdar://problem/27209066>
+
+ Reviewed by Alex Christensen.
+
+ Disable ResourceResponse lazy initialization for WebKit2 as
+ we always end up initializing all the fields anyway when
+ sending the response to the WebContent process via IPC.
+
+ Even worse, we always do a partial lazy initialization (common
+ fields only) before the IPC so we always do the initialization
+ in 2 steps. This normally would not be an issue but the 2 steps
+ actually have some overlap because both call
+ CFHTTPMessageCopyAllHeaderFields(), which is expensive (See
+ <rdar://problem/26796059>) to first get the common HTTP headers,
+ then ALL the HTTP headers.
+
+ * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+ (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
+
2016-07-06 Chelsea Pugh <[email protected]>
[iOS] Text suggestions should be cleared when form input session is invalidated
Modified: trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm (202887 => 202888)
--- trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm 2016-07-07 01:02:57 UTC (rev 202887)
+++ trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm 2016-07-07 01:32:43 UTC (rev 202888)
@@ -245,6 +245,10 @@
}
WebCore::ResourceResponse resourceResponse(response);
+ // Lazy initialization is not helpful in the WebKit2 case because we always end up initializing
+ // all the fields when sending the response to the WebContent process over IPC.
+ resourceResponse.disableLazyInitialization();
+
copyTimingData([dataTask _timingData], resourceResponse.resourceLoadTiming());
auto completionHandlerCopy = Block_copy(completionHandler);
networkDataTask->didReceiveResponse(WTFMove(resourceResponse), [completionHandlerCopy, taskIdentifier](WebCore::PolicyAction policyAction) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes