aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Vakulenko <avakulenko@google.com>2016-04-08 18:29:06 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-04-08 18:29:06 +0000
commit5294050be48f9650e95d5fc74af3962538e62503 (patch)
tree93e8b1d57efd3074ec4251c1c4cee3fb4d2c3d07
parent97245996ed02ef07a025795f201a69cec87c18af (diff)
parentd67ba4472671786dd45380515a4132bc57ce35e9 (diff)
downloadweaved-5294050be48f9650e95d5fc74af3962538e62503.tar.gz
weaved: Remove release/aquire semantic from scoped_ptr/unique_ptr am: 1333c63
am: d67ba44 * commit 'd67ba4472671786dd45380515a4132bc57ce35e9': weaved: Remove release/aquire semantic from scoped_ptr/unique_ptr Change-Id: I2f8a5984b28fc0cb71022edd60ddf22fb56153c8
-rw-r--r--common/binder_utils.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/common/binder_utils.cc b/common/binder_utils.cc
index 641019a..44f1c59 100644
--- a/common/binder_utils.cc
+++ b/common/binder_utils.cc
@@ -48,17 +48,14 @@ android::binder::Status ParseDictionary(
std::unique_ptr<base::DictionaryValue>* dict) {
int error = 0;
std::string message;
- std::unique_ptr<base::Value> value{
+ auto value =
base::JSONReader::ReadAndReturnError(ToString(json), base::JSON_PARSE_RFC,
- &error, &message)
- .release()};
- base::DictionaryValue* dict_value = nullptr;
- if (!value || !value->GetAsDictionary(&dict_value)) {
+ &error, &message);
+ *dict = base::DictionaryValue::From(std::move(value));
+ if (!*dict) {
return android::binder::Status::fromServiceSpecificError(
error, android::String8{message.c_str()});
}
- dict->reset(dict_value);
- value.release(); // |dict| now owns the object.
return android::binder::Status::ok();
}