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

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

Issue 608583003: Roll dom_distiller_js and add UMA for word count for distilled pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments from isherman and rolled dom distiller 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 | « no previous file | third_party/dom_distiller_js/README.chromium » ('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 94c37ae5c7857a9f9d69a34e6f959ff0a1141e72..1e70b83a2a51906811a7b6a879bd5a3ffb51644f 100644
--- a/components/dom_distiller/core/distiller_page.cc
+++ b/components/dom_distiller/core/distiller_page.cc
@@ -84,35 +84,47 @@ void DistillerPage::OnDistillationDone(const GURL& page_url,
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()) {
- UMA_HISTOGRAM_TIMES(
- "DomDistiller.Time.MarkupParsing",
- base::TimeDelta::FromMillisecondsD(timing.markup_parsing_time()));
+ } else {
+ if (distiller_result->has_timing_info()) {
+ const dom_distiller::proto::TimingInfo& timing =
+ distiller_result->timing_info();
+ if (timing.has_markup_parsing_time()) {
+ UMA_HISTOGRAM_TIMES(
+ "DomDistiller.Time.MarkupParsing",
+ base::TimeDelta::FromMillisecondsD(timing.markup_parsing_time()));
+ }
+ if (timing.has_document_construction_time()) {
+ UMA_HISTOGRAM_TIMES(
+ "DomDistiller.Time.DocumentConstruction",
+ base::TimeDelta::FromMillisecondsD(
+ timing.document_construction_time()));
+ }
+ if (timing.has_article_processing_time()) {
+ UMA_HISTOGRAM_TIMES(
+ "DomDistiller.Time.ArticleProcessing",
+ base::TimeDelta::FromMillisecondsD(
+ timing.article_processing_time()));
+ }
+ if (timing.has_formatting_time()) {
+ UMA_HISTOGRAM_TIMES(
+ "DomDistiller.Time.Formatting",
+ base::TimeDelta::FromMillisecondsD(timing.formatting_time()));
+ }
+ if (timing.has_total_time()) {
+ UMA_HISTOGRAM_TIMES(
+ "DomDistiller.Time.DistillationTotal",
+ base::TimeDelta::FromMillisecondsD(timing.total_time()));
+ }
}
- if (timing.has_document_construction_time()) {
- UMA_HISTOGRAM_TIMES(
- "DomDistiller.Time.DocumentConstruction",
- base::TimeDelta::FromMillisecondsD(
- timing.document_construction_time()));
- }
- if (timing.has_article_processing_time()) {
- UMA_HISTOGRAM_TIMES(
- "DomDistiller.Time.ArticleProcessing",
- base::TimeDelta::FromMillisecondsD(
- timing.article_processing_time()));
- }
- if (timing.has_formatting_time()) {
- UMA_HISTOGRAM_TIMES(
- "DomDistiller.Time.Formatting",
- base::TimeDelta::FromMillisecondsD(timing.formatting_time()));
- }
- if (timing.has_total_time()) {
- UMA_HISTOGRAM_TIMES(
- "DomDistiller.Time.DistillationTotal",
- base::TimeDelta::FromMillisecondsD(timing.total_time()));
+ if (distiller_result->has_statistics_info()) {
+ const dom_distiller::proto::StatisticsInfo& statistics =
+ distiller_result->statistics_info();
+ if (statistics.has_word_count()) {
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "DomDistiller.Statistics.WordCount",
+ statistics.word_count(),
+ 1, 4000, 50);
+ }
}
}
}
« no previous file with comments | « no previous file | third_party/dom_distiller_js/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698