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

Unified Diff: android_webview/browser/shared_renderer_state.cc

Issue 288983007: aw: Fix hardware init/tear down in pop up flow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more fix Created 6 years, 7 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/browser/shared_renderer_state.cc
diff --git a/android_webview/browser/shared_renderer_state.cc b/android_webview/browser/shared_renderer_state.cc
index 3483d630e7cb1eafbc02f812d0998902487aae1c..193eca045ddcc0eb53f1e0b2f3f370c0c27263e6 100644
--- a/android_webview/browser/shared_renderer_state.cc
+++ b/android_webview/browser/shared_renderer_state.cc
@@ -23,6 +23,7 @@ SharedRendererState::SharedRendererState(
ui_thread_weak_ptr_(weak_factory_on_ui_thread_.GetWeakPtr()),
compositor_(NULL),
memory_policy_dirty_(false),
+ hardware_allowed_(false),
hardware_initialized_(false) {
DCHECK(ui_loop_->BelongsToCurrentThread());
DCHECK(client_on_ui_);
@@ -86,27 +87,14 @@ DrawGLInput SharedRendererState::GetDrawGLInput() const {
return draw_gl_input_;
}
-void SharedRendererState::ClearClosureQueue() {
+void SharedRendererState::SetHardwareAllowed(bool allowed) {
base::AutoLock lock(lock_);
- std::queue<base::Closure> empty;
- std::swap(closure_queue_, empty);
+ hardware_allowed_ = allowed;
}
-void SharedRendererState::AppendClosure(const base::Closure& closure) {
+bool SharedRendererState::IsHardwareAllowed() const {
base::AutoLock lock(lock_);
- closure_queue_.push(closure);
-}
-
-base::Closure SharedRendererState::PopFrontClosure() {
- base::Closure closure;
-
- base::AutoLock lock(lock_);
- if (!closure_queue_.empty()) {
- closure = closure_queue_.front();
- closure_queue_.pop();
- }
-
- return closure;
+ return hardware_allowed_;
}
void SharedRendererState::SetHardwareInitialized(bool initialized) {
« no previous file with comments | « android_webview/browser/shared_renderer_state.h ('k') | android_webview/java/src/org/chromium/android_webview/AwContents.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698