OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "base/time.h" | 23 #include "base/time.h" |
24 #include "base/tracked_objects.h" | 24 #include "base/tracked_objects.h" |
25 #include "base/values.h" | 25 #include "base/values.h" |
26 #include "chrome/browser/browser_main_win.h" | 26 #include "chrome/browser/browser_main_win.h" |
27 #include "chrome/browser/browser_init.h" | 27 #include "chrome/browser/browser_init.h" |
28 #include "chrome/browser/browser_list.h" | 28 #include "chrome/browser/browser_list.h" |
29 #include "chrome/browser/browser_prefs.h" | 29 #include "chrome/browser/browser_prefs.h" |
30 #include "chrome/browser/browser_process.h" | 30 #include "chrome/browser/browser_process.h" |
31 #include "chrome/browser/browser_process_impl.h" | 31 #include "chrome/browser/browser_process_impl.h" |
32 #include "chrome/browser/browser_shutdown.h" | 32 #include "chrome/browser/browser_shutdown.h" |
| 33 #include "chrome/browser/chrome_thread.h" |
33 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 34 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
34 #include "chrome/browser/extensions/extension_protocols.h" | 35 #include "chrome/browser/extensions/extension_protocols.h" |
35 #include "chrome/browser/first_run.h" | 36 #include "chrome/browser/first_run.h" |
36 #include "chrome/browser/metrics/metrics_service.h" | 37 #include "chrome/browser/metrics/metrics_service.h" |
37 #include "chrome/browser/net/dns_global.h" | 38 #include "chrome/browser/net/dns_global.h" |
38 #include "chrome/browser/net/metadata_url_request.h" | 39 #include "chrome/browser/net/metadata_url_request.h" |
39 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 40 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
40 #include "chrome/browser/plugin_service.h" | 41 #include "chrome/browser/plugin_service.h" |
41 #include "chrome/browser/process_singleton.h" | 42 #include "chrome/browser/process_singleton.h" |
42 #include "chrome/browser/profile_manager.h" | 43 #include "chrome/browser/profile_manager.h" |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 FieldTrialList field_trial; | 316 FieldTrialList field_trial; |
316 | 317 |
317 std::wstring app_name = chrome::kBrowserAppName; | 318 std::wstring app_name = chrome::kBrowserAppName; |
318 std::string thread_name_string = WideToASCII(app_name + L"_BrowserMain"); | 319 std::string thread_name_string = WideToASCII(app_name + L"_BrowserMain"); |
319 | 320 |
320 const char* thread_name = thread_name_string.c_str(); | 321 const char* thread_name = thread_name_string.c_str(); |
321 PlatformThread::SetName(thread_name); | 322 PlatformThread::SetName(thread_name); |
322 main_message_loop.set_thread_name(thread_name); | 323 main_message_loop.set_thread_name(thread_name); |
323 bool already_running = Upgrade::IsBrowserAlreadyRunning(); | 324 bool already_running = Upgrade::IsBrowserAlreadyRunning(); |
324 | 325 |
| 326 // Register the main thread by instantiating it, but don't call any methods. |
| 327 ChromeThread main_thread; |
| 328 |
325 FilePath user_data_dir; | 329 FilePath user_data_dir; |
326 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); | 330 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); |
327 ProcessSingleton process_singleton(user_data_dir); | 331 ProcessSingleton process_singleton(user_data_dir); |
328 | 332 |
329 bool is_first_run = FirstRun::IsChromeFirstRun() || | 333 bool is_first_run = FirstRun::IsChromeFirstRun() || |
330 parsed_command_line.HasSwitch(switches::kFirstRun); | 334 parsed_command_line.HasSwitch(switches::kFirstRun); |
331 bool first_run_ui_bypass = false; | 335 bool first_run_ui_bypass = false; |
332 | 336 |
333 scoped_ptr<BrowserProcess> browser_process; | 337 scoped_ptr<BrowserProcess> browser_process; |
334 if (parsed_command_line.HasSwitch(switches::kImport)) { | 338 if (parsed_command_line.HasSwitch(switches::kImport)) { |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 if (metrics) | 807 if (metrics) |
804 metrics->Stop(); | 808 metrics->Stop(); |
805 | 809 |
806 // browser_shutdown takes care of deleting browser_process, so we need to | 810 // browser_shutdown takes care of deleting browser_process, so we need to |
807 // release it. | 811 // release it. |
808 browser_process.release(); | 812 browser_process.release(); |
809 browser_shutdown::Shutdown(); | 813 browser_shutdown::Shutdown(); |
810 | 814 |
811 return result_code; | 815 return result_code; |
812 } | 816 } |
OLD | NEW |