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

Side by Side Diff: components/user_prefs/tracked/pref_hash_store_impl.cc

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/user_prefs/tracked/pref_hash_store_impl.h" 5 #include "components/user_prefs/tracked/pref_hash_store_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 const std::string& path, 264 const std::string& path,
265 const base::DictionaryValue* split_value) { 265 const base::DictionaryValue* split_value) {
266 contents_->RemoveEntry(path); 266 contents_->RemoveEntry(path);
267 267
268 if (split_value) { 268 if (split_value) {
269 std::unique_ptr<base::DictionaryValue> split_macs = 269 std::unique_ptr<base::DictionaryValue> split_macs =
270 outer_->ComputeSplitMacs(path, split_value); 270 outer_->ComputeSplitMacs(path, split_value);
271 271
272 for (base::DictionaryValue::Iterator it(*split_macs); !it.IsAtEnd(); 272 for (base::DictionaryValue::Iterator it(*split_macs); !it.IsAtEnd();
273 it.Advance()) { 273 it.Advance()) {
274 const base::StringValue* value_as_string; 274 const base::Value* value_as_string;
275 bool is_string = it.value().GetAsString(&value_as_string); 275 bool is_string = it.value().GetAsString(&value_as_string);
276 DCHECK(is_string); 276 DCHECK(is_string);
277 277
278 contents_->SetSplitMac(path, it.key(), value_as_string->GetString()); 278 contents_->SetSplitMac(path, it.key(), value_as_string->GetString());
279 } 279 }
280 } 280 }
281 super_mac_dirty_ = true; 281 super_mac_dirty_ = true;
282 } 282 }
283 283
284 bool PrefHashStoreImpl::PrefHashStoreTransactionImpl::HasHash( 284 bool PrefHashStoreImpl::PrefHashStoreTransactionImpl::HasHash(
(...skipping 25 matching lines...) Expand all
310 bool PrefHashStoreImpl::PrefHashStoreTransactionImpl::IsSuperMACValid() const { 310 bool PrefHashStoreImpl::PrefHashStoreTransactionImpl::IsSuperMACValid() const {
311 return super_mac_valid_; 311 return super_mac_valid_;
312 } 312 }
313 313
314 bool PrefHashStoreImpl::PrefHashStoreTransactionImpl::StampSuperMac() { 314 bool PrefHashStoreImpl::PrefHashStoreTransactionImpl::StampSuperMac() {
315 if (!outer_->use_super_mac_ || super_mac_valid_) 315 if (!outer_->use_super_mac_ || super_mac_valid_)
316 return false; 316 return false;
317 super_mac_dirty_ = true; 317 super_mac_dirty_ = true;
318 return true; 318 return true;
319 } 319 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698