OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/browser_process_impl.h" | 5 #include "chrome/browser/browser_process_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "app/clipboard/clipboard.h" | 9 #include "app/clipboard/clipboard.h" |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "chrome/browser/debugger/debugger_wrapper.h" | 25 #include "chrome/browser/debugger/debugger_wrapper.h" |
26 #include "chrome/browser/debugger/devtools_manager.h" | 26 #include "chrome/browser/debugger/devtools_manager.h" |
27 #include "chrome/browser/download/download_file_manager.h" | 27 #include "chrome/browser/download/download_file_manager.h" |
28 #include "chrome/browser/download/save_file_manager.h" | 28 #include "chrome/browser/download/save_file_manager.h" |
29 #include "chrome/browser/first_run/first_run.h" | 29 #include "chrome/browser/first_run/first_run.h" |
30 #include "chrome/browser/google/google_url_tracker.h" | 30 #include "chrome/browser/google/google_url_tracker.h" |
31 #include "chrome/browser/icon_manager.h" | 31 #include "chrome/browser/icon_manager.h" |
32 #include "chrome/browser/intranet_redirect_detector.h" | 32 #include "chrome/browser/intranet_redirect_detector.h" |
33 #include "chrome/browser/io_thread.h" | 33 #include "chrome/browser/io_thread.h" |
34 #include "chrome/browser/metrics/metrics_service.h" | 34 #include "chrome/browser/metrics/metrics_service.h" |
| 35 #include "chrome/browser/net/chrome_net_log.h" |
35 #include "chrome/browser/net/predictor_api.h" | 36 #include "chrome/browser/net/predictor_api.h" |
36 #include "chrome/browser/net/sdch_dictionary_fetcher.h" | 37 #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
37 #include "chrome/browser/net/sqlite_persistent_cookie_store.h" | 38 #include "chrome/browser/net/sqlite_persistent_cookie_store.h" |
38 #include "chrome/browser/notifications/notification_ui_manager.h" | 39 #include "chrome/browser/notifications/notification_ui_manager.h" |
39 #include "chrome/browser/plugin_service.h" | 40 #include "chrome/browser/plugin_service.h" |
40 #include "chrome/browser/plugin_updater.h" | 41 #include "chrome/browser/plugin_updater.h" |
41 #include "chrome/browser/prefs/pref_service.h" | 42 #include "chrome/browser/prefs/pref_service.h" |
42 #include "chrome/browser/printing/print_job_manager.h" | 43 #include "chrome/browser/printing/print_job_manager.h" |
43 #include "chrome/browser/printing/print_preview_tab_controller.h" | 44 #include "chrome/browser/printing/print_preview_tab_controller.h" |
44 #include "chrome/browser/profile_manager.h" | 45 #include "chrome/browser/profile_manager.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 using_new_frames_(false), | 105 using_new_frames_(false), |
105 have_inspector_files_(true) { | 106 have_inspector_files_(true) { |
106 g_browser_process = this; | 107 g_browser_process = this; |
107 clipboard_.reset(new Clipboard); | 108 clipboard_.reset(new Clipboard); |
108 main_notification_service_.reset(new NotificationService); | 109 main_notification_service_.reset(new NotificationService); |
109 | 110 |
110 // Must be created after the NotificationService. | 111 // Must be created after the NotificationService. |
111 print_job_manager_.reset(new printing::PrintJobManager); | 112 print_job_manager_.reset(new printing::PrintJobManager); |
112 | 113 |
113 shutdown_event_.reset(new base::WaitableEvent(true, false)); | 114 shutdown_event_.reset(new base::WaitableEvent(true, false)); |
| 115 |
| 116 net_log_.reset(new ChromeNetLog); |
114 } | 117 } |
115 | 118 |
116 BrowserProcessImpl::~BrowserProcessImpl() { | 119 BrowserProcessImpl::~BrowserProcessImpl() { |
117 FilePath profile_path; | 120 FilePath profile_path; |
118 bool clear_local_state_on_exit; | 121 bool clear_local_state_on_exit; |
119 | 122 |
120 // Store the profile path for clearing local state data on exit. | 123 // Store the profile path for clearing local state data on exit. |
121 clear_local_state_on_exit = ShouldClearLocalState(&profile_path); | 124 clear_local_state_on_exit = ShouldClearLocalState(&profile_path); |
122 | 125 |
123 // Delete the AutomationProviderList before NotificationService, | 126 // Delete the AutomationProviderList before NotificationService, |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 #if defined(USE_X11) | 558 #if defined(USE_X11) |
556 // The lifetime of the BACKGROUND_X11 thread is a subset of the IO thread so | 559 // The lifetime of the BACKGROUND_X11 thread is a subset of the IO thread so |
557 // we start it now. | 560 // we start it now. |
558 scoped_ptr<base::Thread> background_x11_thread( | 561 scoped_ptr<base::Thread> background_x11_thread( |
559 new BrowserProcessSubThread(BrowserThread::BACKGROUND_X11)); | 562 new BrowserProcessSubThread(BrowserThread::BACKGROUND_X11)); |
560 if (!background_x11_thread->Start()) | 563 if (!background_x11_thread->Start()) |
561 return; | 564 return; |
562 background_x11_thread_.swap(background_x11_thread); | 565 background_x11_thread_.swap(background_x11_thread); |
563 #endif | 566 #endif |
564 | 567 |
565 scoped_ptr<IOThread> thread(new IOThread(local_state())); | 568 scoped_ptr<IOThread> thread(new IOThread(local_state(), net_log_.get())); |
566 base::Thread::Options options; | 569 base::Thread::Options options; |
567 options.message_loop_type = MessageLoop::TYPE_IO; | 570 options.message_loop_type = MessageLoop::TYPE_IO; |
568 if (!thread->StartWithOptions(options)) | 571 if (!thread->StartWithOptions(options)) |
569 return; | 572 return; |
570 io_thread_.swap(thread); | 573 io_thread_.swap(thread); |
571 } | 574 } |
572 | 575 |
573 void BrowserProcessImpl::CreateFileThread() { | 576 void BrowserProcessImpl::CreateFileThread() { |
574 DCHECK(!created_file_thread_ && file_thread_.get() == NULL); | 577 DCHECK(!created_file_thread_ && file_thread_.get() == NULL); |
575 created_file_thread_ = true; | 578 created_file_thread_ = true; |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 } | 819 } |
817 | 820 |
818 void BrowserProcessImpl::OnAutoupdateTimer() { | 821 void BrowserProcessImpl::OnAutoupdateTimer() { |
819 if (CanAutorestartForUpdate()) { | 822 if (CanAutorestartForUpdate()) { |
820 DLOG(WARNING) << "Detected update. Restarting browser."; | 823 DLOG(WARNING) << "Detected update. Restarting browser."; |
821 RestartPersistentInstance(); | 824 RestartPersistentInstance(); |
822 } | 825 } |
823 } | 826 } |
824 | 827 |
825 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 828 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |