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

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

Issue 7685009: Revert "Modifying prefetch to account for multi-profile." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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.cc ('k') | chrome/browser/browsing_data_remover.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) 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_shutdown.h" 5 #include "chrome/browser/browser_shutdown.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 20 matching lines...) Expand all
31 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" 31 #include "chrome/browser/ui/webui/chrome_url_data_manager.h"
32 #include "chrome/common/chrome_paths.h" 32 #include "chrome/common/chrome_paths.h"
33 #include "chrome/common/chrome_switches.h" 33 #include "chrome/common/chrome_switches.h"
34 #include "chrome/common/pref_names.h" 34 #include "chrome/common/pref_names.h"
35 #include "chrome/common/switch_utils.h" 35 #include "chrome/common/switch_utils.h"
36 #include "content/browser/browser_thread.h" 36 #include "content/browser/browser_thread.h"
37 #include "content/browser/plugin_process_host.h" 37 #include "content/browser/plugin_process_host.h"
38 #include "content/browser/renderer_host/render_process_host.h" 38 #include "content/browser/renderer_host/render_process_host.h"
39 #include "content/browser/renderer_host/render_view_host.h" 39 #include "content/browser/renderer_host/render_view_host.h"
40 #include "content/browser/renderer_host/render_widget_host.h" 40 #include "content/browser/renderer_host/render_widget_host.h"
41 #include "net/predictor_api.h"
41 #include "ui/base/resource/resource_bundle.h" 42 #include "ui/base/resource/resource_bundle.h"
42 43
43 #if defined(OS_WIN) 44 #if defined(OS_WIN)
44 #include "chrome/browser/browser_util_win.h" 45 #include "chrome/browser/browser_util_win.h"
45 #include "chrome/browser/first_run/upgrade_util_win.h" 46 #include "chrome/browser/first_run/upgrade_util_win.h"
46 #include "chrome/browser/rlz/rlz.h" 47 #include "chrome/browser/rlz/rlz.h"
47 #endif 48 #endif
48 49
49 #if defined(OS_CHROMEOS) 50 #if defined(OS_CHROMEOS)
50 #include "chrome/browser/chromeos/boot_times_loader.h" 51 #include "chrome/browser/chromeos/boot_times_loader.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 133
133 // The XInput2 event listener needs to be shut down earlier than when 134 // The XInput2 event listener needs to be shut down earlier than when
134 // Singletons are finally destroyed in AtExitManager. 135 // Singletons are finally destroyed in AtExitManager.
135 chromeos::XInputHierarchyChangedEventListener::GetInstance()->Stop(); 136 chromeos::XInputHierarchyChangedEventListener::GetInstance()->Stop();
136 #endif 137 #endif
137 138
138 // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough 139 // WARNING: During logoff/shutdown (WM_ENDSESSION) we may not have enough
139 // time to get here. If you have something that *must* happen on end session, 140 // time to get here. If you have something that *must* happen on end session,
140 // consider putting it in BrowserProcessImpl::EndSession. 141 // consider putting it in BrowserProcessImpl::EndSession.
141 PrefService* prefs = g_browser_process->local_state(); 142 PrefService* prefs = g_browser_process->local_state();
143 ProfileManager* profile_manager = g_browser_process->profile_manager();
144 PrefService* user_prefs = profile_manager->GetDefaultProfile()->GetPrefs();
145
146 chrome_browser_net::SavePredictorStateForNextStartupAndTrim(user_prefs);
142 147
143 MetricsService* metrics = g_browser_process->metrics_service(); 148 MetricsService* metrics = g_browser_process->metrics_service();
144 if (metrics) 149 if (metrics)
145 metrics->RecordCompletedSessionEnd(); 150 metrics->RecordCompletedSessionEnd();
146 151
147 if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) { 152 if (shutdown_type_ > NOT_VALID && shutdown_num_processes_ > 0) {
148 // Record the shutdown info so that we can put it into a histogram at next 153 // Record the shutdown info so that we can put it into a histogram at next
149 // startup. 154 // startup.
150 prefs->SetInteger(prefs::kShutdownType, shutdown_type_); 155 prefs->SetInteger(prefs::kShutdownType, shutdown_type_);
151 prefs->SetInteger(prefs::kShutdownNumProcesses, shutdown_num_processes_); 156 prefs->SetInteger(prefs::kShutdownNumProcesses, shutdown_num_processes_);
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 323
319 bool ShuttingDownWithoutClosingBrowsers() { 324 bool ShuttingDownWithoutClosingBrowsers() {
320 #if defined(USE_X11) 325 #if defined(USE_X11)
321 if (GetShutdownType() == browser_shutdown::END_SESSION) 326 if (GetShutdownType() == browser_shutdown::END_SESSION)
322 return true; 327 return true;
323 #endif 328 #endif
324 return false; 329 return false;
325 } 330 }
326 331
327 } // namespace browser_shutdown 332 } // namespace browser_shutdown
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/browsing_data_remover.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698