| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "android_webview/browser/shared_renderer_state.h" | 5 #include "android_webview/browser/shared_renderer_state.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/browser_view_renderer_client.h" | 7 #include "android_webview/browser/browser_view_renderer_client.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 void SharedRendererState::ClientRequestDrawGLOnUIThread() { | 41 void SharedRendererState::ClientRequestDrawGLOnUIThread() { |
| 42 DCHECK(ui_loop_->BelongsToCurrentThread()); | 42 DCHECK(ui_loop_->BelongsToCurrentThread()); |
| 43 if (!client_on_ui_->RequestDrawGL(NULL)) { | 43 if (!client_on_ui_->RequestDrawGL(NULL)) { |
| 44 LOG(ERROR) << "Failed to request GL process. Deadlock likely"; | 44 LOG(ERROR) << "Failed to request GL process. Deadlock likely"; |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 void SharedRendererState::SetCompositorOnUiThread( | 48 void SharedRendererState::SetCompositorOnUiThread( |
| 49 content::SynchronousCompositor* compositor) { | 49 content::SynchronousCompositor* compositor) { |
| 50 base::AutoLock lock(lock_); |
| 50 DCHECK(ui_loop_->BelongsToCurrentThread()); | 51 DCHECK(ui_loop_->BelongsToCurrentThread()); |
| 51 compositor_ = compositor; | 52 compositor_ = compositor; |
| 52 } | 53 } |
| 53 | 54 |
| 54 content::SynchronousCompositor* SharedRendererState::GetCompositor() { | 55 content::SynchronousCompositor* SharedRendererState::GetCompositor() { |
| 56 base::AutoLock lock(lock_); |
| 55 DCHECK(compositor_); | 57 DCHECK(compositor_); |
| 56 return compositor_; | 58 return compositor_; |
| 57 } | 59 } |
| 58 | 60 |
| 59 void SharedRendererState::SetDrawGLInput(const DrawGLInput& input) { | 61 void SharedRendererState::SetDrawGLInput(const DrawGLInput& input) { |
| 62 base::AutoLock lock(lock_); |
| 60 draw_gl_input_ = input; | 63 draw_gl_input_ = input; |
| 61 } | 64 } |
| 62 | 65 |
| 63 DrawGLInput SharedRendererState::GetDrawGLInput() const { | 66 DrawGLInput SharedRendererState::GetDrawGLInput() const { |
| 67 base::AutoLock lock(lock_); |
| 64 return draw_gl_input_; | 68 return draw_gl_input_; |
| 65 } | 69 } |
| 66 | 70 |
| 67 } // namespace android_webview | 71 } // namespace android_webview |
| OLD | NEW |