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

Side by Side Diff: third_party/libaddressinput/chromium/chrome_storage_impl.cc

Issue 1550693002: Global conversion of Pass()→std::move() on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "third_party/libaddressinput/chromium/chrome_storage_impl.h" 5 #include "third_party/libaddressinput/chromium/chrome_storage_impl.h"
6 6
7 #include <utility>
8
7 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
8 #include "base/prefs/writeable_pref_store.h" 10 #include "base/prefs/writeable_pref_store.h"
9 #include "base/values.h" 11 #include "base/values.h"
10 #include "third_party/libaddressinput/chromium/fallback_data_store.h" 12 #include "third_party/libaddressinput/chromium/fallback_data_store.h"
11 13
12 namespace autofill { 14 namespace autofill {
13 15
14 ChromeStorageImpl::ChromeStorageImpl(WriteablePrefStore* store) 16 ChromeStorageImpl::ChromeStorageImpl(WriteablePrefStore* store)
15 : backing_store_(store), 17 : backing_store_(store),
16 scoped_observer_(this) { 18 scoped_observer_(this) {
17 scoped_observer_.Add(backing_store_); 19 scoped_observer_.Add(backing_store_);
18 } 20 }
19 21
20 ChromeStorageImpl::~ChromeStorageImpl() {} 22 ChromeStorageImpl::~ChromeStorageImpl() {}
21 23
22 void ChromeStorageImpl::Put(const std::string& key, std::string* data) { 24 void ChromeStorageImpl::Put(const std::string& key, std::string* data) {
23 DCHECK(data); 25 DCHECK(data);
24 scoped_ptr<std::string> owned_data(data); 26 scoped_ptr<std::string> owned_data(data);
25 scoped_ptr<base::StringValue> string_value( 27 scoped_ptr<base::StringValue> string_value(
26 new base::StringValue(std::string())); 28 new base::StringValue(std::string()));
27 string_value->GetString()->swap(*owned_data); 29 string_value->GetString()->swap(*owned_data);
28 backing_store_->SetValue(key, string_value.Pass(), 30 backing_store_->SetValue(key, std::move(string_value),
29 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); 31 WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
30 } 32 }
31 33
32 void ChromeStorageImpl::Get(const std::string& key, 34 void ChromeStorageImpl::Get(const std::string& key,
33 const Storage::Callback& data_ready) const { 35 const Storage::Callback& data_ready) const {
34 // |Get()| should not be const, so this is just a thunk that fixes that. 36 // |Get()| should not be const, so this is just a thunk that fixes that.
35 const_cast<ChromeStorageImpl*>(this)->DoGet(key, data_ready); 37 const_cast<ChromeStorageImpl*>(this)->DoGet(key, data_ready);
36 } 38 }
37 39
38 void ChromeStorageImpl::OnPrefValueChanged(const std::string& key) {} 40 void ChromeStorageImpl::OnPrefValueChanged(const std::string& key) {}
(...skipping 24 matching lines...) Expand all
63 data_ready(false, key, NULL); 65 data_ready(false, key, NULL);
64 } 66 }
65 } 67 }
66 68
67 ChromeStorageImpl::Request::Request(const std::string& key, 69 ChromeStorageImpl::Request::Request(const std::string& key,
68 const Callback& callback) 70 const Callback& callback)
69 : key(key), 71 : key(key),
70 callback(callback) {} 72 callback(callback) {}
71 73
72 } // namespace autofill 74 } // namespace autofill
OLDNEW
« no previous file with comments | « third_party/libaddressinput/chromium/chrome_metadata_source.cc ('k') | third_party/libaddressinput/chromium/json.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698