| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |