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 "base/base_switches.h" | 5 #include "base/base_switches.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/debug/debugger.h" | 7 #include "base/debug/debugger.h" |
8 #include "base/debug/stack_trace.h" | 8 #include "base/debug/stack_trace.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/hi_res_timer_manager.h" | 10 #include "base/hi_res_timer_manager.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 virtual void DidProcessTask(const base::PendingTask& pending_task) OVERRIDE { | 100 virtual void DidProcessTask(const base::PendingTask& pending_task) OVERRIDE { |
101 HISTOGRAM_MEMORY_KB("Memory.RendererUsed", webkit_glue::MemoryUsageKB()); | 101 HISTOGRAM_MEMORY_KB("Memory.RendererUsed", webkit_glue::MemoryUsageKB()); |
102 } | 102 } |
103 private: | 103 private: |
104 DISALLOW_COPY_AND_ASSIGN(MemoryObserver); | 104 DISALLOW_COPY_AND_ASSIGN(MemoryObserver); |
105 }; | 105 }; |
106 | 106 |
107 // mainline routine for running as the Renderer process | 107 // mainline routine for running as the Renderer process |
108 int RendererMain(const MainFunctionParams& parameters) { | 108 int RendererMain(const MainFunctionParams& parameters) { |
109 TRACE_EVENT_BEGIN_ETW("RendererMain", 0, ""); | 109 TRACE_EVENT_BEGIN_ETW("RendererMain", 0, ""); |
110 base::debug::TraceLog::GetInstance()->SetProcessSortIndex(1); | |
111 base::debug::TraceLog::GetInstance()->SetThreadSortIndex( | |
112 static_cast<int>(base::PlatformThread::CurrentId()), -1); | |
dsinclair
2013/06/20 15:01:47
If we're always call SetThreadSortIndex from the t
| |
110 | 113 |
111 const CommandLine& parsed_command_line = parameters.command_line; | 114 const CommandLine& parsed_command_line = parameters.command_line; |
112 | 115 |
113 #if defined(OS_MACOSX) | 116 #if defined(OS_MACOSX) |
114 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool; | 117 base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool; |
115 #endif // OS_MACOSX | 118 #endif // OS_MACOSX |
116 | 119 |
117 #if defined(OS_CHROMEOS) | 120 #if defined(OS_CHROMEOS) |
118 // As Zygote process starts up earlier than browser process gets its own | 121 // As Zygote process starts up earlier than browser process gets its own |
119 // locale (at login time for Chrome OS), we have to set the ICU default | 122 // locale (at login time for Chrome OS), we have to set the ICU default |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
236 base::MessageLoop::current()->Run(); | 239 base::MessageLoop::current()->Run(); |
237 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 240 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
238 } | 241 } |
239 } | 242 } |
240 platform.PlatformUninitialize(); | 243 platform.PlatformUninitialize(); |
241 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 244 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
242 return 0; | 245 return 0; |
243 } | 246 } |
244 | 247 |
245 } // namespace content | 248 } // namespace content |
OLD | NEW |