| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 // Called to add/remove a listener for a particular message routing ID. | 120 // Called to add/remove a listener for a particular message routing ID. |
| 121 void AddRoute(int32 route_id, IPC::Channel::Listener* listener); | 121 void AddRoute(int32 route_id, IPC::Channel::Listener* listener); |
| 122 void RemoveRoute(int32 route_id); | 122 void RemoveRoute(int32 route_id); |
| 123 | 123 |
| 124 private: | 124 private: |
| 125 void OnDestroy(); | 125 void OnDestroy(); |
| 126 | 126 |
| 127 bool OnControlMessageReceived(const IPC::Message& msg); | 127 bool OnControlMessageReceived(const IPC::Message& msg); |
| 128 | 128 |
| 129 void HandleDeferredMessages(); | 129 void HandleMessage(); |
| 130 | 130 |
| 131 // Message handlers. | 131 // Message handlers. |
| 132 void OnInitialize(base::ProcessHandle renderer_process); | 132 void OnInitialize(base::ProcessHandle renderer_process); |
| 133 void OnCreateOffscreenCommandBuffer( | 133 void OnCreateOffscreenCommandBuffer( |
| 134 const gfx::Size& size, | 134 const gfx::Size& size, |
| 135 const GPUCreateCommandBufferConfig& init_params, | 135 const GPUCreateCommandBufferConfig& init_params, |
| 136 IPC::Message* reply_message); | 136 IPC::Message* reply_message); |
| 137 void OnDestroyCommandBuffer(int32 route_id, IPC::Message* reply_message); | 137 void OnDestroyCommandBuffer(int32 route_id, IPC::Message* reply_message); |
| 138 | 138 |
| 139 void OnCreateTransportTexture(int32 context_route_id, int32 host_id); | 139 void OnCreateTransportTexture(int32 context_route_id, int32 host_id); |
| 140 | 140 |
| 141 void OnEcho(const IPC::Message& message); | 141 void OnEcho(const IPC::Message& message); |
| 142 | 142 |
| 143 // The lifetime of objects of this class is managed by a GpuChannelManager. | 143 // The lifetime of objects of this class is managed by a GpuChannelManager. |
| 144 // The GpuChannelManager destroy all the GpuChannels that they own when they | 144 // The GpuChannelManager destroy all the GpuChannels that they own when they |
| 145 // are destroyed. So a raw pointer is safe. | 145 // are destroyed. So a raw pointer is safe. |
| 146 GpuChannelManager* gpu_channel_manager_; | 146 GpuChannelManager* gpu_channel_manager_; |
| 147 | 147 |
| 148 scoped_ptr<IPC::SyncChannel> channel_; | 148 scoped_ptr<IPC::SyncChannel> channel_; |
| 149 | 149 |
| 150 std::queue<IPC::Message*> deferred_messages_; | 150 std::deque<IPC::Message*> deferred_messages_; |
| 151 | 151 |
| 152 // The id of the renderer who is on the other side of the channel. | 152 // The id of the renderer who is on the other side of the channel. |
| 153 int renderer_id_; | 153 int renderer_id_; |
| 154 | 154 |
| 155 // Handle to the renderer process that is on the other side of the channel. | 155 // Handle to the renderer process that is on the other side of the channel. |
| 156 base::ProcessHandle renderer_process_; | 156 base::ProcessHandle renderer_process_; |
| 157 | 157 |
| 158 // The process id of the renderer process. | 158 // The process id of the renderer process. |
| 159 base::ProcessId renderer_pid_; | 159 base::ProcessId renderer_pid_; |
| 160 | 160 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 171 #endif // defined (ENABLE_GPU) | 171 #endif // defined (ENABLE_GPU) |
| 172 | 172 |
| 173 // A collection of transport textures created. | 173 // A collection of transport textures created. |
| 174 typedef IDMap<TransportTexture, IDMapOwnPointer> TransportTextureMap; | 174 typedef IDMap<TransportTexture, IDMapOwnPointer> TransportTextureMap; |
| 175 TransportTextureMap transport_textures_; | 175 TransportTextureMap transport_textures_; |
| 176 | 176 |
| 177 bool log_messages_; // True if we should log sent and received messages. | 177 bool log_messages_; // True if we should log sent and received messages. |
| 178 gpu::gles2::DisallowedFeatures disallowed_features_; | 178 gpu::gles2::DisallowedFeatures disallowed_features_; |
| 179 GpuWatchdog* watchdog_; | 179 GpuWatchdog* watchdog_; |
| 180 bool software_; | 180 bool software_; |
| 181 bool handle_messages_scheduled_; |
| 181 | 182 |
| 182 ScopedRunnableMethodFactory<GpuChannel> task_factory_; | 183 ScopedRunnableMethodFactory<GpuChannel> task_factory_; |
| 183 | 184 |
| 184 DISALLOW_COPY_AND_ASSIGN(GpuChannel); | 185 DISALLOW_COPY_AND_ASSIGN(GpuChannel); |
| 185 }; | 186 }; |
| 186 | 187 |
| 187 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ | 188 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ |
| OLD | NEW |