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

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

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments. Created 7 years, 10 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
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_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/bind.h" 10 #include "base/bind.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/file_path.h" 12 #include "base/file_path.h"
13 #include "base/file_util.h" 13 #include "base/file_util.h"
14 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
15 #include "base/path_service.h" 15 #include "base/path_service.h"
16 #include "base/process_util.h" 16 #include "base/process_util.h"
17 #include "base/string_number_conversions.h" 17 #include "base/string_number_conversions.h"
18 #include "base/stringprintf.h" 18 #include "base/stringprintf.h"
19 #include "base/threading/thread.h" 19 #include "base/threading/thread.h"
20 #include "base/threading/thread_restrictions.h" 20 #include "base/threading/thread_restrictions.h"
21 #include "base/time.h" 21 #include "base/time.h"
22 #include "build/build_config.h" 22 #include "build/build_config.h"
23 #include "chrome/browser/about_flags.h" 23 #include "chrome/browser/about_flags.h"
24 #include "chrome/browser/browser_process.h" 24 #include "chrome/browser/browser_process.h"
25 #include "chrome/browser/first_run/upgrade_util.h" 25 #include "chrome/browser/first_run/upgrade_util.h"
26 #include "chrome/browser/jankometer.h" 26 #include "chrome/browser/jankometer.h"
27 #include "chrome/browser/lifetime/application_lifetime.h" 27 #include "chrome/browser/lifetime/application_lifetime.h"
28 #include "chrome/browser/metrics/metrics_service.h" 28 #include "chrome/browser/metrics/metrics_service.h"
29 #include "chrome/browser/prefs/pref_registry_simple.h"
29 #include "chrome/browser/prefs/pref_service.h" 30 #include "chrome/browser/prefs/pref_service.h"
30 #include "chrome/browser/profiles/profile_manager.h" 31 #include "chrome/browser/profiles/profile_manager.h"
31 #include "chrome/browser/service/service_process_control.h" 32 #include "chrome/browser/service/service_process_control.h"
32 #include "chrome/common/chrome_paths.h" 33 #include "chrome/common/chrome_paths.h"
33 #include "chrome/common/chrome_switches.h" 34 #include "chrome/common/chrome_switches.h"
34 #include "chrome/common/pref_names.h" 35 #include "chrome/common/pref_names.h"
35 #include "chrome/common/switch_utils.h" 36 #include "chrome/common/switch_utils.h"
36 #include "content/public/browser/browser_thread.h" 37 #include "content/public/browser/browser_thread.h"
37 #include "content/public/browser/render_process_host.h" 38 #include "content/public/browser/render_process_host.h"
38 #include "content/public/browser/render_view_host.h" 39 #include "content/public/browser/render_view_host.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 bool g_mode_switch = false; 71 bool g_mode_switch = false;
71 #endif 72 #endif
72 73
73 Time* shutdown_started_ = NULL; 74 Time* shutdown_started_ = NULL;
74 ShutdownType shutdown_type_ = NOT_VALID; 75 ShutdownType shutdown_type_ = NOT_VALID;
75 int shutdown_num_processes_; 76 int shutdown_num_processes_;
76 int shutdown_num_processes_slow_; 77 int shutdown_num_processes_slow_;
77 78
78 const char kShutdownMsFile[] = "chrome_shutdown_ms.txt"; 79 const char kShutdownMsFile[] = "chrome_shutdown_ms.txt";
79 80
80 void RegisterPrefs(PrefServiceSimple* local_state) { 81 void RegisterPrefs(PrefRegistrySimple* local_state) {
Mattias Nissler (ping if slow) 2013/01/31 13:06:25 I could nit here (and elsewhere) that the paramete
Jói 2013/01/31 13:43:42 I was thinking I might leave it, but nicer to do i
81 local_state->RegisterIntegerPref(prefs::kShutdownType, NOT_VALID); 82 local_state->RegisterIntegerPref(prefs::kShutdownType, NOT_VALID);
82 local_state->RegisterIntegerPref(prefs::kShutdownNumProcesses, 0); 83 local_state->RegisterIntegerPref(prefs::kShutdownNumProcesses, 0);
83 local_state->RegisterIntegerPref(prefs::kShutdownNumProcessesSlow, 0); 84 local_state->RegisterIntegerPref(prefs::kShutdownNumProcessesSlow, 0);
84 } 85 }
85 86
86 ShutdownType GetShutdownType() { 87 ShutdownType GetShutdownType() {
87 return shutdown_type_; 88 return shutdown_type_;
88 } 89 }
89 90
90 void OnShutdownStarting(ShutdownType type) { 91 void OnShutdownStarting(ShutdownType type) {
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 329
329 bool ShuttingDownWithoutClosingBrowsers() { 330 bool ShuttingDownWithoutClosingBrowsers() {
330 return g_shutting_down_without_closing_browsers; 331 return g_shutting_down_without_closing_browsers;
331 } 332 }
332 333
333 void SetShuttingDownWithoutClosingBrowsers(bool without_close) { 334 void SetShuttingDownWithoutClosingBrowsers(bool without_close) {
334 g_shutting_down_without_closing_browsers = without_close; 335 g_shutting_down_without_closing_browsers = without_close;
335 } 336 }
336 337
337 } // namespace browser_shutdown 338 } // namespace browser_shutdown
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698