| 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 #include "content/renderer/gpu/gpu_channel_host.h" | 5 #include "content/renderer/gpu/gpu_channel_host.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
| 9 #include "content/common/child_process.h" | 9 #include "content/common/child_process.h" |
| 10 #include "content/common/gpu/gpu_messages.h" | 10 #include "content/common/gpu/gpu_messages.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 delete message; | 199 delete message; |
| 200 return false; | 200 return false; |
| 201 } | 201 } |
| 202 | 202 |
| 203 CommandBufferProxy* GpuChannelHost::CreateViewCommandBuffer( | 203 CommandBufferProxy* GpuChannelHost::CreateViewCommandBuffer( |
| 204 int render_view_id, | 204 int render_view_id, |
| 205 CommandBufferProxy* share_group, | 205 CommandBufferProxy* share_group, |
| 206 const std::string& allowed_extensions, | 206 const std::string& allowed_extensions, |
| 207 const std::vector<int32>& attribs, | 207 const std::vector<int32>& attribs, |
| 208 const GURL& active_url) { | 208 const GURL& active_url) { |
| 209 DCHECK(ChildThread::current()); |
| 209 #if defined(ENABLE_GPU) | 210 #if defined(ENABLE_GPU) |
| 210 AutoLock lock(context_lock_); | 211 AutoLock lock(context_lock_); |
| 211 // An error occurred. Need to get the host again to reinitialize it. | 212 // An error occurred. Need to get the host again to reinitialize it. |
| 212 if (!channel_.get()) | 213 if (!channel_.get()) |
| 213 return NULL; | 214 return NULL; |
| 214 | 215 |
| 215 GPUCreateCommandBufferConfig init_params; | 216 GPUCreateCommandBufferConfig init_params; |
| 216 init_params.share_group_id = | 217 init_params.share_group_id = |
| 217 share_group ? share_group->route_id() : MSG_ROUTING_NONE; | 218 share_group ? share_group->route_id() : MSG_ROUTING_NONE; |
| 218 init_params.allowed_extensions = allowed_extensions; | 219 init_params.allowed_extensions = allowed_extensions; |
| 219 init_params.attribs = attribs; | 220 init_params.attribs = attribs; |
| 220 init_params.active_url = active_url; | 221 init_params.active_url = active_url; |
| 221 int32 route_id; | 222 int32 route_id; |
| 222 if (!RenderThread::current()->Send( | 223 if (!ChildThread::current()->Send( |
| 223 new GpuHostMsg_CreateViewCommandBuffer( | 224 new GpuHostMsg_CreateViewCommandBuffer( |
| 224 render_view_id, | 225 render_view_id, |
| 225 init_params, | 226 init_params, |
| 226 &route_id))) { | 227 &route_id))) { |
| 227 return NULL; | 228 return NULL; |
| 228 } | 229 } |
| 229 | 230 |
| 230 if (route_id == MSG_ROUTING_NONE) | 231 if (route_id == MSG_ROUTING_NONE) |
| 231 return NULL; | 232 return NULL; |
| 232 | 233 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 } | 315 } |
| 315 | 316 |
| 316 void GpuChannelHost::RemoveRoute(int route_id) { | 317 void GpuChannelHost::RemoveRoute(int route_id) { |
| 317 MessageLoopProxy* io_loop = RenderProcess::current()->io_message_loop_proxy(); | 318 MessageLoopProxy* io_loop = RenderProcess::current()->io_message_loop_proxy(); |
| 318 io_loop->PostTask(FROM_HERE, | 319 io_loop->PostTask(FROM_HERE, |
| 319 NewRunnableMethod( | 320 NewRunnableMethod( |
| 320 channel_filter_.get(), | 321 channel_filter_.get(), |
| 321 &GpuChannelHost::MessageFilter::RemoveRoute, | 322 &GpuChannelHost::MessageFilter::RemoveRoute, |
| 322 route_id)); | 323 route_id)); |
| 323 } | 324 } |
| OLD | NEW |