Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Side by Side Diff: content/gpu/gpu_main.cc

Issue 17451017: Process names, and predictable thread and process ordering in about:tracing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix trybots i think Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/content_constants_internal.cc ('k') | content/plugin/plugin_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/common/content_constants_internal.cc ('k') | content/plugin/plugin_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698