Title: [261489] trunk/Source/WebKit
Revision
261489
Author
cdu...@apple.com
Date
2020-05-11 12:42:40 -0700 (Mon, 11 May 2020)

Log Message

[iOS] WKWebView.evaluateJavaScript should run at foreground priority when app is foreground
https://bugs.webkit.org/show_bug.cgi?id=211734

Reviewed by Darin Adler.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::runJavaScriptInFrameInScriptWorld):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (261488 => 261489)


--- trunk/Source/WebKit/ChangeLog	2020-05-11 19:37:24 UTC (rev 261488)
+++ trunk/Source/WebKit/ChangeLog	2020-05-11 19:42:40 UTC (rev 261489)
@@ -1,3 +1,13 @@
+2020-05-11  Chris Dumez  <cdu...@apple.com>
+
+        [iOS] WKWebView.evaluateJavaScript should run at foreground priority when app is foreground
+        https://bugs.webkit.org/show_bug.cgi?id=211734
+
+        Reviewed by Darin Adler.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::runJavaScriptInFrameInScriptWorld):
+
 2020-05-11  Wenson Hsieh  <wenson_hs...@apple.com>
 
         REGRESSION (r253267): issues on touchstart/touchend/touchmove (pointerdown/pointerup/pointermove) events

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (261488 => 261489)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2020-05-11 19:37:24 UTC (rev 261488)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2020-05-11 19:42:40 UTC (rev 261489)
@@ -83,6 +83,7 @@
 #include "PluginInformation.h"
 #include "PluginProcessManager.h"
 #include "PrintInfo.h"
+#include "ProcessThrottler.h"
 #include "ProvisionalPageProxy.h"
 #include "SafeBrowsingWarning.h"
 #include "SharedBufferDataReference.h"
@@ -4073,7 +4074,15 @@
         return;
     }
 
-    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivity("WebPageProxy::runJavaScriptInFrameInScriptWorld"_s));
+    ProcessThrottler::ActivityVariant activity;
+#if PLATFORM(IOS_FAMILY)
+    if (pageClient().isApplicationVisible())
+        activity = m_process->throttler().foregroundActivity("WebPageProxy::runJavaScriptInFrameInScriptWorld"_s);
+    else
+#endif
+        activity = m_process->throttler().backgroundActivity("WebPageProxy::runJavaScriptInFrameInScriptWorld"_s);
+
+    auto callbackID = m_callbacks.put(WTFMove(callbackFunction), WTFMove(activity));
     send(Messages::WebPage::RunJavaScriptInFrameInScriptWorld(parameters, frameID, world.worldData(), callbackID));
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to