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

Unified Diff: gpu/command_buffer/service/in_process_command_buffer.cc

Issue 2286873003: Provide TaskRunner to ContextCacheController (Closed)
Patch Set: feedback Created 4 years, 3 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 | « gpu/command_buffer/service/in_process_command_buffer.h ('k') | gpu/ipc/client/command_buffer_proxy_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/in_process_command_buffer.cc
diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc
index a237f87505c852f898ab214dcb4b61d3dda1b080..71a65d7305f8b5c29aff4d67912f89b60e762b24 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.cc
+++ b/gpu/command_buffer/service/in_process_command_buffer.cc
@@ -256,16 +256,22 @@ bool InProcessCommandBuffer::Initialize(
const gles2::ContextCreationAttribHelper& attribs,
InProcessCommandBuffer* share_group,
GpuMemoryBufferManager* gpu_memory_buffer_manager,
- ImageFactory* image_factory) {
+ ImageFactory* image_factory,
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
DCHECK(!share_group || service_.get() == share_group->service_.get());
if (surface) {
+ // If a surface is provided, we are running in a webview and should not have
+ // a task runner.
+ DCHECK(!task_runner);
+
// GPU thread must be the same as client thread due to GLSurface not being
// thread safe.
sequence_checker_.reset(new base::SequenceChecker);
surface_ = surface;
} else {
- origin_task_runner_ = base::ThreadTaskRunnerHandle::Get();
+ DCHECK(task_runner);
+ origin_task_runner_ = std::move(task_runner);
client_thread_weak_ptr_ = client_thread_weak_ptr_factory_.GetWeakPtr();
}
« no previous file with comments | « gpu/command_buffer/service/in_process_command_buffer.h ('k') | gpu/ipc/client/command_buffer_proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698