Chromium Code Reviews| Index: android_webview/browser/test/fake_window.cc |
| diff --git a/android_webview/browser/test/fake_window.cc b/android_webview/browser/test/fake_window.cc |
| index 16d9405727615890512f5d2decdd7e4b5db7c2a0..12914474a7f1722642d9a151f7ac8ba5809e039c 100644 |
| --- a/android_webview/browser/test/fake_window.cc |
| +++ b/android_webview/browser/test/fake_window.cc |
| @@ -5,6 +5,8 @@ |
| #include "android_webview/browser/test/fake_window.h" |
| #include "android_webview/browser/browser_view_renderer.h" |
| +#include "android_webview/browser/child_frame.h" |
| +#include "android_webview/browser/shared_renderer_state.h" |
| #include "base/location.h" |
| #include "base/synchronization/waitable_event.h" |
| #include "base/thread_task_runner_handle.h" |
| @@ -39,6 +41,7 @@ class FakeWindow::ScopedMakeCurrent { |
| }; |
| FakeWindow::FakeWindow(BrowserViewRenderer* view, |
| + SharedRendererState* functor, |
| WindowHooks* hooks, |
| gfx::Rect location) |
| : view_(view), |
| @@ -46,7 +49,7 @@ FakeWindow::FakeWindow(BrowserViewRenderer* view, |
| surface_size_(100, 100), |
| location_(location), |
| on_draw_hardware_pending_(false), |
| - functor_(nullptr), |
| + functor_(functor), |
| context_current_(false), |
| weak_ptr_factory_(this) { |
| CheckCurrentlyOnUIThread(); |
| @@ -62,6 +65,7 @@ FakeWindow::~FakeWindow() { |
| void FakeWindow::Detach() { |
| CheckCurrentlyOnUIThread(); |
| + functor_->DeleteHardwareRendererOnUI(); |
|
boliu
2016/03/30 16:12:13
this is wrong order compared to aw_contents
Tobias Sargeant
2016/03/30 17:17:17
It isn't possible to match the old AwContents orde
|
| view_->OnDetachedFromWindow(); |
| if (render_thread_loop_) { |
| @@ -173,12 +177,10 @@ void FakeWindow::CheckCurrentlyOnUIThread() { |
| void FakeWindow::CreateRenderThreadIfNeeded() { |
| CheckCurrentlyOnUIThread(); |
| - if (functor_) { |
| - DCHECK(render_thread_.get()); |
| + if (render_thread_.get()) { |
|
boliu
2016/03/30 16:12:13
.get() not needed, can remove them from DCHECKs to
Tobias Sargeant
2016/03/30 17:17:17
Done.
|
| DCHECK(render_thread_loop_.get()); |
| return; |
| } |
| - functor_ = view_->GetAwDrawGLViewContext(); |
| render_thread_.reset(new base::Thread("TestRenderThread")); |
| render_thread_->Start(); |
| render_thread_loop_ = render_thread_->task_runner(); |