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

Unified Diff: components/doodle/doodle_fetcher_impl.cc

Issue 2710003006: [Doodle] Introduce a DoodleService (Closed)
Patch Set: comment Created 3 years, 10 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/doodle/doodle_fetcher_impl.h ('k') | components/doodle/doodle_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/doodle/doodle_fetcher_impl.cc
diff --git a/components/doodle/doodle_fetcher_impl.cc b/components/doodle/doodle_fetcher_impl.cc
index 90fcddec28638f32caedd890b5ff6ae860176aa3..a618ec8e62897f1863eff3922d0816670bacd063 100644
--- a/components/doodle/doodle_fetcher_impl.cc
+++ b/components/doodle/doodle_fetcher_impl.cc
@@ -7,7 +7,6 @@
#include <utility>
#include "base/strings/string_number_conversions.h"
-#include "base/time/clock.h"
#include "base/time/default_clock.h"
#include "base/time/time.h"
#include "base/values.h"
@@ -130,14 +129,14 @@ void DoodleFetcherImpl::OnJsonParsed(std::unique_ptr<base::Value> json) {
std::unique_ptr<base::DictionaryValue> config =
base::DictionaryValue::From(std::move(json));
if (!config.get()) {
- DLOG(WARNING) << "Doodle JSON is not valid";
+ DLOG(WARNING) << "Doodle JSON is not valid.";
RespondToAllCallbacks(DoodleState::PARSING_ERROR, base::nullopt);
return;
}
const base::DictionaryValue* ddljson = nullptr;
if (!config->GetDictionary("ddljson", &ddljson)) {
- DLOG(WARNING) << "Doodle JSON reponse did not contain 'ddljson' key.";
+ DLOG(WARNING) << "Doodle JSON response did not contain 'ddljson' key.";
RespondToAllCallbacks(DoodleState::PARSING_ERROR, base::nullopt);
return;
}
@@ -159,6 +158,8 @@ void DoodleFetcherImpl::OnJsonParseFailed(const std::string& error_message) {
base::Optional<DoodleConfig> DoodleFetcherImpl::ParseDoodle(
const base::DictionaryValue& ddljson) const {
DoodleConfig doodle;
+ // The |large_image| field is required (it's the "default" representation for
+ // the doodle).
if (!ParseImage(ddljson, "large_image", &doodle.large_image)) {
return base::nullopt;
}
« no previous file with comments | « components/doodle/doodle_fetcher_impl.h ('k') | components/doodle/doodle_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698