Title: [202080] trunk/Source/WebKit2
Revision
202080
Author
[email protected]
Date
2016-06-14 19:18:02 -0700 (Tue, 14 Jun 2016)

Log Message

Avoid constructing a AuthenticationChallenge unnecessarily in the NetworkLoad constructor
https://bugs.webkit.org/show_bug.cgi?id=158746

Reviewed by Darin Adler.

Avoid constructing a AuthenticationChallenge unnecessarily in the
NetworkLoad constructor by using WTF::Optional<> for this data
member.

* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
* NetworkProcess/NetworkLoad.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (202079 => 202080)


--- trunk/Source/WebKit2/ChangeLog	2016-06-15 02:07:38 UTC (rev 202079)
+++ trunk/Source/WebKit2/ChangeLog	2016-06-15 02:18:02 UTC (rev 202080)
@@ -1,5 +1,20 @@
 2016-06-14  Chris Dumez  <[email protected]>
 
+        Avoid constructing a AuthenticationChallenge unnecessarily in the NetworkLoad constructor
+        https://bugs.webkit.org/show_bug.cgi?id=158746
+
+        Reviewed by Darin Adler.
+
+        Avoid constructing a AuthenticationChallenge unnecessarily in the
+        NetworkLoad constructor by using WTF::Optional<> for this data
+        member.
+
+        * NetworkProcess/NetworkLoad.cpp:
+        (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
+        * NetworkProcess/NetworkLoad.h:
+
+2016-06-14  Chris Dumez  <[email protected]>
+
         Add missing WTFMove() in NetworkResourceLoader::didReceiveResponse()
         https://bugs.webkit.org/show_bug.cgi?id=158745
 

Modified: trunk/Source/WebKit2/NetworkProcess/NetworkLoad.cpp (202079 => 202080)


--- trunk/Source/WebKit2/NetworkProcess/NetworkLoad.cpp	2016-06-15 02:07:38 UTC (rev 202079)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkLoad.cpp	2016-06-15 02:18:02 UTC (rev 202080)
@@ -359,15 +359,15 @@
     ASSERT(m_challengeCompletionHandler);
     auto completionHandler = std::exchange(m_challengeCompletionHandler, nullptr);
     if (!result) {
-        if (m_task && m_task->allowsSpecificHTTPSCertificateForHost(m_challenge))
-            completionHandler(AuthenticationChallengeDisposition::UseCredential, serverTrustCredential(m_challenge));
+        if (m_task && m_task->allowsSpecificHTTPSCertificateForHost(*m_challenge))
+            completionHandler(AuthenticationChallengeDisposition::UseCredential, serverTrustCredential(*m_challenge));
         else
             completionHandler(AuthenticationChallengeDisposition::RejectProtectionSpace, { });
         return;
     }
     
-    if (m_challenge.protectionSpace().authenticationScheme() == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested) {
-        completionHandler(AuthenticationChallengeDisposition::UseCredential, serverTrustCredential(m_challenge));
+    if (m_challenge->protectionSpace().authenticationScheme() == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested) {
+        completionHandler(AuthenticationChallengeDisposition::UseCredential, serverTrustCredential(*m_challenge));
         return;
     }
     
@@ -378,9 +378,9 @@
     
     if (m_task) {
         if (auto* pendingDownload = m_task->pendingDownload())
-            NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge(*pendingDownload, m_challenge, completionHandler);
+            NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge(*pendingDownload, *m_challenge, completionHandler);
         else
-            NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge(m_parameters.webPageID, m_parameters.webFrameID, m_challenge, completionHandler);
+            NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge(m_parameters.webPageID, m_parameters.webFrameID, *m_challenge, completionHandler);
     }
 #endif
     if (m_handle)

Modified: trunk/Source/WebKit2/NetworkProcess/NetworkLoad.h (202079 => 202080)


--- trunk/Source/WebKit2/NetworkProcess/NetworkLoad.h	2016-06-15 02:07:38 UTC (rev 202079)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkLoad.h	2016-06-15 02:18:02 UTC (rev 202080)
@@ -30,6 +30,7 @@
 #include "NetworkLoadParameters.h"
 #include "RemoteNetworkingContext.h"
 #include <WebCore/ResourceHandleClient.h>
+#include <wtf/Optional.h>
 
 #if USE(NETWORK_SESSION)
 #include "DownloadID.h"
@@ -123,7 +124,7 @@
     const NetworkLoadParameters m_parameters;
 #if USE(NETWORK_SESSION)
     RefPtr<NetworkDataTask> m_task;
-    WebCore::AuthenticationChallenge m_challenge;
+    Optional<WebCore::AuthenticationChallenge> m_challenge;
     ChallengeCompletionHandler m_challengeCompletionHandler;
     ResponseCompletionHandler m_responseCompletionHandler;
     RedirectCompletionHandler m_redirectCompletionHandler;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to