OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/thread.h" | 9 #include "base/thread.h" |
| 10 #include "base/waitable_event.h" |
10 #include "chrome/browser/automation/automation_provider_list.h" | 11 #include "chrome/browser/automation/automation_provider_list.h" |
11 #include "chrome/browser/browser_trial.h" | 12 #include "chrome/browser/browser_trial.h" |
12 #include "chrome/browser/chrome_thread.h" | 13 #include "chrome/browser/chrome_thread.h" |
13 #include "chrome/browser/download/download_file.h" | 14 #include "chrome/browser/download/download_file.h" |
14 #include "chrome/browser/download/save_file_manager.h" | 15 #include "chrome/browser/download/save_file_manager.h" |
15 #include "chrome/browser/google_url_tracker.h" | 16 #include "chrome/browser/google_url_tracker.h" |
16 #include "chrome/browser/icon_manager.h" | 17 #include "chrome/browser/icon_manager.h" |
17 #include "chrome/browser/metrics_service.h" | 18 #include "chrome/browser/metrics_service.h" |
18 #include "chrome/browser/plugin_service.h" | 19 #include "chrome/browser/plugin_service.h" |
19 #include "chrome/browser/printing/print_job_manager.h" | 20 #include "chrome/browser/printing/print_job_manager.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 const double probability = 0.5; | 121 const double probability = 0.5; |
121 FieldTrial* trial(new FieldTrial(BrowserTrial::kMemoryModelFieldTrial, | 122 FieldTrial* trial(new FieldTrial(BrowserTrial::kMemoryModelFieldTrial, |
122 probability)); | 123 probability)); |
123 DCHECK(FieldTrialList::Find(BrowserTrial::kMemoryModelFieldTrial) == trial); | 124 DCHECK(FieldTrialList::Find(BrowserTrial::kMemoryModelFieldTrial) == trial); |
124 if (trial->boolean_value()) | 125 if (trial->boolean_value()) |
125 memory_model_ = HIGH_MEMORY_MODEL; | 126 memory_model_ = HIGH_MEMORY_MODEL; |
126 else | 127 else |
127 memory_model_ = MEDIUM_MEMORY_MODEL; | 128 memory_model_ = MEDIUM_MEMORY_MODEL; |
128 } | 129 } |
129 | 130 |
130 shutdown_event_ = ::CreateEvent(NULL, TRUE, FALSE, NULL); | 131 shutdown_event_ = new base::WaitableEvent(true, false); |
131 } | 132 } |
132 | 133 |
133 BrowserProcessImpl::~BrowserProcessImpl() { | 134 BrowserProcessImpl::~BrowserProcessImpl() { |
134 // Delete the AutomationProviderList before NotificationService, | 135 // Delete the AutomationProviderList before NotificationService, |
135 // since it may try to unregister notifications | 136 // since it may try to unregister notifications |
136 // Both NotificationService and AutomationProvider are singleton instances in | 137 // Both NotificationService and AutomationProvider are singleton instances in |
137 // the BrowserProcess. Since AutomationProvider may have some active | 138 // the BrowserProcess. Since AutomationProvider may have some active |
138 // notification observers, it is essential that it gets destroyed before the | 139 // notification observers, it is essential that it gets destroyed before the |
139 // NotificationService. NotificationService won't be destroyed until after | 140 // NotificationService. NotificationService won't be destroyed until after |
140 // this destructor is run. | 141 // this destructor is run. |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 new views::AcceleratorHandler); | 354 new views::AcceleratorHandler); |
354 accelerator_handler_.swap(accelerator_handler); | 355 accelerator_handler_.swap(accelerator_handler); |
355 } | 356 } |
356 | 357 |
357 void BrowserProcessImpl::CreateGoogleURLTracker() { | 358 void BrowserProcessImpl::CreateGoogleURLTracker() { |
358 DCHECK(google_url_tracker_.get() == NULL); | 359 DCHECK(google_url_tracker_.get() == NULL); |
359 scoped_ptr<GoogleURLTracker> google_url_tracker(new GoogleURLTracker); | 360 scoped_ptr<GoogleURLTracker> google_url_tracker(new GoogleURLTracker); |
360 google_url_tracker_.swap(google_url_tracker); | 361 google_url_tracker_.swap(google_url_tracker); |
361 } | 362 } |
362 | 363 |
OLD | NEW |