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

Side by Side Diff: base/prefs/pref_service.cc

Issue 16092013: Use base::MessageLoop in more files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again, sigh Created 7 years, 6 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 | « base/message_loop_unittest.cc ('k') | base/threading/thread_unittest.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) 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 "base/prefs/pref_service.h" 5 #include "base/prefs/pref_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 pref_registry_ = NULL; 72 pref_registry_ = NULL;
73 user_pref_store_ = NULL; 73 user_pref_store_ = NULL;
74 pref_notifier_.reset(); 74 pref_notifier_.reset();
75 } 75 }
76 76
77 void PrefService::InitFromStorage(bool async) { 77 void PrefService::InitFromStorage(bool async) {
78 if (!async) { 78 if (!async) {
79 read_error_callback_.Run(user_pref_store_->ReadPrefs()); 79 read_error_callback_.Run(user_pref_store_->ReadPrefs());
80 } else { 80 } else {
81 // Guarantee that initialization happens after this function returned. 81 // Guarantee that initialization happens after this function returned.
82 MessageLoop::current()->PostTask( 82 base::MessageLoop::current()->PostTask(
83 FROM_HERE, 83 FROM_HERE,
84 base::Bind(&PersistentPrefStore::ReadPrefsAsync, 84 base::Bind(&PersistentPrefStore::ReadPrefsAsync,
85 user_pref_store_.get(), 85 user_pref_store_.get(),
86 new ReadErrorHandler(read_error_callback_))); 86 new ReadErrorHandler(read_error_callback_)));
87 } 87 }
88 } 88 }
89 89
90 bool PrefService::ReloadPersistentPrefs() { 90 bool PrefService::ReloadPersistentPrefs() {
91 return user_pref_store_->ReadPrefs() == 91 return user_pref_store_->ReadPrefs() ==
92 PersistentPrefStore::PREF_READ_ERROR_NONE; 92 PersistentPrefStore::PREF_READ_ERROR_NONE;
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 DCHECK(found_value->IsType(default_type)); 579 DCHECK(found_value->IsType(default_type));
580 return found_value; 580 return found_value;
581 } else { 581 } else {
582 // Every registered preference has at least a default value. 582 // Every registered preference has at least a default value.
583 NOTREACHED() << "no valid value found for registered pref " << path; 583 NOTREACHED() << "no valid value found for registered pref " << path;
584 } 584 }
585 } 585 }
586 586
587 return NULL; 587 return NULL;
588 } 588 }
OLDNEW
« no previous file with comments | « base/message_loop_unittest.cc ('k') | base/threading/thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698