summaryrefslogtreecommitdiffstats
path: root/android_webview/browser/shared_renderer_state.cc
diff options
context:
space:
mode:
authorboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-23 11:55:47 +0000
committerboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-23 11:55:47 +0000
commitd6417554055d96c69580ff60a9d83c1cfc99c1b4 (patch)
treef4dcdfb72efb3e21727a9932b6596ad779637056 /android_webview/browser/shared_renderer_state.cc
parent8dd612a1cc006c197a3316e8eba0c49fd1ac5562 (diff)
downloadchromium_src-d6417554055d96c69580ff60a9d83c1cfc99c1b4.zip
chromium_src-d6417554055d96c69580ff60a9d83c1cfc99c1b4.tar.gz
chromium_src-d6417554055d96c69580ff60a9d83c1cfc99c1b4.tar.bz2
aw: Fix hardware init/tear down in pop up flow
Previously we did not call onDetached on old native AwContents, which now no longer cleans up hardware resources correctly. This also had the side effect that the following onAttach with the new native AwContents is ignored in java code due to attach/detach mismatch. As make onDetached more strict with respect to ordering. And lock to protect variable accessed on multiple threads. Also need to ensure we never requestDrawGL on the blank native AwContents that's destroyed during pop up. BUG=376622 Review URL: https://codereview.chromium.org/288983007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272500 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/browser/shared_renderer_state.cc')
-rw-r--r--android_webview/browser/shared_renderer_state.cc22
1 files changed, 5 insertions, 17 deletions
diff --git a/android_webview/browser/shared_renderer_state.cc b/android_webview/browser/shared_renderer_state.cc
index 3483d63..193eca0 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) {