Avoid unnecessary ResourceRequest copy under NetworkResourceLoader::isCrossOriginPref...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Aug 2019 00:06:59 +0000 (00:06 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Aug 2019 00:06:59 +0000 (00:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200478

Reviewed by Youenn Fablet.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::isCrossOriginPrefetch const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248329 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp

index dfe2090..bed5d0c 100644 (file)
@@ -1,3 +1,13 @@
+2019-08-06  Chris Dumez  <cdumez@apple.com>
+
+        Avoid unnecessary ResourceRequest copy under NetworkResourceLoader::isCrossOriginPrefetch()
+        https://bugs.webkit.org/show_bug.cgi?id=200478
+
+        Reviewed by Youenn Fablet.
+
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::NetworkResourceLoader::isCrossOriginPrefetch const):
+
 2019-08-06  Jiewen Tan  <jiewen_tan@apple.com>
 
         Unreviewed, a build fix after r248319
index 2ea75d6..3dbf47a 100644 (file)
@@ -1177,7 +1177,7 @@ void NetworkResourceLoader::logSlowCacheRetrieveIfNeeded(const NetworkCache::Cac
 
 bool NetworkResourceLoader::isCrossOriginPrefetch() const
 {
-    auto request = originalRequest();
+    auto& request = originalRequest();
     return request.httpHeaderField(HTTPHeaderName::Purpose) == "prefetch" && !m_parameters.sourceOrigin->canRequest(request.url());
 }