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

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

Issue 10542151: Move the window destruction and registration out of cleanup and into BrowserProcessImpl::EndSession… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 6 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
« no previous file with comments | « chrome/browser/browser_process_impl.h ('k') | chrome/browser/chrome_browser_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "chrome/browser/net/sdch_dictionary_fetcher.h" 43 #include "chrome/browser/net/sdch_dictionary_fetcher.h"
44 #include "chrome/browser/notifications/notification_ui_manager.h" 44 #include "chrome/browser/notifications/notification_ui_manager.h"
45 #include "chrome/browser/policy/browser_policy_connector.h" 45 #include "chrome/browser/policy/browser_policy_connector.h"
46 #include "chrome/browser/policy/policy_service.h" 46 #include "chrome/browser/policy/policy_service.h"
47 #include "chrome/browser/prefs/browser_prefs.h" 47 #include "chrome/browser/prefs/browser_prefs.h"
48 #include "chrome/browser/prefs/pref_service.h" 48 #include "chrome/browser/prefs/pref_service.h"
49 #include "chrome/browser/prerender/prerender_tracker.h" 49 #include "chrome/browser/prerender/prerender_tracker.h"
50 #include "chrome/browser/printing/background_printing_manager.h" 50 #include "chrome/browser/printing/background_printing_manager.h"
51 #include "chrome/browser/printing/print_job_manager.h" 51 #include "chrome/browser/printing/print_job_manager.h"
52 #include "chrome/browser/printing/print_preview_tab_controller.h" 52 #include "chrome/browser/printing/print_preview_tab_controller.h"
53 #include "chrome/browser/process_singleton.h"
53 #include "chrome/browser/profiles/profile_manager.h" 54 #include "chrome/browser/profiles/profile_manager.h"
54 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h" 55 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h"
55 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 56 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
56 #include "chrome/browser/shell_integration.h" 57 #include "chrome/browser/shell_integration.h"
57 #include "chrome/browser/status_icons/status_tray.h" 58 #include "chrome/browser/status_icons/status_tray.h"
58 #include "chrome/browser/tab_closeable_state_watcher.h" 59 #include "chrome/browser/tab_closeable_state_watcher.h"
59 #include "chrome/browser/tab_contents/thumbnail_generator.h" 60 #include "chrome/browser/tab_contents/thumbnail_generator.h"
60 #include "chrome/browser/ui/browser_list.h" 61 #include "chrome/browser/ui/browser_list.h"
61 #include "chrome/common/chrome_constants.h" 62 #include "chrome/common/chrome_constants.h"
62 #include "chrome/common/chrome_content_client.h" 63 #include "chrome/common/chrome_content_client.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // Linux. We have a timeout here because we're unable to run the UI messageloop 120 // Linux. We have a timeout here because we're unable to run the UI messageloop
120 // and there's some deadlock risk. Our only option is to exit anyway. 121 // and there's some deadlock risk. Our only option is to exit anyway.
121 static const int kEndSessionTimeoutSeconds = 10; 122 static const int kEndSessionTimeoutSeconds = 10;
122 #endif 123 #endif
123 124
124 using content::BrowserThread; 125 using content::BrowserThread;
125 using content::ChildProcessSecurityPolicy; 126 using content::ChildProcessSecurityPolicy;
126 using content::PluginService; 127 using content::PluginService;
127 using content::ResourceDispatcherHost; 128 using content::ResourceDispatcherHost;
128 129
129 BrowserProcessImpl::BrowserProcessImpl(const CommandLine& command_line) 130 BrowserProcessImpl::BrowserProcessImpl(const CommandLine& command_line,
131 ProcessSingleton* process_singleton)
130 : created_metrics_service_(false), 132 : created_metrics_service_(false),
131 created_watchdog_thread_(false), 133 created_watchdog_thread_(false),
132 created_browser_policy_connector_(false), 134 created_browser_policy_connector_(false),
133 created_profile_manager_(false), 135 created_profile_manager_(false),
134 created_local_state_(false), 136 created_local_state_(false),
135 created_icon_manager_(false), 137 created_icon_manager_(false),
136 created_notification_ui_manager_(false), 138 created_notification_ui_manager_(false),
137 created_safe_browsing_service_(false), 139 created_safe_browsing_service_(false),
138 module_ref_count_(0), 140 module_ref_count_(0),
139 did_start_(false), 141 did_start_(false),
140 checked_for_new_frames_(false), 142 checked_for_new_frames_(false),
141 using_new_frames_(false), 143 using_new_frames_(false),
142 thumbnail_generator_(new ThumbnailGenerator), 144 thumbnail_generator_(new ThumbnailGenerator),
143 download_status_updater_(new DownloadStatusUpdater) { 145 download_status_updater_(new DownloadStatusUpdater),
146 process_singleton_(process_singleton) {
144 g_browser_process = this; 147 g_browser_process = this;
145 clipboard_.reset(new ui::Clipboard); 148 clipboard_.reset(new ui::Clipboard);
146 149
147 #if defined(ENABLE_PRINTING) 150 #if defined(ENABLE_PRINTING)
148 // Must be created after the NotificationService. 151 // Must be created after the NotificationService.
149 print_job_manager_.reset(new printing::PrintJobManager); 152 print_job_manager_.reset(new printing::PrintJobManager);
150 #endif 153 #endif
151 154
152 net_log_.reset(new ChromeNetLog); 155 net_log_.reset(new ChromeNetLog);
153 156
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 342 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
340 base::Bind(PostQuit, MessageLoop::current())); 343 base::Bind(PostQuit, MessageLoop::current()));
341 int quits_received = 0; 344 int quits_received = 0;
342 do { 345 do {
343 MessageLoop::current()->Run(); 346 MessageLoop::current()->Run();
344 ++quits_received; 347 ++quits_received;
345 } while (!g_end_session_file_thread_has_completed); 348 } while (!g_end_session_file_thread_has_completed);
346 // If we did get extra quits, then we should re-post them to the message loop. 349 // If we did get extra quits, then we should re-post them to the message loop.
347 while (--quits_received > 0) 350 while (--quits_received > 0)
348 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); 351 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
352
353 DCHECK(process_singleton_);
Jói 2012/06/14 10:32:49 This only checks that the pointer is not NULL (whi
rpetterson 2012/06/14 22:12:50 Done.
354 process_singleton_->UnregisterWindowClass();
Jói 2012/06/14 10:32:49 BrowserProcess::EndSession is only called when the
rpetterson 2012/06/14 22:12:50 Done.
349 #else 355 #else
350 NOTIMPLEMENTED(); 356 NOTIMPLEMENTED();
351 #endif 357 #endif
352 } 358 }
353 359
354 MetricsService* BrowserProcessImpl::metrics_service() { 360 MetricsService* BrowserProcessImpl::metrics_service() {
355 DCHECK(CalledOnValidThread()); 361 DCHECK(CalledOnValidThread());
356 if (!created_metrics_service_) 362 if (!created_metrics_service_)
357 CreateMetricsService(); 363 CreateMetricsService();
358 return metrics_service_.get(); 364 return metrics_service_.get();
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 } 940 }
935 941
936 void BrowserProcessImpl::OnAutoupdateTimer() { 942 void BrowserProcessImpl::OnAutoupdateTimer() {
937 if (CanAutorestartForUpdate()) { 943 if (CanAutorestartForUpdate()) {
938 DLOG(WARNING) << "Detected update. Restarting browser."; 944 DLOG(WARNING) << "Detected update. Restarting browser.";
939 RestartBackgroundInstance(); 945 RestartBackgroundInstance();
940 } 946 }
941 } 947 }
942 948
943 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 949 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_impl.h ('k') | chrome/browser/chrome_browser_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698