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

Unified Diff: components/dom_distiller/core/distiller_page.cc

Issue 514423002: Roll dom_distiller_js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-intermediate-distilledpageinfo-structs
Patch Set: Moved BUILD.gn file Created 6 years, 3 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/dom_distiller/core/BUILD.gn ('k') | third_party/dom_distiller_js/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/core/distiller_page.cc
diff --git a/components/dom_distiller/core/distiller_page.cc b/components/dom_distiller/core/distiller_page.cc
index 9a002e445eed480d3448866e53167e42badd327c..55364cea526b22095c6326eecd6f7d85392ce1ca 100644
--- a/components/dom_distiller/core/distiller_page.cc
+++ b/components/dom_distiller/core/distiller_page.cc
@@ -73,16 +73,18 @@ void DistillerPage::OnDistillationDone(const GURL& page_url,
DCHECK(!ready_);
ready_ = true;
- scoped_ptr<dom_distiller::proto::DomDistillerResult> distiller_result;
-
+ scoped_ptr<dom_distiller::proto::DomDistillerResult> distiller_result(
+ new dom_distiller::proto::DomDistillerResult());
bool found_content;
if (value->IsType(base::Value::TYPE_NULL)) {
found_content = false;
} else {
- found_content = true;
- distiller_result.reset(new dom_distiller::proto::DomDistillerResult(
- dom_distiller::proto::json::DomDistillerResult::ReadFromValue(value)));
- if (distiller_result->has_timing_info()) {
+ found_content =
+ dom_distiller::proto::json::DomDistillerResult::ReadFromValue(
+ value, distiller_result.get());
+ if (!found_content) {
+ DVLOG(1) << "Unable to parse DomDistillerResult.";
+ } else if (distiller_result->has_timing_info()) {
const dom_distiller::proto::TimingInfo& timing =
distiller_result->timing_info();
if (timing.has_markup_parsing_time()) {
« no previous file with comments | « components/dom_distiller/core/BUILD.gn ('k') | third_party/dom_distiller_js/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698