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

Unified Diff: components/update_client/component_patcher.cc

Issue 2000803003: Use std::unique_ptr for base::DictionaryValue and base::ListValue's internal store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More fixes Created 4 years, 7 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 | « components/update_client/component_patcher.h ('k') | components/url_matcher/url_matcher_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/update_client/component_patcher.cc
diff --git a/components/update_client/component_patcher.cc b/components/update_client/component_patcher.cc
index 7ceedce98cd7c2346fb381246e547ee8c4b1a53a..b5b4ac3907f84c07ea6fcc969813e52c6de9da20 100644
--- a/components/update_client/component_patcher.cc
+++ b/components/update_client/component_patcher.cc
@@ -78,12 +78,11 @@ void ComponentPatcher::PatchNextFile() {
DonePatching(ComponentUnpacker::kNone, 0);
return;
}
- if (!(*next_command_)->IsType(base::Value::TYPE_DICTIONARY)) {
+ const base::DictionaryValue* command_args;
+ if (!(*next_command_)->GetAsDictionary(&command_args)) {
DonePatching(ComponentUnpacker::kDeltaBadCommands, 0);
return;
}
- const base::DictionaryValue* command_args =
- static_cast<base::DictionaryValue*>(*next_command_);
std::string operation;
if (command_args->GetString(kOp, &operation)) {
« no previous file with comments | « components/update_client/component_patcher.h ('k') | components/url_matcher/url_matcher_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698