| 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 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 5 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/threading/thread_restrictions.h" | 8 #include "base/threading/thread_restrictions.h" |
| 9 #include "content/browser/gpu/gpu_data_manager_impl.h" | 9 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 10 #include "content/browser/gpu/gpu_process_host.h" | 10 #include "content/browser/gpu/gpu_process_host.h" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 gpu_client_id_, | 230 gpu_client_id_, |
| 231 true, | 231 true, |
| 232 base::Bind(&BrowserGpuChannelHostFactory::GpuChannelEstablishedOnIO, | 232 base::Bind(&BrowserGpuChannelHostFactory::GpuChannelEstablishedOnIO, |
| 233 base::Unretained(this), | 233 base::Unretained(this), |
| 234 request)); | 234 request)); |
| 235 } | 235 } |
| 236 | 236 |
| 237 void BrowserGpuChannelHostFactory::GpuChannelEstablishedOnIO( | 237 void BrowserGpuChannelHostFactory::GpuChannelEstablishedOnIO( |
| 238 EstablishRequest* request, | 238 EstablishRequest* request, |
| 239 const IPC::ChannelHandle& channel_handle, | 239 const IPC::ChannelHandle& channel_handle, |
| 240 const GPUInfo& gpu_info) { | 240 const gpu::GPUInfo& gpu_info) { |
| 241 if (channel_handle.name.empty() && request->reused_gpu_process) { | 241 if (channel_handle.name.empty() && request->reused_gpu_process) { |
| 242 // We failed after re-using the GPU process, but it may have died in the | 242 // We failed after re-using the GPU process, but it may have died in the |
| 243 // mean time. Retry to have a chance to create a fresh GPU process. | 243 // mean time. Retry to have a chance to create a fresh GPU process. |
| 244 EstablishGpuChannelOnIO(request); | 244 EstablishGpuChannelOnIO(request); |
| 245 } else { | 245 } else { |
| 246 request->channel_handle = channel_handle; | 246 request->channel_handle = channel_handle; |
| 247 request->gpu_info = gpu_info; | 247 request->gpu_info = gpu_info; |
| 248 request->event.Signal(); | 248 request->event.Signal(); |
| 249 } | 249 } |
| 250 } | 250 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 filter->AddRoute(MSG_ROUTING_CONTROL, handler); | 313 filter->AddRoute(MSG_ROUTING_CONTROL, handler); |
| 314 | 314 |
| 315 GetIOLoopProxy()->PostTask( | 315 GetIOLoopProxy()->PostTask( |
| 316 FROM_HERE, | 316 FROM_HERE, |
| 317 base::Bind(&BrowserGpuChannelHostFactory::AddFilterOnIO, | 317 base::Bind(&BrowserGpuChannelHostFactory::AddFilterOnIO, |
| 318 gpu_host_id_, | 318 gpu_host_id_, |
| 319 filter)); | 319 filter)); |
| 320 } | 320 } |
| 321 | 321 |
| 322 } // namespace content | 322 } // namespace content |
| OLD | NEW |