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

Side by Side Diff: content/common/gpu/gpu_channel_manager.h

Issue 1231263003: Share SyncPointManager between ipc and in-process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove forward decl/includes Created 5 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 unified diff | Download patch
« no previous file with comments | « content/common/gpu/gpu_channel.cc ('k') | content/common/gpu/gpu_channel_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ 5 #ifndef CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_
6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ 6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 class CONTENT_EXPORT GpuChannelManager : public IPC::Listener, 61 class CONTENT_EXPORT GpuChannelManager : public IPC::Listener,
62 public IPC::Sender { 62 public IPC::Sender {
63 public: 63 public:
64 // |broker| must outlive GpuChannelManager and any channels it creates. 64 // |broker| must outlive GpuChannelManager and any channels it creates.
65 GpuChannelManager(MessageRouter* router, 65 GpuChannelManager(MessageRouter* router,
66 GpuWatchdog* watchdog, 66 GpuWatchdog* watchdog,
67 base::SingleThreadTaskRunner* io_task_runner, 67 base::SingleThreadTaskRunner* io_task_runner,
68 base::WaitableEvent* shutdown_event, 68 base::WaitableEvent* shutdown_event,
69 IPC::SyncChannel* channel, 69 IPC::SyncChannel* channel,
70 IPC::AttachmentBroker* broker, 70 IPC::AttachmentBroker* broker,
71 gpu::SyncPointManager* sync_point_manager,
71 GpuMemoryBufferFactory* gpu_memory_buffer_factory); 72 GpuMemoryBufferFactory* gpu_memory_buffer_factory);
72 ~GpuChannelManager() override; 73 ~GpuChannelManager() override;
73 74
74 // Remove the channel for a particular renderer. 75 // Remove the channel for a particular renderer.
75 void RemoveChannel(int client_id); 76 void RemoveChannel(int client_id);
76 77
77 // Listener overrides. 78 // Listener overrides.
78 bool OnMessageReceived(const IPC::Message& msg) override; 79 bool OnMessageReceived(const IPC::Message& msg) override;
79 80
80 // Sender overrides. 81 // Sender overrides.
81 bool Send(IPC::Message* msg) override; 82 bool Send(IPC::Message* msg) override;
82 83
83 bool HandleMessagesScheduled(); 84 bool HandleMessagesScheduled();
84 uint64 MessagesProcessed(); 85 uint64 MessagesProcessed();
85 86
86 void LoseAllContexts(); 87 void LoseAllContexts();
87 88
88 int GenerateRouteID(); 89 int GenerateRouteID();
89 void AddRoute(int32 routing_id, IPC::Listener* listener); 90 void AddRoute(int32 routing_id, IPC::Listener* listener);
90 void RemoveRoute(int32 routing_id); 91 void RemoveRoute(int32 routing_id);
91 92
92 gpu::gles2::ProgramCache* program_cache(); 93 gpu::gles2::ProgramCache* program_cache();
93 gpu::gles2::ShaderTranslatorCache* shader_translator_cache(); 94 gpu::gles2::ShaderTranslatorCache* shader_translator_cache();
94 95
95 GpuMemoryManager* gpu_memory_manager() { return &gpu_memory_manager_; } 96 GpuMemoryManager* gpu_memory_manager() { return &gpu_memory_manager_; }
96 97
97 GpuChannel* LookupChannel(int32 client_id); 98 GpuChannel* LookupChannel(int32 client_id);
98 99
99 gpu::SyncPointManager* sync_point_manager() { 100 gpu::SyncPointManager* sync_point_manager() {
100 return sync_point_manager_.get(); 101 return sync_point_manager_;
101 } 102 }
102 103
103 gfx::GLSurface* GetDefaultOffscreenSurface(); 104 gfx::GLSurface* GetDefaultOffscreenSurface();
104 105
105 GpuMemoryBufferFactory* gpu_memory_buffer_factory() { 106 GpuMemoryBufferFactory* gpu_memory_buffer_factory() {
106 return gpu_memory_buffer_factory_; 107 return gpu_memory_buffer_factory_;
107 } 108 }
108 109
109 private: 110 private:
110 typedef base::ScopedPtrHashMap<int, scoped_ptr<GpuChannel>> GpuChannelMap; 111 typedef base::ScopedPtrHashMap<int, scoped_ptr<GpuChannel>> GpuChannelMap;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 MessageRouter* const router_; 147 MessageRouter* const router_;
147 148
148 // These objects manage channels to individual renderer processes there is 149 // These objects manage channels to individual renderer processes there is
149 // one channel for each renderer process that has connected to this GPU 150 // one channel for each renderer process that has connected to this GPU
150 // process. 151 // process.
151 GpuChannelMap gpu_channels_; 152 GpuChannelMap gpu_channels_;
152 scoped_refptr<gfx::GLShareGroup> share_group_; 153 scoped_refptr<gfx::GLShareGroup> share_group_;
153 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; 154 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_;
154 GpuMemoryManager gpu_memory_manager_; 155 GpuMemoryManager gpu_memory_manager_;
155 GpuWatchdog* watchdog_; 156 GpuWatchdog* watchdog_;
156 scoped_refptr<gpu::SyncPointManager> sync_point_manager_; 157 // SyncPointManager guaranteed to outlive running MessageLoop.
158 gpu::SyncPointManager* sync_point_manager_;
157 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; 159 scoped_ptr<gpu::gles2::ProgramCache> program_cache_;
158 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; 160 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_;
159 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; 161 scoped_refptr<gfx::GLSurface> default_offscreen_surface_;
160 GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; 162 GpuMemoryBufferFactory* const gpu_memory_buffer_factory_;
161 IPC::SyncChannel* channel_; 163 IPC::SyncChannel* channel_;
162 bool relinquish_resources_pending_; 164 bool relinquish_resources_pending_;
163 // Must outlive this instance of GpuChannelManager. 165 // Must outlive this instance of GpuChannelManager.
164 IPC::AttachmentBroker* attachment_broker_; 166 IPC::AttachmentBroker* attachment_broker_;
165 167
166 // Member variables should appear before the WeakPtrFactory, to ensure 168 // Member variables should appear before the WeakPtrFactory, to ensure
167 // that any WeakPtrs to Controller are invalidated before its members 169 // that any WeakPtrs to Controller are invalidated before its members
168 // variable's destructors are executed, rendering them invalid. 170 // variable's destructors are executed, rendering them invalid.
169 base::WeakPtrFactory<GpuChannelManager> weak_factory_; 171 base::WeakPtrFactory<GpuChannelManager> weak_factory_;
170 172
171 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); 173 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager);
172 }; 174 };
173 175
174 } // namespace content 176 } // namespace content
175 177
176 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ 178 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_channel.cc ('k') | content/common/gpu/gpu_channel_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698