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

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

Issue 2664004: Win: Fix race possible during startup before first Browser is created. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: remove no-longer true comment from process_singleton_win Created 10 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
« no previous file with comments | « chrome/browser/browser_process_impl.h ('k') | chrome/browser/process_singleton_win.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) 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 created_db_thread_(false), 79 created_db_thread_(false),
80 created_process_launcher_thread_(false), 80 created_process_launcher_thread_(false),
81 created_cache_thread_(false), 81 created_cache_thread_(false),
82 created_profile_manager_(false), 82 created_profile_manager_(false),
83 created_local_state_(false), 83 created_local_state_(false),
84 created_icon_manager_(false), 84 created_icon_manager_(false),
85 created_debugger_wrapper_(false), 85 created_debugger_wrapper_(false),
86 created_devtools_manager_(false), 86 created_devtools_manager_(false),
87 created_notification_ui_manager_(false), 87 created_notification_ui_manager_(false),
88 module_ref_count_(0), 88 module_ref_count_(0),
89 did_start_(false),
89 checked_for_new_frames_(false), 90 checked_for_new_frames_(false),
90 using_new_frames_(false), 91 using_new_frames_(false),
91 have_inspector_files_(true) { 92 have_inspector_files_(true) {
92 g_browser_process = this; 93 g_browser_process = this;
93 clipboard_.reset(new Clipboard); 94 clipboard_.reset(new Clipboard);
94 main_notification_service_.reset(new NotificationService); 95 main_notification_service_.reset(new NotificationService);
95 96
96 // Must be created after the NotificationService. 97 // Must be created after the NotificationService.
97 print_job_manager_.reset(new printing::PrintJobManager); 98 print_job_manager_.reset(new printing::PrintJobManager);
98 99
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 g_browser_process = NULL; 203 g_browser_process = NULL;
203 } 204 }
204 205
205 // Send a QuitTask to the given MessageLoop. 206 // Send a QuitTask to the given MessageLoop.
206 static void PostQuit(MessageLoop* message_loop) { 207 static void PostQuit(MessageLoop* message_loop) {
207 message_loop->PostTask(FROM_HERE, new MessageLoop::QuitTask()); 208 message_loop->PostTask(FROM_HERE, new MessageLoop::QuitTask());
208 } 209 }
209 210
210 unsigned int BrowserProcessImpl::AddRefModule() { 211 unsigned int BrowserProcessImpl::AddRefModule() {
211 DCHECK(CalledOnValidThread()); 212 DCHECK(CalledOnValidThread());
213 did_start_ = true;
212 module_ref_count_++; 214 module_ref_count_++;
213 return module_ref_count_; 215 return module_ref_count_;
214 } 216 }
215 217
216 unsigned int BrowserProcessImpl::ReleaseModule() { 218 unsigned int BrowserProcessImpl::ReleaseModule() {
217 DCHECK(CalledOnValidThread()); 219 DCHECK(CalledOnValidThread());
218 DCHECK_NE(0u, module_ref_count_); 220 DCHECK_NE(0u, module_ref_count_);
219 module_ref_count_--; 221 module_ref_count_--;
220 if (0 == module_ref_count_) { 222 if (0 == module_ref_count_) {
221 MessageLoop::current()->PostTask( 223 MessageLoop::current()->PostTask(
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 } 593 }
592 594
593 void BrowserProcessImpl::OnAutoupdateTimer() { 595 void BrowserProcessImpl::OnAutoupdateTimer() {
594 if (CanAutorestartForUpdate()) { 596 if (CanAutorestartForUpdate()) {
595 DLOG(WARNING) << "Detected update. Restarting browser."; 597 DLOG(WARNING) << "Detected update. Restarting browser.";
596 RestartPersistentInstance(); 598 RestartPersistentInstance();
597 } 599 }
598 } 600 }
599 601
600 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 602 #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/process_singleton_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698