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

Side by Side Diff: gpu/ipc/service/gpu_channel.h

Issue 2814583002: Service/ClientDiscardableManager (Closed)
Patch Set: feeedback Created 3 years, 7 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_SERVICE_GPU_CHANNEL_H_ 5 #ifndef GPU_IPC_SERVICE_GPU_CHANNEL_H_
6 #define GPU_IPC_SERVICE_GPU_CHANNEL_H_ 6 #define GPU_IPC_SERVICE_GPU_CHANNEL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // Encapsulates an IPC channel between the GPU process and one renderer 79 // Encapsulates an IPC channel between the GPU process and one renderer
80 // process. On the renderer side there's a corresponding GpuChannelHost. 80 // process. On the renderer side there's a corresponding GpuChannelHost.
81 class GPU_EXPORT GpuChannel : public IPC::Listener, public FilteredSender { 81 class GPU_EXPORT GpuChannel : public IPC::Listener, public FilteredSender {
82 public: 82 public:
83 // Takes ownership of the renderer process handle. 83 // Takes ownership of the renderer process handle.
84 GpuChannel(GpuChannelManager* gpu_channel_manager, 84 GpuChannel(GpuChannelManager* gpu_channel_manager,
85 SyncPointManager* sync_point_manager, 85 SyncPointManager* sync_point_manager,
86 GpuWatchdogThread* watchdog, 86 GpuWatchdogThread* watchdog,
87 scoped_refptr<gl::GLShareGroup> share_group, 87 scoped_refptr<gl::GLShareGroup> share_group,
88 scoped_refptr<gles2::MailboxManager> mailbox_manager, 88 scoped_refptr<gles2::MailboxManager> mailbox_manager,
89 ServiceDiscardableManager* discardable_manager_,
89 scoped_refptr<PreemptionFlag> preempting_flag, 90 scoped_refptr<PreemptionFlag> preempting_flag,
90 scoped_refptr<PreemptionFlag> preempted_flag, 91 scoped_refptr<PreemptionFlag> preempted_flag,
91 scoped_refptr<base::SingleThreadTaskRunner> task_runner, 92 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
92 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, 93 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
93 int32_t client_id, 94 int32_t client_id,
94 uint64_t client_tracing_id, 95 uint64_t client_tracing_id,
95 bool is_gpu_host); 96 bool is_gpu_host);
96 ~GpuChannel() override; 97 ~GpuChannel() override;
97 98
98 // The IPC channel cannot be passed in the constructor because it needs a 99 // The IPC channel cannot be passed in the constructor because it needs a
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // FilteredSender implementation: 149 // FilteredSender implementation:
149 bool Send(IPC::Message* msg) override; 150 bool Send(IPC::Message* msg) override;
150 void AddFilter(IPC::MessageFilter* filter) override; 151 void AddFilter(IPC::MessageFilter* filter) override;
151 void RemoveFilter(IPC::MessageFilter* filter) override; 152 void RemoveFilter(IPC::MessageFilter* filter) override;
152 153
153 void OnCommandBufferScheduled(GpuCommandBufferStub* stub); 154 void OnCommandBufferScheduled(GpuCommandBufferStub* stub);
154 void OnCommandBufferDescheduled(GpuCommandBufferStub* stub); 155 void OnCommandBufferDescheduled(GpuCommandBufferStub* stub);
155 156
156 gl::GLShareGroup* share_group() const { return share_group_.get(); } 157 gl::GLShareGroup* share_group() const { return share_group_.get(); }
157 158
159 ServiceDiscardableManager* discardable_manager() const {
160 return discardable_manager_;
161 }
162
158 GpuCommandBufferStub* LookupCommandBuffer(int32_t route_id); 163 GpuCommandBufferStub* LookupCommandBuffer(int32_t route_id);
159 164
160 void LoseAllContexts(); 165 void LoseAllContexts();
161 void MarkAllContextsLost(); 166 void MarkAllContextsLost();
162 167
163 // Called to add a listener for a particular message routing ID. 168 // Called to add a listener for a particular message routing ID.
164 // Returns true if succeeded. 169 // Returns true if succeeded.
165 bool AddRoute(int32_t route_id, 170 bool AddRoute(int32_t route_id,
166 SequenceId sequence_id, 171 SequenceId sequence_id,
167 IPC::Listener* listener); 172 IPC::Listener* listener);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; 262 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
258 263
259 // The share group that all contexts associated with a particular renderer 264 // The share group that all contexts associated with a particular renderer
260 // process use. 265 // process use.
261 scoped_refptr<gl::GLShareGroup> share_group_; 266 scoped_refptr<gl::GLShareGroup> share_group_;
262 267
263 scoped_refptr<gles2::MailboxManager> mailbox_manager_; 268 scoped_refptr<gles2::MailboxManager> mailbox_manager_;
264 269
265 GpuWatchdogThread* const watchdog_; 270 GpuWatchdogThread* const watchdog_;
266 271
272 ServiceDiscardableManager* discardable_manager_;
273
267 const bool is_gpu_host_; 274 const bool is_gpu_host_;
268 275
269 // Member variables should appear before the WeakPtrFactory, to ensure that 276 // Member variables should appear before the WeakPtrFactory, to ensure that
270 // any WeakPtrs to Controller are invalidated before its members variable's 277 // any WeakPtrs to Controller are invalidated before its members variable's
271 // destructors are executed, rendering them invalid. 278 // destructors are executed, rendering them invalid.
272 base::WeakPtrFactory<GpuChannel> weak_factory_; 279 base::WeakPtrFactory<GpuChannel> weak_factory_;
273 280
274 DISALLOW_COPY_AND_ASSIGN(GpuChannel); 281 DISALLOW_COPY_AND_ASSIGN(GpuChannel);
275 }; 282 };
276 283
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 scoped_refptr<PreemptionFlag> preempting_flag_; 446 scoped_refptr<PreemptionFlag> preempting_flag_;
440 scoped_refptr<PreemptionFlag> preempted_flag_; 447 scoped_refptr<PreemptionFlag> preempted_flag_;
441 SyncPointManager* const sync_point_manager_; 448 SyncPointManager* const sync_point_manager_;
442 449
443 DISALLOW_COPY_AND_ASSIGN(GpuChannelMessageQueue); 450 DISALLOW_COPY_AND_ASSIGN(GpuChannelMessageQueue);
444 }; 451 };
445 452
446 } // namespace gpu 453 } // namespace gpu
447 454
448 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_H_ 455 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698