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

Unified Diff: gpu/ipc/client/gpu_channel_host.cc

Issue 2197613003: gpu: Introduce GpuChannelEstablishFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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/ipc/client/gpu_channel_host.h ('k') | services/ui/common/gpu_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/client/gpu_channel_host.cc
diff --git a/gpu/ipc/client/gpu_channel_host.cc b/gpu/ipc/client/gpu_channel_host.cc
index beeaa15bfd167cb62ac35d4eeb961cd92a688723..cc479d9e70dbc924f51f35b8c34364b6814607ff 100644
--- a/gpu/ipc/client/gpu_channel_host.cc
+++ b/gpu/ipc/client/gpu_channel_host.cc
@@ -27,8 +27,21 @@ namespace {
// Global atomic to generate unique transfer buffer IDs.
base::StaticAtomicSequenceNumber g_next_transfer_buffer_id;
+GpuChannelEstablishFactory* g_creator_factory = nullptr;
piman 2016/08/02 03:14:45 I would like to avoid globals in GPU code. This br
+
} // namespace
+void GpuChannelEstablishFactory::SetInstance(
+ GpuChannelEstablishFactory* factory) {
+ DCHECK(!g_creator_factory || !factory)
+ << "You cannot set a new factory while an old factory is still alive.";
+ g_creator_factory = factory;
+}
+
+GpuChannelEstablishFactory* GpuChannelEstablishFactory::GetInstance() {
+ return g_creator_factory;
+}
+
GpuChannelHost::StreamFlushInfo::StreamFlushInfo()
: next_stream_flush_id(1),
flushed_stream_flush_id(0),
« no previous file with comments | « gpu/ipc/client/gpu_channel_host.h ('k') | services/ui/common/gpu_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698