Mark beacon and ping loads as low priority
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 May 2019 21:28:57 +0000 (21:28 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 May 2019 21:28:57 +0000 (21:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197919
<rdar://problem/50818286>

Reviewed by Alex Christensen.

No JS observable change of behavior.

* Modules/beacon/NavigatorBeacon.cpp:
(WebCore::NavigatorBeacon::sendBeacon):
* loader/PingLoader.cpp:
(WebCore::PingLoader::sendPing):

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

Source/WebCore/ChangeLog
Source/WebCore/Modules/beacon/NavigatorBeacon.cpp
Source/WebCore/loader/PingLoader.cpp

index 44db6ae..44c0aff 100644 (file)
@@ -1,5 +1,20 @@
 2019-05-15  Youenn Fablet  <youenn@apple.com>
 
+        Mark beacon and ping loads as low priority
+        https://bugs.webkit.org/show_bug.cgi?id=197919
+        <rdar://problem/50818286>
+
+        Reviewed by Alex Christensen.
+
+        No JS observable change of behavior.
+
+        * Modules/beacon/NavigatorBeacon.cpp:
+        (WebCore::NavigatorBeacon::sendBeacon):
+        * loader/PingLoader.cpp:
+        (WebCore::PingLoader::sendPing):
+
+2019-05-15  Youenn Fablet  <youenn@apple.com>
+
         getUserMedia sandbox extensions should not be revoked when a getUserMedia allowed request is being processed
         https://bugs.webkit.org/show_bug.cgi?id=197851
 
index 007f721..3592ca7 100644 (file)
@@ -121,6 +121,7 @@ ExceptionOr<bool> NavigatorBeacon::sendBeacon(Document& document, const String&
 
     ResourceRequest request(parsedUrl);
     request.setHTTPMethod("POST"_s);
+    request.setPriority(ResourceLoadPriority::VeryLow);
 
     ResourceLoaderOptions options;
     options.credentials = FetchOptions::Credentials::Include;
index 050e2ad..65d8bee 100644 (file)
@@ -130,6 +130,7 @@ void PingLoader::sendPing(Frame& frame, const URL& pingURL, const URL& destinati
     request.setHTTPContentType("text/ping");
     request.setHTTPBody(FormData::create("PING"));
     request.setHTTPHeaderField(HTTPHeaderName::CacheControl, "max-age=0");
+    request.setPriority(ResourceLoadPriority::VeryLow);
 
     HTTPHeaderMap originalRequestHeader = request.httpHeaderFields();