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

Side by Side Diff: gpu/ipc/client/gpu_channel_host.h

Issue 2197613003: gpu: Introduce GpuChannelEstablishFactory. (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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GPU_IPC_CLIENT_GPU_CHANNEL_HOST_H_ 5 #ifndef GPU_IPC_CLIENT_GPU_CHANNEL_HOST_H_
6 #define GPU_IPC_CLIENT_GPU_CHANNEL_HOST_H_ 6 #define GPU_IPC_CLIENT_GPU_CHANNEL_HOST_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 25 matching lines...) Expand all
36 namespace IPC { 36 namespace IPC {
37 class SyncMessageFilter; 37 class SyncMessageFilter;
38 } 38 }
39 39
40 namespace gpu { 40 namespace gpu {
41 class GpuMemoryBufferManager; 41 class GpuMemoryBufferManager;
42 } 42 }
43 43
44 namespace gpu { 44 namespace gpu {
45 45
46 class GpuChannelHost;
47 using GpuChannelEstablishedCallback =
48 base::Callback<void(scoped_refptr<GpuChannelHost>)>;
49
50 class GPU_EXPORT GpuChannelEstablishFactory {
51 public:
52 virtual ~GpuChannelEstablishFactory() {}
53
54 virtual void EstablishGpuChannel(
55 const GpuChannelEstablishedCallback& callback) = 0;
56 virtual scoped_refptr<GpuChannelHost> EstablishGpuChannelSync() = 0;
57
58 static void SetInstance(GpuChannelEstablishFactory* instance);
59 static GpuChannelEstablishFactory* GetInstance();
60 };
61
46 class GPU_EXPORT GpuChannelHostFactory { 62 class GPU_EXPORT GpuChannelHostFactory {
47 public: 63 public:
48 virtual ~GpuChannelHostFactory() {} 64 virtual ~GpuChannelHostFactory() {}
49 65
50 virtual bool IsMainThread() = 0; 66 virtual bool IsMainThread() = 0;
51 virtual scoped_refptr<base::SingleThreadTaskRunner> 67 virtual scoped_refptr<base::SingleThreadTaskRunner>
52 GetIOThreadTaskRunner() = 0; 68 GetIOThreadTaskRunner() = 0;
53 virtual std::unique_ptr<base::SharedMemory> AllocateSharedMemory( 69 virtual std::unique_ptr<base::SharedMemory> AllocateSharedMemory(
54 size_t size) = 0; 70 size_t size) = 0;
55 }; 71 };
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 mutable base::Lock context_lock_; 283 mutable base::Lock context_lock_;
268 std::unique_ptr<IPC::SyncChannel> channel_; 284 std::unique_ptr<IPC::SyncChannel> channel_;
269 base::hash_map<int32_t, StreamFlushInfo> stream_flush_info_; 285 base::hash_map<int32_t, StreamFlushInfo> stream_flush_info_;
270 286
271 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); 287 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost);
272 }; 288 };
273 289
274 } // namespace gpu 290 } // namespace gpu
275 291
276 #endif // GPU_IPC_CLIENT_GPU_CHANNEL_HOST_H_ 292 #endif // GPU_IPC_CLIENT_GPU_CHANNEL_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698