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

Side by Side Diff: chrome/browser/browser_process_impl.cc

Issue 6598002: Make the ChromeNetworkDelegate use the ExtensionEventRouterForwarder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use profile id Created 9 years, 9 months 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "base/synchronization/waitable_event.h" 12 #include "base/synchronization/waitable_event.h"
13 #include "base/task.h" 13 #include "base/task.h"
14 #include "base/threading/thread.h" 14 #include "base/threading/thread.h"
15 #include "base/threading/thread_restrictions.h" 15 #include "base/threading/thread_restrictions.h"
16 #include "chrome/browser/automation/automation_provider_list.h" 16 #include "chrome/browser/automation/automation_provider_list.h"
17 #include "chrome/browser/browser_child_process_host.h" 17 #include "chrome/browser/browser_child_process_host.h"
18 #include "chrome/browser/browser_list.h" 18 #include "chrome/browser/browser_list.h"
19 #include "chrome/browser/browser_main.h" 19 #include "chrome/browser/browser_main.h"
20 #include "chrome/browser/browser_process_sub_thread.h" 20 #include "chrome/browser/browser_process_sub_thread.h"
21 #include "chrome/browser/browser_thread.h" 21 #include "chrome/browser/browser_thread.h"
22 #include "chrome/browser/browser_trial.h" 22 #include "chrome/browser/browser_trial.h"
23 #include "chrome/browser/debugger/browser_list_tabcontents_provider.h" 23 #include "chrome/browser/debugger/browser_list_tabcontents_provider.h"
24 #include "chrome/browser/debugger/devtools_http_protocol_handler.h" 24 #include "chrome/browser/debugger/devtools_http_protocol_handler.h"
25 #include "chrome/browser/debugger/devtools_manager.h" 25 #include "chrome/browser/debugger/devtools_manager.h"
26 #include "chrome/browser/debugger/devtools_protocol_handler.h" 26 #include "chrome/browser/debugger/devtools_protocol_handler.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/extensions/extension_event_router_forwarder.h"
29 #include "chrome/browser/first_run/first_run.h" 30 #include "chrome/browser/first_run/first_run.h"
30 #include "chrome/browser/google/google_url_tracker.h" 31 #include "chrome/browser/google/google_url_tracker.h"
31 #include "chrome/browser/icon_manager.h" 32 #include "chrome/browser/icon_manager.h"
32 #include "chrome/browser/intranet_redirect_detector.h" 33 #include "chrome/browser/intranet_redirect_detector.h"
33 #include "chrome/browser/io_thread.h" 34 #include "chrome/browser/io_thread.h"
34 #include "chrome/browser/metrics/metrics_service.h" 35 #include "chrome/browser/metrics/metrics_service.h"
35 #include "chrome/browser/net/chrome_net_log.h" 36 #include "chrome/browser/net/chrome_net_log.h"
36 #include "chrome/browser/net/predictor_api.h" 37 #include "chrome/browser/net/predictor_api.h"
37 #include "chrome/browser/net/sdch_dictionary_fetcher.h" 38 #include "chrome/browser/net/sdch_dictionary_fetcher.h"
38 #include "chrome/browser/notifications/notification_ui_manager.h" 39 #include "chrome/browser/notifications/notification_ui_manager.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 notification_registrar_.Add(this, 118 notification_registrar_.Add(this,
118 NotificationType::APP_TERMINATING, 119 NotificationType::APP_TERMINATING,
119 NotificationService::AllSources()); 120 NotificationService::AllSources());
120 121
121 // Must be created after the NotificationService. 122 // Must be created after the NotificationService.
122 print_job_manager_.reset(new printing::PrintJobManager); 123 print_job_manager_.reset(new printing::PrintJobManager);
123 124
124 shutdown_event_.reset(new base::WaitableEvent(true, false)); 125 shutdown_event_.reset(new base::WaitableEvent(true, false));
125 126
126 net_log_.reset(new ChromeNetLog); 127 net_log_.reset(new ChromeNetLog);
128
129 extension_event_router_forwarder_ = new ExtensionEventRouterForwarder;
127 } 130 }
128 131
129 BrowserProcessImpl::~BrowserProcessImpl() { 132 BrowserProcessImpl::~BrowserProcessImpl() {
130 FilePath profile_path; 133 FilePath profile_path;
131 bool clear_local_state_on_exit; 134 bool clear_local_state_on_exit;
132 135
133 // Store the profile path for clearing local state data on exit. 136 // Store the profile path for clearing local state data on exit.
134 clear_local_state_on_exit = ShouldClearLocalState(&profile_path); 137 clear_local_state_on_exit = ShouldClearLocalState(&profile_path);
135 138
136 // Delete the AutomationProviderList before NotificationService, 139 // Delete the AutomationProviderList before NotificationService,
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 if (!created_sidebar_manager_) 419 if (!created_sidebar_manager_)
417 CreateSidebarManager(); 420 CreateSidebarManager();
418 return sidebar_manager_.get(); 421 return sidebar_manager_.get();
419 } 422 }
420 423
421 ui::Clipboard* BrowserProcessImpl::clipboard() { 424 ui::Clipboard* BrowserProcessImpl::clipboard() {
422 DCHECK(CalledOnValidThread()); 425 DCHECK(CalledOnValidThread());
423 return clipboard_.get(); 426 return clipboard_.get();
424 } 427 }
425 428
429 ExtensionEventRouterForwarder*
430 BrowserProcessImpl::extension_event_router_forwarder() {
431 return extension_event_router_forwarder_.get();
432 }
433
426 NotificationUIManager* BrowserProcessImpl::notification_ui_manager() { 434 NotificationUIManager* BrowserProcessImpl::notification_ui_manager() {
427 DCHECK(CalledOnValidThread()); 435 DCHECK(CalledOnValidThread());
428 if (!created_notification_ui_manager_) 436 if (!created_notification_ui_manager_)
429 CreateNotificationUIManager(); 437 CreateNotificationUIManager();
430 return notification_ui_manager_.get(); 438 return notification_ui_manager_.get();
431 } 439 }
432 440
433 policy::BrowserPolicyConnector* BrowserProcessImpl::browser_policy_connector() { 441 policy::BrowserPolicyConnector* BrowserProcessImpl::browser_policy_connector() {
434 DCHECK(CalledOnValidThread()); 442 DCHECK(CalledOnValidThread());
435 if (!created_browser_policy_connector_) { 443 if (!created_browser_policy_connector_) {
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 #if defined(USE_X11) 660 #if defined(USE_X11)
653 // The lifetime of the BACKGROUND_X11 thread is a subset of the IO thread so 661 // The lifetime of the BACKGROUND_X11 thread is a subset of the IO thread so
654 // we start it now. 662 // we start it now.
655 scoped_ptr<base::Thread> background_x11_thread( 663 scoped_ptr<base::Thread> background_x11_thread(
656 new BrowserProcessSubThread(BrowserThread::BACKGROUND_X11)); 664 new BrowserProcessSubThread(BrowserThread::BACKGROUND_X11));
657 if (!background_x11_thread->Start()) 665 if (!background_x11_thread->Start())
658 return; 666 return;
659 background_x11_thread_.swap(background_x11_thread); 667 background_x11_thread_.swap(background_x11_thread);
660 #endif 668 #endif
661 669
662 scoped_ptr<IOThread> thread(new IOThread(local_state(), net_log_.get())); 670 scoped_ptr<IOThread> thread(new IOThread(
671 local_state(), net_log_.get(), extension_event_router_forwarder_.get()));
663 base::Thread::Options options; 672 base::Thread::Options options;
664 options.message_loop_type = MessageLoop::TYPE_IO; 673 options.message_loop_type = MessageLoop::TYPE_IO;
665 if (!thread->StartWithOptions(options)) 674 if (!thread->StartWithOptions(options))
666 return; 675 return;
667 io_thread_.swap(thread); 676 io_thread_.swap(thread);
668 } 677 }
669 678
670 void BrowserProcessImpl::CreateFileThread() { 679 void BrowserProcessImpl::CreateFileThread() {
671 DCHECK(!created_file_thread_ && file_thread_.get() == NULL); 680 DCHECK(!created_file_thread_ && file_thread_.get() == NULL);
672 created_file_thread_ = true; 681 created_file_thread_ = true;
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 } 954 }
946 955
947 void BrowserProcessImpl::OnAutoupdateTimer() { 956 void BrowserProcessImpl::OnAutoupdateTimer() {
948 if (CanAutorestartForUpdate()) { 957 if (CanAutorestartForUpdate()) {
949 DLOG(WARNING) << "Detected update. Restarting browser."; 958 DLOG(WARNING) << "Detected update. Restarting browser.";
950 RestartPersistentInstance(); 959 RestartPersistentInstance();
951 } 960 }
952 } 961 }
953 962
954 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 963 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698