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

Unified Diff: blimp/client/support/compositor/blimp_context_provider.cc

Issue 2286873003: Provide TaskRunner to ContextCacheController (Closed)
Patch Set: cleanup Created 4 years, 4 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/aw_render_thread_context_provider.cc ('k') | cc/output/context_cache_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/support/compositor/blimp_context_provider.cc
diff --git a/blimp/client/support/compositor/blimp_context_provider.cc b/blimp/client/support/compositor/blimp_context_provider.cc
index 83874cbc18c56255429ecfc2a072bfc2dc5ebfff..e1cc1cf36df860583e0433014a24117207263b18 100644
--- a/blimp/client/support/compositor/blimp_context_provider.cc
+++ b/blimp/client/support/compositor/blimp_context_provider.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/lazy_instance.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "cc/output/context_cache_controller.h"
#include "gpu/command_buffer/client/gl_in_process_context.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
@@ -42,16 +43,16 @@ BlimpContextProvider::BlimpContextProvider(
attribs_for_gles2.context_type = gpu::gles2::CONTEXT_TYPE_OPENGLES2;
attribs_for_gles2.lose_context_when_out_of_memory = true;
+ auto task_runner = base::ThreadTaskRunnerHandle::Get();
Wez 2016/09/06 23:29:02 It's non-obvious what the type of |task_runner| wi
ericrk 2016/09/13 17:04:26 I guess factoring this out wasn't getting us a hug
context_.reset(gpu::GLInProcessContext::Create(
nullptr /* service */, nullptr /* surface */,
widget == gfx::kNullAcceleratedWidget /* is_offscreen */, widget,
nullptr /* share_context */, attribs_for_gles2, gpu::SharedMemoryLimits(),
- gpu_memory_buffer_manager, nullptr /* memory_limits */));
+ gpu_memory_buffer_manager, nullptr /* memory_limits */, task_runner));
context_->GetImplementation()->SetLostContextCallback(
base::Bind(&BlimpContextProvider::OnLostContext, base::Unretained(this)));
-
- cache_controller_.reset(
- new cc::ContextCacheController(context_->GetImplementation()));
+ cache_controller_.reset(new cc::ContextCacheController(
+ context_->GetImplementation(), std::move(task_runner)));
Wez 2016/09/06 23:29:02 It looks strange to have one object passed |task_r
danakj 2016/09/06 23:42:38 I have to disagree here, that's entirely the point
ericrk 2016/09/13 17:04:26 I tend to agree w/ Dana, although I do see that th
}
BlimpContextProvider::~BlimpContextProvider() {
« no previous file with comments | « android_webview/browser/aw_render_thread_context_provider.cc ('k') | cc/output/context_cache_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698