OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/histogram.h" |
6 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
7 #include "base/path_service.h" | 8 #include "base/path_service.h" |
8 #include "base/platform_thread.h" | 9 #include "base/platform_thread.h" |
9 #include "base/scoped_nsautorelease_pool.h" | 10 #include "base/scoped_nsautorelease_pool.h" |
10 #include "base/string_util.h" | 11 #include "base/string_util.h" |
11 #include "base/system_monitor.h" | 12 #include "base/system_monitor.h" |
12 #include "chrome/common/chrome_constants.h" | 13 #include "chrome/common/chrome_constants.h" |
13 #include "chrome/common/chrome_counters.h" | 14 #include "chrome/common/chrome_counters.h" |
14 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
15 #include "chrome/common/l10n_util.h" | 16 #include "chrome/common/l10n_util.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // Initialize the SystemMonitor | 83 // Initialize the SystemMonitor |
83 base::SystemMonitor::Start(); | 84 base::SystemMonitor::Start(); |
84 | 85 |
85 platform.PlatformInitialize(); | 86 platform.PlatformInitialize(); |
86 | 87 |
87 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); | 88 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); |
88 platform.InitSandboxTests(no_sandbox); | 89 platform.InitSandboxTests(no_sandbox); |
89 | 90 |
90 HandleRendererErrorTestParameters(parsed_command_line); | 91 HandleRendererErrorTestParameters(parsed_command_line); |
91 | 92 |
| 93 // Initialize histogram statistics gathering system. |
| 94 // Don't create StatisticsRecorde in the single process mode. |
| 95 scoped_ptr<StatisticsRecorder> statistics; |
| 96 if (!StatisticsRecorder::WasStarted()) { |
| 97 statistics.reset(new StatisticsRecorder()); |
| 98 } |
| 99 |
92 { | 100 { |
93 RenderProcess render_process; | 101 RenderProcess render_process; |
94 bool run_loop = true; | 102 bool run_loop = true; |
95 if (!no_sandbox) { | 103 if (!no_sandbox) { |
96 run_loop = platform.EnableSandbox(); | 104 run_loop = platform.EnableSandbox(); |
97 } | 105 } |
98 | 106 |
99 platform.RunSandboxTests(); | 107 platform.RunSandboxTests(); |
100 | 108 |
101 startup_timer.Stop(); // End of Startup Time Measurement. | 109 startup_timer.Stop(); // End of Startup Time Measurement. |
102 | 110 |
103 if (run_loop) { | 111 if (run_loop) { |
104 // Load the accelerator table from the browser executable and tell the | 112 // Load the accelerator table from the browser executable and tell the |
105 // message loop to use it when translating messages. | 113 // message loop to use it when translating messages. |
106 if (pool) pool->Recycle(); | 114 if (pool) pool->Recycle(); |
107 MessageLoop::current()->Run(); | 115 MessageLoop::current()->Run(); |
108 } | 116 } |
109 } | 117 } |
110 platform.PlatformUninitialize(); | 118 platform.PlatformUninitialize(); |
111 return 0; | 119 return 0; |
112 } | 120 } |
113 | 121 |
OLD | NEW |