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

Unified Diff: chrome/browser/value_store/value_store_frontend.cc

Issue 21030009: Make element removal methods in DictionaryValue and ListValue take scoped_ptr's as outparams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/value_store/testing_value_store.cc ('k') | chrome/common/extensions/api/extension_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/value_store/value_store_frontend.cc
diff --git a/chrome/browser/value_store/value_store_frontend.cc b/chrome/browser/value_store/value_store_frontend.cc
index e53e1d1e72573ed253e5099e20aab9e286c49169..3930d4520970f7e7d492f130f48617ef65179bbc 100644
--- a/chrome/browser/value_store/value_store_frontend.cc
+++ b/chrome/browser/value_store/value_store_frontend.cc
@@ -39,17 +39,17 @@ class ValueStoreFrontend::Backend : public base::RefCountedThreadSafe<Backend> {
// Extract the value from the ReadResult and pass ownership of it to the
// callback.
- base::Value* value = NULL;
- if (!result->HasError())
+ scoped_ptr<base::Value> value;
+ if (!result->HasError()) {
result->settings()->RemoveWithoutPathExpansion(key, &value);
- else
+ } else {
LOG(INFO) << "Reading " << key << " from " << db_path_.value()
- << " failed: " << result->error();
+ << " failed: " << result->error();
+ }
- scoped_ptr<base::Value> passed_value(value);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(&ValueStoreFrontend::Backend::RunCallback,
- this, callback, base::Passed(&passed_value)));
+ this, callback, base::Passed(&value)));
}
void Set(const std::string& key, scoped_ptr<base::Value> value) {
« no previous file with comments | « chrome/browser/value_store/testing_value_store.cc ('k') | chrome/common/extensions/api/extension_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698