| 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/browser/gpu/gpu_process_host.h" | 5 #include "content/browser/gpu/gpu_process_host.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 | 460 |
| 461 bool GpuProcessHost::CanShutdown() { | 461 bool GpuProcessHost::CanShutdown() { |
| 462 return true; | 462 return true; |
| 463 } | 463 } |
| 464 | 464 |
| 465 void GpuProcessHost::OnProcessLaunched() { | 465 void GpuProcessHost::OnProcessLaunched() { |
| 466 // Send the GPU process handle to the UI thread before it has to | 466 // Send the GPU process handle to the UI thread before it has to |
| 467 // respond to any requests to establish a GPU channel. The response | 467 // respond to any requests to establish a GPU channel. The response |
| 468 // to such requests require that the GPU process handle be known. | 468 // to such requests require that the GPU process handle be known. |
| 469 | 469 |
| 470 TRACE_EVENT0("test_gpu", "GpuProcessLaunched"); |
| 471 |
| 470 base::ProcessHandle child_handle = in_process_ ? | 472 base::ProcessHandle child_handle = in_process_ ? |
| 471 base::GetCurrentProcessHandle() : handle(); | 473 base::GetCurrentProcessHandle() : handle(); |
| 472 | 474 |
| 473 #if defined(OS_WIN) | 475 #if defined(OS_WIN) |
| 474 DuplicateHandle(base::GetCurrentProcessHandle(), | 476 DuplicateHandle(base::GetCurrentProcessHandle(), |
| 475 child_handle, | 477 child_handle, |
| 476 base::GetCurrentProcessHandle(), | 478 base::GetCurrentProcessHandle(), |
| 477 &gpu_process_, | 479 &gpu_process_, |
| 478 PROCESS_DUP_HANDLE, | 480 PROCESS_DUP_HANDLE, |
| 479 FALSE, | 481 FALSE, |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 scoped_ptr<EstablishChannelCallback> wrapped_callback(callback); | 613 scoped_ptr<EstablishChannelCallback> wrapped_callback(callback); |
| 612 wrapped_callback->Run(channel_handle, renderer_process_for_gpu, gpu_info); | 614 wrapped_callback->Run(channel_handle, renderer_process_for_gpu, gpu_info); |
| 613 } | 615 } |
| 614 | 616 |
| 615 void GpuProcessHost::CreateCommandBufferError( | 617 void GpuProcessHost::CreateCommandBufferError( |
| 616 CreateCommandBufferCallback* callback, int32 route_id) { | 618 CreateCommandBufferCallback* callback, int32 route_id) { |
| 617 scoped_ptr<GpuProcessHost::CreateCommandBufferCallback> | 619 scoped_ptr<GpuProcessHost::CreateCommandBufferCallback> |
| 618 wrapped_callback(callback); | 620 wrapped_callback(callback); |
| 619 callback->Run(route_id); | 621 callback->Run(route_id); |
| 620 } | 622 } |
| OLD | NEW |