diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-30 02:26:27 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-30 02:26:27 +0000 |
commit | 628bc54cf1a4006c7b65c8d9a7a3ce1d0ce5b047 (patch) | |
tree | dffb2d74e0f8fa61768ee4426f1bc3c7d323bbbe /chrome/renderer/print_web_view_helper_linux.cc | |
parent | cd6522da39348968884d53d2db709f48d8b7716b (diff) | |
download | chromium_src-628bc54cf1a4006c7b65c8d9a7a3ce1d0ce5b047.zip chromium_src-628bc54cf1a4006c7b65c8d9a7a3ce1d0ce5b047.tar.gz chromium_src-628bc54cf1a4006c7b65c8d9a7a3ce1d0ce5b047.tar.bz2 |
Improve print preview UMAs based on jar's feedback.
BUG=80917
TEST=NONE
Review URL: http://codereview.chromium.org/7082030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87211 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/print_web_view_helper_linux.cc')
-rw-r--r-- | chrome/renderer/print_web_view_helper_linux.cc | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/chrome/renderer/print_web_view_helper_linux.cc b/chrome/renderer/print_web_view_helper_linux.cc index 6793e4c..08042b9 100644 --- a/chrome/renderer/print_web_view_helper_linux.cc +++ b/chrome/renderer/print_web_view_helper_linux.cc @@ -166,6 +166,7 @@ bool PrintWebViewHelper::RenderPages(const PrintMsg_PrintPages_Params& params, return false; base::TimeTicks begin_time = base::TimeTicks::Now(); + base::TimeTicks page_begin_time = begin_time; PrintMsg_PrintPage_Params page_params; page_params.params = printParams; @@ -174,27 +175,29 @@ bool PrintWebViewHelper::RenderPages(const PrintMsg_PrintPages_Params& params, for (int i = 0; i < *page_count; ++i) { page_params.page_number = i; PrintPageInternal(page_params, canvas_size, frame, metafile); + if (is_preview) { + page_begin_time = ReportPreviewPageRenderTime(page_begin_time); + } } } else { for (size_t i = 0; i < params.pages.size(); ++i) { page_params.page_number = params.pages[i]; PrintPageInternal(page_params, canvas_size, frame, metafile); + if (is_preview) { + page_begin_time = ReportPreviewPageRenderTime(page_begin_time); + } } } - if (is_preview) { - UMA_HISTOGRAM_TIMES("PrintPreview.RenderToPDFTime", - base::TimeTicks::Now() - begin_time); - } + base::TimeDelta render_time = base::TimeTicks::Now() - begin_time; + prep_frame_view.FinishPrinting(); metafile->FinishDocument(); if (is_preview) { - int preview_page_count = params.pages.size(); - if (!preview_page_count) - preview_page_count = *page_count; - ReportPreviewGenerationTime(base::TimeTicks::Now() - begin_time, - preview_page_count); + ReportTotalPreviewGenerationTime(params.pages.size(), *page_count, + render_time, + base::TimeTicks::Now() - begin_time); } return true; } |