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 "base/base_switches.h" |
5 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/debug/debugger.h" |
6 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
7 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
8 #include "base/mac/scoped_nsautorelease_pool.h" | 10 #include "base/mac/scoped_nsautorelease_pool.h" |
9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
10 #include "base/metrics/field_trial.h" | 12 #include "base/metrics/field_trial.h" |
11 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
12 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
13 #include "base/metrics/stats_counters.h" | 15 #include "base/metrics/stats_counters.h" |
14 #include "base/path_service.h" | 16 #include "base/path_service.h" |
15 #include "base/process_util.h" | 17 #include "base/process_util.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 85 } |
84 #endif // !defined(OFFICIAL_BUILD) | 86 #endif // !defined(OFFICIAL_BUILD) |
85 | 87 |
86 | 88 |
87 // This parameter causes a null pointer crash (crash reporter trigger). | 89 // This parameter causes a null pointer crash (crash reporter trigger). |
88 if (command_line.HasSwitch(switches::kRendererCrashTest)) { | 90 if (command_line.HasSwitch(switches::kRendererCrashTest)) { |
89 int* bad_pointer = NULL; | 91 int* bad_pointer = NULL; |
90 *bad_pointer = 0; | 92 *bad_pointer = 0; |
91 } | 93 } |
92 | 94 |
93 if (command_line.HasSwitch(switches::kRendererStartupDialog)) { | 95 if (command_line.HasSwitch(switches::kWaitForDebugger)) |
| 96 base::debug::WaitForDebugger(60, true); |
| 97 |
| 98 if (command_line.HasSwitch(switches::kRendererStartupDialog)) |
94 ChildProcess::WaitForDebugger("Renderer"); | 99 ChildProcess::WaitForDebugger("Renderer"); |
95 } | |
96 } | 100 } |
97 | 101 |
98 // This is a simplified version of the browser Jankometer, which measures | 102 // This is a simplified version of the browser Jankometer, which measures |
99 // the processing time of tasks on the render thread. | 103 // the processing time of tasks on the render thread. |
100 class RendererMessageLoopObserver : public MessageLoop::TaskObserver { | 104 class RendererMessageLoopObserver : public MessageLoop::TaskObserver { |
101 public: | 105 public: |
102 RendererMessageLoopObserver() | 106 RendererMessageLoopObserver() |
103 : process_times_(base::Histogram::FactoryGet( | 107 : process_times_(base::Histogram::FactoryGet( |
104 "Chrome.ProcMsgL RenderThread", | 108 "Chrome.ProcMsgL RenderThread", |
105 1, 3600000, 50, base::Histogram::kUmaTargetedHistogramFlag)) {} | 109 1, 3600000, 50, base::Histogram::kUmaTargetedHistogramFlag)) {} |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 pool->Recycle(); | 230 pool->Recycle(); |
227 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 231 TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
228 MessageLoop::current()->Run(); | 232 MessageLoop::current()->Run(); |
229 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); | 233 TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); |
230 } | 234 } |
231 } | 235 } |
232 platform.PlatformUninitialize(); | 236 platform.PlatformUninitialize(); |
233 TRACE_EVENT_END_ETW("RendererMain", 0, ""); | 237 TRACE_EVENT_END_ETW("RendererMain", 0, ""); |
234 return 0; | 238 return 0; |
235 } | 239 } |
OLD | NEW |