Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3013)

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwRendererPriorityManager.java

Issue 2650753002: Implement renderer importance API for WebView (Closed)
Patch Set: clean up unused local Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: android_webview/java/src/org/chromium/android_webview/AwRendererPriorityManager.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwRendererPriorityManager.java b/android_webview/java/src/org/chromium/android_webview/AwRendererPriorityManager.java
new file mode 100644
index 0000000000000000000000000000000000000000..96db506ceb8416deaed6dfada735225a3c158a95
--- /dev/null
+++ b/android_webview/java/src/org/chromium/android_webview/AwRendererPriorityManager.java
@@ -0,0 +1,24 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.android_webview;
+
+import org.chromium.android_webview.renderer_priority.RendererPriority;
+import org.chromium.base.annotations.CalledByNative;
+import org.chromium.base.annotations.JNINamespace;
+import org.chromium.content.browser.ChildProcessLauncher;
+
+/**
+ * Exposes an interface via which native code can manage the priority
+ * of a renderer process.
+ */
+@JNINamespace("android_webview")
+public class AwRendererPriorityManager {
+ @CalledByNative
+ private static void setRendererPriority(
+ int pid, @RendererPriority.RendererPriorityEnum int rendererPriority) {
+ // TODO(tobiasjs): handle RendererPriority.LOW separately from WAIVED.
+ ChildProcessLauncher.setInForeground(pid, rendererPriority == RendererPriority.HIGH);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698