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

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

Issue 1180693002: Update from https://crrev.com/333737 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 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
« no previous file with comments | « base/prefs/pref_service.h ('k') | base/prefs/testing_pref_store.h » ('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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 base::Bind(&PersistentPrefStore::ReadPrefsAsync, user_pref_store_.get(), 99 base::Bind(&PersistentPrefStore::ReadPrefsAsync, user_pref_store_.get(),
100 new ReadErrorHandler(read_error_callback_))); 100 new ReadErrorHandler(read_error_callback_)));
101 } 101 }
102 } 102 }
103 103
104 void PrefService::CommitPendingWrite() { 104 void PrefService::CommitPendingWrite() {
105 DCHECK(CalledOnValidThread()); 105 DCHECK(CalledOnValidThread());
106 user_pref_store_->CommitPendingWrite(); 106 user_pref_store_->CommitPendingWrite();
107 } 107 }
108 108
109 void PrefService::SchedulePendingLossyWrites() {
110 DCHECK(CalledOnValidThread());
111 user_pref_store_->SchedulePendingLossyWrites();
112 }
113
109 bool PrefService::GetBoolean(const std::string& path) const { 114 bool PrefService::GetBoolean(const std::string& path) const {
110 DCHECK(CalledOnValidThread()); 115 DCHECK(CalledOnValidThread());
111 116
112 bool result = false; 117 bool result = false;
113 118
114 const base::Value* value = GetPreferenceValue(path); 119 const base::Value* value = GetPreferenceValue(path);
115 if (!value) { 120 if (!value) {
116 NOTREACHED() << "Trying to read an unregistered pref: " << path; 121 NOTREACHED() << "Trying to read an unregistered pref: " << path;
117 return result; 122 return result;
118 } 123 }
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 DCHECK(found_value->IsType(default_type)); 605 DCHECK(found_value->IsType(default_type));
601 return found_value; 606 return found_value;
602 } else { 607 } else {
603 // Every registered preference has at least a default value. 608 // Every registered preference has at least a default value.
604 NOTREACHED() << "no valid value found for registered pref " << path; 609 NOTREACHED() << "no valid value found for registered pref " << path;
605 } 610 }
606 } 611 }
607 612
608 return NULL; 613 return NULL;
609 } 614 }
OLDNEW
« no previous file with comments | « base/prefs/pref_service.h ('k') | base/prefs/testing_pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698