| OLD | NEW |
| (Empty) |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ANDROID_WEBVIEW_NATIVE_AW_RENDERER_PRIORITY_USER_DATA_H_ | |
| 6 #define ANDROID_WEBVIEW_NATIVE_AW_RENDERER_PRIORITY_USER_DATA_H_ | |
| 7 | |
| 8 #include "base/supports_user_data.h" | |
| 9 | |
| 10 namespace content { | |
| 11 class RenderProcessHost; | |
| 12 } | |
| 13 | |
| 14 namespace android_webview { | |
| 15 | |
| 16 class AwRendererPriorityManager : public base::SupportsUserData::Data { | |
| 17 public: | |
| 18 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.android_webview.renderer_priority | |
| 19 enum RendererPriority { | |
| 20 RENDERER_PRIORITY_INITIAL = -1, | |
| 21 RENDERER_PRIORITY_WAIVED = 0, | |
| 22 RENDERER_PRIORITY_LOW = 1, | |
| 23 RENDERER_PRIORITY_HIGH = 2 | |
| 24 }; | |
| 25 | |
| 26 explicit AwRendererPriorityManager(content::RenderProcessHost* host); | |
| 27 | |
| 28 RendererPriority GetRendererPriority() const { return renderer_priority_; } | |
| 29 void SetRendererPriority(RendererPriority renderer_priority); | |
| 30 | |
| 31 private: | |
| 32 static void SetRendererPriorityOnLauncherThread( | |
| 33 int pid, | |
| 34 RendererPriority renderer_priority); | |
| 35 | |
| 36 content::RenderProcessHost* host_; | |
| 37 RendererPriority renderer_priority_; | |
| 38 }; | |
| 39 | |
| 40 } // namespace android_webview | |
| 41 | |
| 42 #endif // ANDROID_WEBVIEW_NATIVE_AW_RENDERER_PRIORITY_USER_DATA_H_ | |
| OLD | NEW |