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 <windows.h> | 5 #include <windows.h> |
6 #include <shellapi.h> | 6 #include <shellapi.h> |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/gfx/vector_canvas.h" | 12 #include "base/gfx/vector_canvas.h" |
13 #include "base/histogram.h" | 13 #include "base/histogram.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "base/process_util.h" | 15 #include "base/process_util.h" |
16 #include "base/registry.h" | 16 #include "base/registry.h" |
17 #include "base/string_util.h" | 17 #include "base/string_util.h" |
18 #include "base/system_monitor.h" | |
19 #include "base/tracked_objects.h" | 18 #include "base/tracked_objects.h" |
20 #include "base/win_util.h" | 19 #include "base/win_util.h" |
21 #include "chrome/app/result_codes.h" | 20 #include "chrome/app/result_codes.h" |
22 #include "chrome/browser/automation/automation_provider.h" | 21 #include "chrome/browser/automation/automation_provider.h" |
23 #include "chrome/browser/browser.h" | 22 #include "chrome/browser/browser.h" |
24 #include "chrome/browser/browser_init.h" | 23 #include "chrome/browser/browser_init.h" |
25 #include "chrome/browser/browser_list.h" | 24 #include "chrome/browser/browser_list.h" |
26 #include "chrome/browser/browser_prefs.h" | 25 #include "chrome/browser/browser_prefs.h" |
27 #include "chrome/browser/browser_process_impl.h" | 26 #include "chrome/browser/browser_process_impl.h" |
28 #include "chrome/browser/browser_shutdown.h" | 27 #include "chrome/browser/browser_shutdown.h" |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 sandbox::BrokerServices* broker_services) { | 263 sandbox::BrokerServices* broker_services) { |
265 // WARNING: If we get a WM_ENDSESSION objects created on the stack here | 264 // WARNING: If we get a WM_ENDSESSION objects created on the stack here |
266 // are NOT deleted. If you need something to run during WM_ENDSESSION add it | 265 // are NOT deleted. If you need something to run during WM_ENDSESSION add it |
267 // to browser_shutdown::Shutdown or BrowserProcess::EndSession. | 266 // to browser_shutdown::Shutdown or BrowserProcess::EndSession. |
268 | 267 |
269 // TODO(beng, brettw): someday, break this out into sub functions with well | 268 // TODO(beng, brettw): someday, break this out into sub functions with well |
270 // defined roles (e.g. pre/post-profile startup, etc). | 269 // defined roles (e.g. pre/post-profile startup, etc). |
271 | 270 |
272 MessageLoop main_message_loop(MessageLoop::TYPE_UI); | 271 MessageLoop main_message_loop(MessageLoop::TYPE_UI); |
273 | 272 |
274 // Initialize the SystemMonitor | |
275 base::SystemMonitor::Start(); | |
276 | |
277 // Initialize statistical testing infrastructure. | 273 // Initialize statistical testing infrastructure. |
278 FieldTrialList field_trial; | 274 FieldTrialList field_trial; |
279 | 275 |
280 std::wstring app_name = chrome::kBrowserAppName; | 276 std::wstring app_name = chrome::kBrowserAppName; |
281 std::string thread_name_string = WideToASCII(app_name + L"_BrowserMain"); | 277 std::string thread_name_string = WideToASCII(app_name + L"_BrowserMain"); |
282 | 278 |
283 const char* thread_name = thread_name_string.c_str(); | 279 const char* thread_name = thread_name_string.c_str(); |
284 PlatformThread::SetName(thread_name); | 280 PlatformThread::SetName(thread_name); |
285 main_message_loop.set_thread_name(thread_name); | 281 main_message_loop.set_thread_name(thread_name); |
286 bool already_running = Upgrade::IsBrowserAlreadyRunning(); | 282 bool already_running = Upgrade::IsBrowserAlreadyRunning(); |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 // The following should ONLY be called when in single threaded mode. It is | 582 // The following should ONLY be called when in single threaded mode. It is |
587 // unsafe to do this cleanup if other threads are still active. | 583 // unsafe to do this cleanup if other threads are still active. |
588 // It is also very unnecessary, so I'm only doing this in debug to satisfy | 584 // It is also very unnecessary, so I'm only doing this in debug to satisfy |
589 // purify. | 585 // purify. |
590 if (tracking_objects) | 586 if (tracking_objects) |
591 tracked_objects::ThreadData::ShutdownSingleThreadedCleanup(); | 587 tracked_objects::ThreadData::ShutdownSingleThreadedCleanup(); |
592 #endif // NDEBUG | 588 #endif // NDEBUG |
593 | 589 |
594 return result_code; | 590 return result_code; |
595 } | 591 } |
OLD | NEW |