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 "chrome/browser/automation/automation_provider_list.h" | 10 #include "chrome/browser/automation/automation_provider_list.h" |
11 #include "chrome/browser/browser_trial.h" | 11 #include "chrome/browser/browser_trial.h" |
12 #include "chrome/browser/chrome_thread.h" | 12 #include "chrome/browser/chrome_thread.h" |
13 #include "chrome/browser/download/download_file.h" | 13 #include "chrome/browser/download/download_file.h" |
14 #include "chrome/browser/download/save_file_manager.h" | 14 #include "chrome/browser/download/save_file_manager.h" |
15 #include "chrome/browser/google_url_tracker.h" | 15 #include "chrome/browser/google_url_tracker.h" |
16 #include "chrome/browser/icon_manager.h" | 16 #include "chrome/browser/icon_manager.h" |
17 #include "chrome/browser/metrics_service.h" | 17 #include "chrome/browser/metrics_service.h" |
18 #include "chrome/browser/plugin_service.h" | 18 #include "chrome/browser/plugin_service.h" |
19 #include "chrome/browser/printing/print_job_manager.h" | 19 #include "chrome/browser/printing/print_job_manager.h" |
20 #include "chrome/browser/profile_manager.h" | 20 #include "chrome/browser/profile_manager.h" |
21 #include "chrome/browser/render_process_host.h" | 21 #include "chrome/browser/render_process_host.h" |
22 #include "chrome/browser/resource_dispatcher_host.h" | 22 #include "chrome/browser/resource_dispatcher_host.h" |
23 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 23 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
24 #include "chrome/browser/debugger/debugger_wrapper.h" | 24 #include "chrome/browser/debugger/debugger_wrapper.h" |
25 #include "chrome/browser/suspend_controller.h" | |
26 #include "chrome/common/chrome_paths.h" | 25 #include "chrome/common/chrome_paths.h" |
27 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
28 #include "chrome/common/clipboard_service.h" | 27 #include "chrome/common/clipboard_service.h" |
29 #include "chrome/common/l10n_util.h" | 28 #include "chrome/common/l10n_util.h" |
30 #include "chrome/common/notification_service.h" | 29 #include "chrome/common/notification_service.h" |
31 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
32 #include "chrome/common/pref_service.h" | 31 #include "chrome/common/pref_service.h" |
33 #include "chrome/views/accelerator_handler.h" | 32 #include "chrome/views/accelerator_handler.h" |
34 #include "chrome/views/view_storage.h" | 33 #include "chrome/views/view_storage.h" |
35 | 34 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 const double probability = 0.5; | 120 const double probability = 0.5; |
122 FieldTrial* trial(new FieldTrial(BrowserTrial::kMemoryModelFieldTrial, | 121 FieldTrial* trial(new FieldTrial(BrowserTrial::kMemoryModelFieldTrial, |
123 probability)); | 122 probability)); |
124 DCHECK(FieldTrialList::Find(BrowserTrial::kMemoryModelFieldTrial) == trial); | 123 DCHECK(FieldTrialList::Find(BrowserTrial::kMemoryModelFieldTrial) == trial); |
125 if (trial->boolean_value()) | 124 if (trial->boolean_value()) |
126 memory_model_ = HIGH_MEMORY_MODEL; | 125 memory_model_ = HIGH_MEMORY_MODEL; |
127 else | 126 else |
128 memory_model_ = MEDIUM_MEMORY_MODEL; | 127 memory_model_ = MEDIUM_MEMORY_MODEL; |
129 } | 128 } |
130 | 129 |
131 suspend_controller_ = new SuspendController(); | |
132 | |
133 shutdown_event_ = ::CreateEvent(NULL, TRUE, FALSE, NULL); | 130 shutdown_event_ = ::CreateEvent(NULL, TRUE, FALSE, NULL); |
134 } | 131 } |
135 | 132 |
136 BrowserProcessImpl::~BrowserProcessImpl() { | 133 BrowserProcessImpl::~BrowserProcessImpl() { |
137 // Delete the AutomationProviderList before NotificationService, | 134 // Delete the AutomationProviderList before NotificationService, |
138 // since it may try to unregister notifications | 135 // since it may try to unregister notifications |
139 // Both NotificationService and AutomationProvider are singleton instances in | 136 // Both NotificationService and AutomationProvider are singleton instances in |
140 // the BrowserProcess. Since AutomationProvider may have some active | 137 // the BrowserProcess. Since AutomationProvider may have some active |
141 // notification observers, it is essential that it gets destroyed before the | 138 // notification observers, it is essential that it gets destroyed before the |
142 // NotificationService. NotificationService won't be destroyed until after | 139 // NotificationService. NotificationService won't be destroyed until after |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 new views::AcceleratorHandler); | 353 new views::AcceleratorHandler); |
357 accelerator_handler_.swap(accelerator_handler); | 354 accelerator_handler_.swap(accelerator_handler); |
358 } | 355 } |
359 | 356 |
360 void BrowserProcessImpl::CreateGoogleURLTracker() { | 357 void BrowserProcessImpl::CreateGoogleURLTracker() { |
361 DCHECK(google_url_tracker_.get() == NULL); | 358 DCHECK(google_url_tracker_.get() == NULL); |
362 scoped_ptr<GoogleURLTracker> google_url_tracker(new GoogleURLTracker); | 359 scoped_ptr<GoogleURLTracker> google_url_tracker(new GoogleURLTracker); |
363 google_url_tracker_.swap(google_url_tracker); | 360 google_url_tracker_.swap(google_url_tracker); |
364 } | 361 } |
365 | 362 |
OLD | NEW |