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

Unified Diff: android_webview/native/aw_renderer_priority_manager.h

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
« no previous file with comments | « android_webview/native/aw_contents.cc ('k') | android_webview/native/aw_renderer_priority_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_renderer_priority_manager.h
diff --git a/android_webview/native/aw_renderer_priority_manager.h b/android_webview/native/aw_renderer_priority_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..dec22415fe1252eef9246a882c1fe9df2eeac1c7
--- /dev/null
+++ b/android_webview/native/aw_renderer_priority_manager.h
@@ -0,0 +1,42 @@
+// 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.
+
+#ifndef ANDROID_WEBVIEW_NATIVE_AW_RENDERER_PRIORITY_USER_DATA_H_
+#define ANDROID_WEBVIEW_NATIVE_AW_RENDERER_PRIORITY_USER_DATA_H_
+
+#include "base/supports_user_data.h"
+
+namespace content {
+class RenderProcessHost;
+}
+
+namespace android_webview {
+
+class AwRendererPriorityManager : public base::SupportsUserData::Data {
+ public:
+ // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.android_webview.renderer_priority
+ enum RendererPriority {
+ RENDERER_PRIORITY_INITIAL = -1,
+ RENDERER_PRIORITY_WAIVED = 0,
+ RENDERER_PRIORITY_LOW = 1,
+ RENDERER_PRIORITY_HIGH = 2
+ };
+
+ explicit AwRendererPriorityManager(content::RenderProcessHost* host);
+
+ RendererPriority GetRendererPriority() const { return renderer_priority_; }
+ void SetRendererPriority(RendererPriority renderer_priority);
+
+ private:
+ static void SetRendererPriorityOnLauncherThread(
+ int pid,
+ RendererPriority renderer_priority);
+
+ content::RenderProcessHost* host_;
+ RendererPriority renderer_priority_;
+};
+
+} // namespace android_webview
+
+#endif // ANDROID_WEBVIEW_NATIVE_AW_RENDERER_PRIORITY_USER_DATA_H_
« no previous file with comments | « android_webview/native/aw_contents.cc ('k') | android_webview/native/aw_renderer_priority_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698