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

Side by Side Diff: chrome/renderer/renderer_main.cc

Issue 431008: Make SystemMonitor not a Singleton and move it out of base (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: fix ChromeFrame build Created 11 years, 1 month 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
OLDNEW
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 "app/hi_res_timer_manager.h"
5 #include "app/l10n_util.h" 6 #include "app/l10n_util.h"
6 #include "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "app/system_monitor.h"
7 #include "base/command_line.h" 9 #include "base/command_line.h"
8 #include "base/field_trial.h" 10 #include "base/field_trial.h"
9 #include "base/histogram.h" 11 #include "base/histogram.h"
10 #include "base/message_loop.h" 12 #include "base/message_loop.h"
11 #include "base/path_service.h" 13 #include "base/path_service.h"
12 #include "base/platform_thread.h" 14 #include "base/platform_thread.h"
13 #include "base/process_util.h" 15 #include "base/process_util.h"
14 #include "base/scoped_nsautorelease_pool.h" 16 #include "base/scoped_nsautorelease_pool.h"
15 #include "base/stats_counters.h" 17 #include "base/stats_counters.h"
16 #include "base/string_util.h" 18 #include "base/string_util.h"
17 #include "base/system_monitor.h"
18 #include "chrome/common/chrome_constants.h" 19 #include "chrome/common/chrome_constants.h"
19 #include "chrome/common/chrome_counters.h" 20 #include "chrome/common/chrome_counters.h"
20 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
21 #include "chrome/common/logging_chrome.h" 22 #include "chrome/common/logging_chrome.h"
22 #include "chrome/common/main_function_params.h" 23 #include "chrome/common/main_function_params.h"
23 #include "chrome/common/net/net_resource_provider.h" 24 #include "chrome/common/net/net_resource_provider.h"
24 #include "chrome/renderer/renderer_main_platform_delegate.h" 25 #include "chrome/renderer/renderer_main_platform_delegate.h"
25 #include "chrome/renderer/render_process.h" 26 #include "chrome/renderer/render_process.h"
26 #include "chrome/renderer/render_thread.h" 27 #include "chrome/renderer/render_thread.h"
27 #include "grit/generated_resources.h" 28 #include "grit/generated_resources.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 #else 82 #else
82 // The main message loop of the renderer services doesn't have IO or UI tasks, 83 // The main message loop of the renderer services doesn't have IO or UI tasks,
83 // unless in-process-plugins is used. 84 // unless in-process-plugins is used.
84 MessageLoop main_message_loop(RenderProcess::InProcessPlugins() ? 85 MessageLoop main_message_loop(RenderProcess::InProcessPlugins() ?
85 MessageLoop::TYPE_UI : MessageLoop::TYPE_DEFAULT); 86 MessageLoop::TYPE_UI : MessageLoop::TYPE_DEFAULT);
86 #endif 87 #endif
87 88
88 std::wstring app_name = chrome::kBrowserAppName; 89 std::wstring app_name = chrome::kBrowserAppName;
89 PlatformThread::SetName(WideToASCII(app_name + L"_RendererMain").c_str()); 90 PlatformThread::SetName(WideToASCII(app_name + L"_RendererMain").c_str());
90 91
91 // Initialize the SystemMonitor 92 SystemMonitor system_monitor;
92 base::SystemMonitor::Start(); 93 HighResolutionTimerManager hi_res_timer_manager;
93 94
94 platform.PlatformInitialize(); 95 platform.PlatformInitialize();
95 96
96 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); 97 bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox);
97 platform.InitSandboxTests(no_sandbox); 98 platform.InitSandboxTests(no_sandbox);
98 99
99 // Initialize histogram statistics gathering system. 100 // Initialize histogram statistics gathering system.
100 // Don't create StatisticsRecorder in the single process mode. 101 // Don't create StatisticsRecorder in the single process mode.
101 scoped_ptr<StatisticsRecorder> statistics; 102 scoped_ptr<StatisticsRecorder> statistics;
102 if (!StatisticsRecorder::WasStarted()) { 103 if (!StatisticsRecorder::WasStarted()) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 136
136 if (run_loop) { 137 if (run_loop) {
137 if (pool) 138 if (pool)
138 pool->Recycle(); 139 pool->Recycle();
139 MessageLoop::current()->Run(); 140 MessageLoop::current()->Run();
140 } 141 }
141 } 142 }
142 platform.PlatformUninitialize(); 143 platform.PlatformUninitialize();
143 return 0; 144 return 0;
144 } 145 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698