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

Side by Side Diff: extensions/browser/state_store.cc

Issue 1909773002: Convert //extensions/browser from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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 | « extensions/browser/state_store.h ('k') | extensions/browser/test_extension_registry_observer.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 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 "extensions/browser/state_store.h" 5 #include "extensions/browser/state_store.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 void StateStore::GetExtensionValue(const std::string& extension_id, 104 void StateStore::GetExtensionValue(const std::string& extension_id,
105 const std::string& key, 105 const std::string& key,
106 ReadCallback callback) { 106 ReadCallback callback) {
107 task_queue_->InvokeWhenReady( 107 task_queue_->InvokeWhenReady(
108 base::Bind(&ValueStoreFrontend::Get, base::Unretained(store_.get()), 108 base::Bind(&ValueStoreFrontend::Get, base::Unretained(store_.get()),
109 GetFullKey(extension_id, key), callback)); 109 GetFullKey(extension_id, key), callback));
110 } 110 }
111 111
112 void StateStore::SetExtensionValue(const std::string& extension_id, 112 void StateStore::SetExtensionValue(const std::string& extension_id,
113 const std::string& key, 113 const std::string& key,
114 scoped_ptr<base::Value> value) { 114 std::unique_ptr<base::Value> value) {
115 task_queue_->InvokeWhenReady( 115 task_queue_->InvokeWhenReady(
116 base::Bind(&ValueStoreFrontend::Set, base::Unretained(store_.get()), 116 base::Bind(&ValueStoreFrontend::Set, base::Unretained(store_.get()),
117 GetFullKey(extension_id, key), base::Passed(&value))); 117 GetFullKey(extension_id, key), base::Passed(&value)));
118 } 118 }
119 119
120 void StateStore::RemoveExtensionValue(const std::string& extension_id, 120 void StateStore::RemoveExtensionValue(const std::string& extension_id,
121 const std::string& key) { 121 const std::string& key) {
122 task_queue_->InvokeWhenReady(base::Bind(&ValueStoreFrontend::Remove, 122 task_queue_->InvokeWhenReady(base::Bind(&ValueStoreFrontend::Remove,
123 base::Unretained(store_.get()), 123 base::Unretained(store_.get()),
124 GetFullKey(extension_id, key))); 124 GetFullKey(extension_id, key)));
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 for (std::set<std::string>::iterator key = registered_keys_.begin(); 177 for (std::set<std::string>::iterator key = registered_keys_.begin();
178 key != registered_keys_.end(); 178 key != registered_keys_.end();
179 ++key) { 179 ++key) {
180 task_queue_->InvokeWhenReady(base::Bind(&ValueStoreFrontend::Remove, 180 task_queue_->InvokeWhenReady(base::Bind(&ValueStoreFrontend::Remove,
181 base::Unretained(store_.get()), 181 base::Unretained(store_.get()),
182 GetFullKey(extension_id, *key))); 182 GetFullKey(extension_id, *key)));
183 } 183 }
184 } 184 }
185 185
186 } // namespace extensions 186 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/state_store.h ('k') | extensions/browser/test_extension_registry_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698