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

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

Issue 2275113002: Provide task runner to GLES2Impl / CommandBuffer at creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-cleanup4
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
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 9a8b5062957638986926118030b300f1cd04f8ef..969bb86420862cee668d6b12661d3f9bd56df66d 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.cc
+++ b/gpu/command_buffer/service/in_process_command_buffer.cc
@@ -254,16 +254,21 @@ 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();
+ origin_task_runner_ = std::move(task_runner);
client_thread_weak_ptr_ = client_thread_weak_ptr_factory_.GetWeakPtr();
}

Powered by Google App Engine
This is Rietveld 408576698