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

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

Issue 8198007: Remove PrefService::ScheduleSavePersistentPrefs and SavePersistentPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years, 12 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/bookmarks/bookmark_utils.cc ('k') | chrome/browser/browser_shutdown.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_process_impl.h" 5 #include "chrome/browser/browser_process_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 std::vector<Profile*> profiles(pm->GetLoadedProfiles()); 359 std::vector<Profile*> profiles(pm->GetLoadedProfiles());
360 for (size_t i = 0; i < profiles.size(); ++i) 360 for (size_t i = 0; i < profiles.size(); ++i)
361 profiles[i]->MarkAsCleanShutdown(); 361 profiles[i]->MarkAsCleanShutdown();
362 362
363 // Tell the metrics service it was cleanly shutdown. 363 // Tell the metrics service it was cleanly shutdown.
364 MetricsService* metrics = g_browser_process->metrics_service(); 364 MetricsService* metrics = g_browser_process->metrics_service();
365 if (metrics && local_state()) { 365 if (metrics && local_state()) {
366 metrics->RecordStartOfSessionEnd(); 366 metrics->RecordStartOfSessionEnd();
367 367
368 // MetricsService lazily writes to prefs, force it to write now. 368 // MetricsService lazily writes to prefs, force it to write now.
369 local_state()->SavePersistentPrefs(); 369 local_state()->CommitPendingWrite();
370 } 370 }
371 371
372 // We must write that the profile and metrics service shutdown cleanly, 372 // We must write that the profile and metrics service shutdown cleanly,
373 // otherwise on startup we'll think we crashed. So we block until done and 373 // otherwise on startup we'll think we crashed. So we block until done and
374 // then proceed with normal shutdown. 374 // then proceed with normal shutdown.
375 #if defined(USE_X11) 375 #if defined(USE_X11)
376 // Can't run a local loop on linux. Instead create a waitable event. 376 // Can't run a local loop on linux. Instead create a waitable event.
377 scoped_ptr<base::WaitableEvent> done_writing( 377 scoped_ptr<base::WaitableEvent> done_writing(
378 new base::WaitableEvent(false, false)); 378 new base::WaitableEvent(false, false));
379 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 379 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 } 990 }
991 991
992 void BrowserProcessImpl::OnAutoupdateTimer() { 992 void BrowserProcessImpl::OnAutoupdateTimer() {
993 if (CanAutorestartForUpdate()) { 993 if (CanAutorestartForUpdate()) {
994 DLOG(WARNING) << "Detected update. Restarting browser."; 994 DLOG(WARNING) << "Detected update. Restarting browser.";
995 RestartBackgroundInstance(); 995 RestartBackgroundInstance();
996 } 996 }
997 } 997 }
998 998
999 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 999 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_utils.cc ('k') | chrome/browser/browser_shutdown.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698