OLD | NEW |
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_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_CHANNEL_H_ |
6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_H_ | 6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 class GpuChannel : public IPC::Listener, public IPC::Sender { | 51 class GpuChannel : public IPC::Listener, public IPC::Sender { |
52 public: | 52 public: |
53 // Takes ownership of the renderer process handle. | 53 // Takes ownership of the renderer process handle. |
54 GpuChannel(GpuChannelManager* gpu_channel_manager, | 54 GpuChannel(GpuChannelManager* gpu_channel_manager, |
55 GpuWatchdog* watchdog, | 55 GpuWatchdog* watchdog, |
56 gfx::GLShareGroup* share_group, | 56 gfx::GLShareGroup* share_group, |
57 gpu::gles2::MailboxManager* mailbox_manager, | 57 gpu::gles2::MailboxManager* mailbox_manager, |
58 int client_id, | 58 int client_id, |
59 bool software, | 59 bool software, |
60 bool allow_future_sync_points); | 60 bool allow_future_sync_points); |
61 virtual ~GpuChannel(); | 61 ~GpuChannel() override; |
62 | 62 |
63 void Init(base::MessageLoopProxy* io_message_loop, | 63 void Init(base::MessageLoopProxy* io_message_loop, |
64 base::WaitableEvent* shutdown_event); | 64 base::WaitableEvent* shutdown_event); |
65 | 65 |
66 // Get the GpuChannelManager that owns this channel. | 66 // Get the GpuChannelManager that owns this channel. |
67 GpuChannelManager* gpu_channel_manager() const { | 67 GpuChannelManager* gpu_channel_manager() const { |
68 return gpu_channel_manager_; | 68 return gpu_channel_manager_; |
69 } | 69 } |
70 | 70 |
71 // Returns the name of the associated IPC channel. | 71 // Returns the name of the associated IPC channel. |
72 std::string GetChannelName(); | 72 std::string GetChannelName(); |
73 | 73 |
74 #if defined(OS_POSIX) | 74 #if defined(OS_POSIX) |
75 base::ScopedFD TakeRendererFileDescriptor(); | 75 base::ScopedFD TakeRendererFileDescriptor(); |
76 #endif // defined(OS_POSIX) | 76 #endif // defined(OS_POSIX) |
77 | 77 |
78 base::ProcessId renderer_pid() const { return channel_->GetPeerPID(); } | 78 base::ProcessId renderer_pid() const { return channel_->GetPeerPID(); } |
79 | 79 |
80 int client_id() const { return client_id_; } | 80 int client_id() const { return client_id_; } |
81 | 81 |
82 scoped_refptr<base::MessageLoopProxy> io_message_loop() const { | 82 scoped_refptr<base::MessageLoopProxy> io_message_loop() const { |
83 return io_message_loop_; | 83 return io_message_loop_; |
84 } | 84 } |
85 | 85 |
86 // IPC::Listener implementation: | 86 // IPC::Listener implementation: |
87 virtual bool OnMessageReceived(const IPC::Message& msg) override; | 87 bool OnMessageReceived(const IPC::Message& msg) override; |
88 virtual void OnChannelError() override; | 88 void OnChannelError() override; |
89 | 89 |
90 // IPC::Sender implementation: | 90 // IPC::Sender implementation: |
91 virtual bool Send(IPC::Message* msg) override; | 91 bool Send(IPC::Message* msg) override; |
92 | 92 |
93 // Requeue the message that is currently being processed to the beginning of | 93 // Requeue the message that is currently being processed to the beginning of |
94 // the queue. Used when the processing of a message gets aborted because of | 94 // the queue. Used when the processing of a message gets aborted because of |
95 // unscheduling conditions. | 95 // unscheduling conditions. |
96 void RequeueMessage(); | 96 void RequeueMessage(); |
97 | 97 |
98 // This is called when a command buffer transitions from the unscheduled | 98 // This is called when a command buffer transitions from the unscheduled |
99 // state to the scheduled state, which potentially means the channel | 99 // state to the scheduled state, which potentially means the channel |
100 // transitions from the unscheduled to the scheduled state. When this occurs | 100 // transitions from the unscheduled to the scheduled state. When this occurs |
101 // deferred IPC messaged are handled. | 101 // deferred IPC messaged are handled. |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 // that any WeakPtrs to Controller are invalidated before its members | 223 // that any WeakPtrs to Controller are invalidated before its members |
224 // variable's destructors are executed, rendering them invalid. | 224 // variable's destructors are executed, rendering them invalid. |
225 base::WeakPtrFactory<GpuChannel> weak_factory_; | 225 base::WeakPtrFactory<GpuChannel> weak_factory_; |
226 | 226 |
227 DISALLOW_COPY_AND_ASSIGN(GpuChannel); | 227 DISALLOW_COPY_AND_ASSIGN(GpuChannel); |
228 }; | 228 }; |
229 | 229 |
230 } // namespace content | 230 } // namespace content |
231 | 231 |
232 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ | 232 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ |
OLD | NEW |