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

Unified Diff: services/ui/public/cpp/gpu_service.h

Issue 2249413004: services/ui: Allow injecting the IO thread task runner for gpu channel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « content/renderer/render_thread_impl.cc ('k') | services/ui/public/cpp/gpu_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/public/cpp/gpu_service.h
diff --git a/services/ui/public/cpp/gpu_service.h b/services/ui/public/cpp/gpu_service.h
index a1155ae0bdc3745714270da2455db5d2c75720fc..f7af2a56e221545481eeccceb2dca6e30936faf8 100644
--- a/services/ui/public/cpp/gpu_service.h
+++ b/services/ui/public/cpp/gpu_service.h
@@ -35,9 +35,14 @@ class GpuService : public gpu::GpuChannelHostFactory,
}
// The GpuService has to be initialized in the main thread before establishing
- // the gpu channel.
+ // the gpu channel. The IO thread task-runner needed for the gpu channel can
+ // be set using SetIOTaskRunner(). If no task-runner is set, then a new thread
+ // is created for IO instead.
static std::unique_ptr<GpuService> Initialize(shell::Connector* connector);
+ void SetIOThreadTaskRunner(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner);
Fady Samuel 2016/08/18 11:00:56 Can this not be passed in Initialize to avoid givi
sadrul 2016/08/18 12:56:53 It's not straight forward, because for the chrome
Fady Samuel 2016/08/18 13:05:39 LGTM but I still feel like this is brittle because
+
// gpu::GpuChannelEstablishFactory:
void EstablishGpuChannel(
const gpu::GpuChannelEstablishedCallback& callback) override;
@@ -65,9 +70,10 @@ class GpuService : public gpu::GpuChannelHostFactory,
size_t size) override;
scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
shell::Connector* connector_;
base::WaitableEvent shutdown_event_;
- base::Thread io_thread_;
+ std::unique_ptr<base::Thread> io_thread_;
std::unique_ptr<MojoGpuMemoryBufferManager> gpu_memory_buffer_manager_;
// Lock for |gpu_channel_|, |establish_callbacks_| & |is_establishing_|.
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | services/ui/public/cpp/gpu_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698