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 <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "base/rand_util.h" | 14 #include "base/rand_util.h" |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
17 #include "base/threading/platform_thread.h" | 17 #include "base/threading/platform_thread.h" |
18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
19 #include "content/child/child_process.h" | 19 #include "content/child/child_process.h" |
| 20 #include "content/common/content_constants_internal.h" |
20 #include "content/common/gpu/gpu_config.h" | 21 #include "content/common/gpu/gpu_config.h" |
21 #include "content/common/gpu/gpu_messages.h" | 22 #include "content/common/gpu/gpu_messages.h" |
22 #include "content/common/sandbox_linux.h" | 23 #include "content/common/sandbox_linux.h" |
23 #include "content/gpu/gpu_child_thread.h" | 24 #include "content/gpu/gpu_child_thread.h" |
24 #include "content/gpu/gpu_process.h" | 25 #include "content/gpu/gpu_process.h" |
25 #include "content/gpu/gpu_watchdog_thread.h" | 26 #include "content/gpu/gpu_watchdog_thread.h" |
26 #include "content/public/common/content_client.h" | 27 #include "content/public/common/content_client.h" |
27 #include "content/public/common/content_switches.h" | 28 #include "content/public/common/content_switches.h" |
28 #include "content/public/common/main_function_params.h" | 29 #include "content/public/common/main_function_params.h" |
29 #include "crypto/hmac.h" | 30 #include "crypto/hmac.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 deferred_messages.Get().push(new GpuHostMsg_OnLogMessage( | 78 deferred_messages.Get().push(new GpuHostMsg_OnLogMessage( |
78 severity, header, message)); | 79 severity, header, message)); |
79 return false; | 80 return false; |
80 } | 81 } |
81 | 82 |
82 } // namespace anonymous | 83 } // namespace anonymous |
83 | 84 |
84 // Main function for starting the Gpu process. | 85 // Main function for starting the Gpu process. |
85 int GpuMain(const MainFunctionParams& parameters) { | 86 int GpuMain(const MainFunctionParams& parameters) { |
86 TRACE_EVENT0("gpu", "GpuMain"); | 87 TRACE_EVENT0("gpu", "GpuMain"); |
| 88 base::debug::TraceLog::GetInstance()->SetProcessName("GPU Process"); |
| 89 base::debug::TraceLog::GetInstance()->SetProcessSortIndex( |
| 90 kTraceEventGpuProcessSortIndex); |
87 | 91 |
88 const CommandLine& command_line = parameters.command_line; | 92 const CommandLine& command_line = parameters.command_line; |
89 if (command_line.HasSwitch(switches::kGpuStartupDialog)) { | 93 if (command_line.HasSwitch(switches::kGpuStartupDialog)) { |
90 ChildProcess::WaitForDebugger("Gpu"); | 94 ChildProcess::WaitForDebugger("Gpu"); |
91 } | 95 } |
92 | 96 |
93 base::Time start_time = base::Time::Now(); | 97 base::Time start_time = base::Time::Now(); |
94 | 98 |
95 bool in_browser_process = command_line.HasSwitch(switches::kSingleProcess) || | 99 bool in_browser_process = command_line.HasSwitch(switches::kSingleProcess) || |
96 command_line.HasSwitch(switches::kInProcessGPU); | 100 command_line.HasSwitch(switches::kInProcessGPU); |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 return true; | 427 return true; |
424 } | 428 } |
425 | 429 |
426 return false; | 430 return false; |
427 } | 431 } |
428 #endif // defined(OS_WIN) | 432 #endif // defined(OS_WIN) |
429 | 433 |
430 } // namespace. | 434 } // namespace. |
431 | 435 |
432 } // namespace content | 436 } // namespace content |
OLD | NEW |