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

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

Issue 717643003: Extract timing info from distiller result (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dd-roll-perf
Patch Set: Created 6 years, 1 month 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 | components/dom_distiller/core/distiller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/core/distiller.cc
diff --git a/components/dom_distiller/core/distiller.cc b/components/dom_distiller/core/distiller.cc
index 63698db102df853ca773a4c107b123562573af6f..f23d11110b4530099a42f3a74135da3bca047294 100644
--- a/components/dom_distiller/core/distiller.cc
+++ b/components/dom_distiller/core/distiller.cc
@@ -157,6 +157,52 @@ void DistillerImpl::OnPageDistillationFinished(
page_data->distilled_page_proto->data.set_html(
distiller_result->distilled_content().html());
}
+
+ if (distiller_result->has_timing_info()) {
+ const proto::TimingInfo& distiller_timing_info =
+ distiller_result->timing_info();
+ DistilledPageProto::TimingInfo timing_info;
+ if (distiller_timing_info.has_markup_parsing_time()) {
+ timing_info.set_name("markup_parsing");
+ timing_info.set_time(distiller_timing_info.markup_parsing_time());
+ *page_data->distilled_page_proto->data.add_timing_info() = timing_info;
+ }
+
+ if (distiller_timing_info.has_document_construction_time()) {
+ timing_info.set_name("document_construction");
+ timing_info.set_time(
+ distiller_timing_info.document_construction_time());
+ *page_data->distilled_page_proto->data.add_timing_info() = timing_info;
+ }
+
+ if (distiller_timing_info.has_article_processing_time()) {
+ timing_info.set_name("article_processing");
+ timing_info.set_time(
+ distiller_timing_info.article_processing_time());
+ *page_data->distilled_page_proto->data.add_timing_info() = timing_info;
+ }
+
+ if (distiller_timing_info.has_formatting_time()) {
+ timing_info.set_name("formatting");
+ timing_info.set_time(
+ distiller_timing_info.formatting_time());
+ *page_data->distilled_page_proto->data.add_timing_info() = timing_info;
+ }
+
+ if (distiller_timing_info.has_total_time()) {
+ timing_info.set_name("total");
+ timing_info.set_time(
+ distiller_timing_info.total_time());
+ *page_data->distilled_page_proto->data.add_timing_info() = timing_info;
+ }
+
+ for (int i = 0; i < distiller_timing_info.other_times_size(); i++) {
+ timing_info.set_name(distiller_timing_info.other_times(i).name());
+ timing_info.set_time(distiller_timing_info.other_times(i).time());
+ *page_data->distilled_page_proto->data.add_timing_info() = timing_info;
+ }
+ }
+
if (distiller_result->has_debug_info() &&
distiller_result->debug_info().has_log()) {
page_data->distilled_page_proto->data.mutable_debug_info()->set_log(
@@ -171,7 +217,7 @@ void DistillerImpl::OnPageDistillationFinished(
}
if (distiller_result->has_pagination_info()) {
- proto::PaginationInfo pagination_info =
+ const proto::PaginationInfo& pagination_info =
distiller_result->pagination_info();
if (pagination_info.has_next_page()) {
GURL next_page_url(pagination_info.next_page());
« no previous file with comments | « no previous file | components/dom_distiller/core/distiller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698