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

Unified Diff: android_webview/browser/test/fake_window.cc

Issue 1920843002: Test: deleting RTM before BVR does not leak resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix clang compile error Created 4 years, 8 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
« no previous file with comments | « android_webview/browser/test/fake_window.h ('k') | android_webview/browser/test/rendering_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 85027a709e35ae35ddfcbf0eeeba1574b4cf18f0..a13be3376b1fe87673cca7bcb4fdac93a4cee3a9 100644
--- a/android_webview/browser/test/fake_window.cc
+++ b/android_webview/browser/test/fake_window.cc
@@ -41,7 +41,7 @@ class FakeWindow::ScopedMakeCurrent {
};
FakeWindow::FakeWindow(BrowserViewRenderer* view,
- RenderThreadManager* functor,
+ const DrawGLCallback& draw_gl,
WindowHooks* hooks,
gfx::Rect location)
: view_(view),
@@ -49,7 +49,7 @@ FakeWindow::FakeWindow(BrowserViewRenderer* view,
surface_size_(100, 100),
location_(location),
on_draw_hardware_pending_(false),
- functor_(functor),
+ draw_gl_(draw_gl),
context_current_(false),
weak_ptr_factory_(this) {
CheckCurrentlyOnUIThread();
@@ -61,13 +61,6 @@ FakeWindow::FakeWindow(BrowserViewRenderer* view,
FakeWindow::~FakeWindow() {
CheckCurrentlyOnUIThread();
-}
-
-void FakeWindow::Detach() {
- CheckCurrentlyOnUIThread();
- functor_->DeleteHardwareRendererOnUI();
- view_->OnDetachedFromWindow();
-
if (render_thread_loop_) {
base::WaitableEvent completion(true, false);
render_thread_loop_->PostTask(
@@ -79,6 +72,11 @@ void FakeWindow::Detach() {
render_thread_.reset();
}
+void FakeWindow::Detach() {
+ CheckCurrentlyOnUIThread();
+ view_->OnDetachedFromWindow();
+}
+
void FakeWindow::RequestInvokeGL(bool wait_for_completion) {
CheckCurrentlyOnUIThread();
base::WaitableEvent completion(true, false);
@@ -96,12 +94,12 @@ void FakeWindow::ProcessFunctorOnRT(base::WaitableEvent* sync) {
process_info.version = kAwDrawGLInfoVersion;
process_info.mode = AwDrawGLInfo::kModeProcess;
- hooks_->WillProcessOnRT(functor_);
+ hooks_->WillProcessOnRT();
{
ScopedMakeCurrent make_current(this);
- functor_->DrawGL(&process_info);
+ draw_gl_.Run(&process_info);
}
- hooks_->DidProcessOnRT(functor_);
+ hooks_->DidProcessOnRT();
if (sync)
sync->Signal();
@@ -146,9 +144,9 @@ void FakeWindow::DrawFunctorOnRT(base::WaitableEvent* sync) {
process_info.version = kAwDrawGLInfoVersion;
process_info.mode = AwDrawGLInfo::kModeSync;
- hooks_->WillSyncOnRT(functor_);
- functor_->DrawGL(&process_info);
- hooks_->DidSyncOnRT(functor_);
+ hooks_->WillSyncOnRT();
+ draw_gl_.Run(&process_info);
+ hooks_->DidSyncOnRT();
}
sync->Signal();
@@ -160,14 +158,14 @@ void FakeWindow::DrawFunctorOnRT(base::WaitableEvent* sync) {
draw_info.clip_right = location.x() + location.width();
draw_info.clip_bottom = location.y() + location.height();
- if (!hooks_->WillDrawOnRT(functor_, &draw_info))
+ if (!hooks_->WillDrawOnRT(&draw_info))
return;
{
ScopedMakeCurrent make_current(this);
- functor_->DrawGL(&draw_info);
+ draw_gl_.Run(&draw_info);
}
- hooks_->DidDrawOnRT(functor_);
+ hooks_->DidDrawOnRT();
}
void FakeWindow::CheckCurrentlyOnUIThread() {
« no previous file with comments | « android_webview/browser/test/fake_window.h ('k') | android_webview/browser/test/rendering_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698