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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 scoped_ptr<EstablishChannelCallback> wrapped_callback(callback); | 614 scoped_ptr<EstablishChannelCallback> wrapped_callback(callback); |
613 wrapped_callback->Run(channel_handle, renderer_process_for_gpu, gpu_info); | 615 wrapped_callback->Run(channel_handle, renderer_process_for_gpu, gpu_info); |
614 } | 616 } |
615 | 617 |
616 void GpuProcessHost::CreateCommandBufferError( | 618 void GpuProcessHost::CreateCommandBufferError( |
617 CreateCommandBufferCallback* callback, int32 route_id) { | 619 CreateCommandBufferCallback* callback, int32 route_id) { |
618 scoped_ptr<GpuProcessHost::CreateCommandBufferCallback> | 620 scoped_ptr<GpuProcessHost::CreateCommandBufferCallback> |
619 wrapped_callback(callback); | 621 wrapped_callback(callback); |
620 callback->Run(route_id); | 622 callback->Run(route_id); |
621 } | 623 } |
OLD | NEW |