| 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 11 matching lines...) Expand all Loading... |
| 22 #include "gpu/command_buffer/service/valuebuffer_manager.h" | 22 #include "gpu/command_buffer/service/valuebuffer_manager.h" |
| 23 #include "ipc/ipc_sync_channel.h" | 23 #include "ipc/ipc_sync_channel.h" |
| 24 #include "ui/gfx/geometry/size.h" | 24 #include "ui/gfx/geometry/size.h" |
| 25 #include "ui/gfx/native_widget_types.h" | 25 #include "ui/gfx/native_widget_types.h" |
| 26 #include "ui/gl/gl_share_group.h" | 26 #include "ui/gl/gl_share_group.h" |
| 27 #include "ui/gl/gpu_preference.h" | 27 #include "ui/gl/gpu_preference.h" |
| 28 | 28 |
| 29 struct GPUCreateCommandBufferConfig; | 29 struct GPUCreateCommandBufferConfig; |
| 30 | 30 |
| 31 namespace base { | 31 namespace base { |
| 32 class MessageLoopProxy; |
| 32 class WaitableEvent; | 33 class WaitableEvent; |
| 33 } | 34 } |
| 34 | 35 |
| 35 namespace gpu { | 36 namespace gpu { |
| 36 class PreemptionFlag; | 37 class PreemptionFlag; |
| 37 union ValueState; | 38 union ValueState; |
| 38 class ValueStateMap; | 39 class ValueStateMap; |
| 39 namespace gles2 { | 40 namespace gles2 { |
| 40 class SubscriptionRefSet; | 41 class SubscriptionRefSet; |
| 41 } | 42 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 58 // Takes ownership of the renderer process handle. | 59 // Takes ownership of the renderer process handle. |
| 59 GpuChannel(GpuChannelManager* gpu_channel_manager, | 60 GpuChannel(GpuChannelManager* gpu_channel_manager, |
| 60 GpuWatchdog* watchdog, | 61 GpuWatchdog* watchdog, |
| 61 gfx::GLShareGroup* share_group, | 62 gfx::GLShareGroup* share_group, |
| 62 gpu::gles2::MailboxManager* mailbox_manager, | 63 gpu::gles2::MailboxManager* mailbox_manager, |
| 63 int client_id, | 64 int client_id, |
| 64 bool software, | 65 bool software, |
| 65 bool allow_future_sync_points); | 66 bool allow_future_sync_points); |
| 66 ~GpuChannel() override; | 67 ~GpuChannel() override; |
| 67 | 68 |
| 68 void Init(base::SingleThreadTaskRunner* io_task_runner, | 69 void Init(base::MessageLoopProxy* io_message_loop, |
| 69 base::WaitableEvent* shutdown_event); | 70 base::WaitableEvent* shutdown_event); |
| 70 | 71 |
| 71 // Get the GpuChannelManager that owns this channel. | 72 // Get the GpuChannelManager that owns this channel. |
| 72 GpuChannelManager* gpu_channel_manager() const { | 73 GpuChannelManager* gpu_channel_manager() const { |
| 73 return gpu_channel_manager_; | 74 return gpu_channel_manager_; |
| 74 } | 75 } |
| 75 | 76 |
| 76 // Returns the name of the associated IPC channel. | 77 // Returns the name of the associated IPC channel. |
| 77 std::string GetChannelName(); | 78 std::string GetChannelName(); |
| 78 | 79 |
| 79 #if defined(OS_POSIX) | 80 #if defined(OS_POSIX) |
| 80 base::ScopedFD TakeRendererFileDescriptor(); | 81 base::ScopedFD TakeRendererFileDescriptor(); |
| 81 #endif // defined(OS_POSIX) | 82 #endif // defined(OS_POSIX) |
| 82 | 83 |
| 83 base::ProcessId renderer_pid() const { return channel_->GetPeerPID(); } | 84 base::ProcessId renderer_pid() const { return channel_->GetPeerPID(); } |
| 84 | 85 |
| 85 int client_id() const { return client_id_; } | 86 int client_id() const { return client_id_; } |
| 86 | 87 |
| 87 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner() const { | 88 scoped_refptr<base::MessageLoopProxy> io_message_loop() const { |
| 88 return io_task_runner_; | 89 return io_message_loop_; |
| 89 } | 90 } |
| 90 | 91 |
| 91 // IPC::Listener implementation: | 92 // IPC::Listener implementation: |
| 92 bool OnMessageReceived(const IPC::Message& msg) override; | 93 bool OnMessageReceived(const IPC::Message& msg) override; |
| 93 void OnChannelError() override; | 94 void OnChannelError() override; |
| 94 | 95 |
| 95 // IPC::Sender implementation: | 96 // IPC::Sender implementation: |
| 96 bool Send(IPC::Message* msg) override; | 97 bool Send(IPC::Message* msg) override; |
| 97 | 98 |
| 98 // Requeue the message that is currently being processed to the beginning of | 99 // Requeue the message that is currently being processed to the beginning of |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 StubMap stubs_; | 231 StubMap stubs_; |
| 231 | 232 |
| 232 bool log_messages_; // True if we should log sent and received messages. | 233 bool log_messages_; // True if we should log sent and received messages. |
| 233 gpu::gles2::DisallowedFeatures disallowed_features_; | 234 gpu::gles2::DisallowedFeatures disallowed_features_; |
| 234 GpuWatchdog* watchdog_; | 235 GpuWatchdog* watchdog_; |
| 235 bool software_; | 236 bool software_; |
| 236 bool handle_messages_scheduled_; | 237 bool handle_messages_scheduled_; |
| 237 IPC::Message* currently_processing_message_; | 238 IPC::Message* currently_processing_message_; |
| 238 | 239 |
| 239 scoped_refptr<GpuChannelMessageFilter> filter_; | 240 scoped_refptr<GpuChannelMessageFilter> filter_; |
| 240 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 241 scoped_refptr<base::MessageLoopProxy> io_message_loop_; |
| 241 | 242 |
| 242 size_t num_stubs_descheduled_; | 243 size_t num_stubs_descheduled_; |
| 243 | 244 |
| 244 bool allow_future_sync_points_; | 245 bool allow_future_sync_points_; |
| 245 | 246 |
| 246 // Member variables should appear before the WeakPtrFactory, to ensure | 247 // Member variables should appear before the WeakPtrFactory, to ensure |
| 247 // that any WeakPtrs to Controller are invalidated before its members | 248 // that any WeakPtrs to Controller are invalidated before its members |
| 248 // variable's destructors are executed, rendering them invalid. | 249 // variable's destructors are executed, rendering them invalid. |
| 249 base::WeakPtrFactory<GpuChannel> weak_factory_; | 250 base::WeakPtrFactory<GpuChannel> weak_factory_; |
| 250 | 251 |
| 251 DISALLOW_COPY_AND_ASSIGN(GpuChannel); | 252 DISALLOW_COPY_AND_ASSIGN(GpuChannel); |
| 252 }; | 253 }; |
| 253 | 254 |
| 254 } // namespace content | 255 } // namespace content |
| 255 | 256 |
| 256 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ | 257 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ |
| OLD | NEW |