summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/print_web_view_helper_mac.mm
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-30 02:26:27 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-30 02:26:27 +0000
commit628bc54cf1a4006c7b65c8d9a7a3ce1d0ce5b047 (patch)
treedffb2d74e0f8fa61768ee4426f1bc3c7d323bbbe /chrome/renderer/print_web_view_helper_mac.mm
parentcd6522da39348968884d53d2db709f48d8b7716b (diff)
downloadchromium_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_mac.mm')
-rw-r--r--chrome/renderer/print_web_view_helper_mac.mm15
1 files changed, 8 insertions, 7 deletions
diff --git a/chrome/renderer/print_web_view_helper_mac.mm b/chrome/renderer/print_web_view_helper_mac.mm
index 1f1dedb..e46320e 100644
--- a/chrome/renderer/print_web_view_helper_mac.mm
+++ b/chrome/renderer/print_web_view_helper_mac.mm
@@ -76,11 +76,13 @@ bool PrintWebViewHelper::CreatePreviewDocument(
printParams.printable_size.height());
base::TimeTicks begin_time = base::TimeTicks::Now();
+ base::TimeTicks page_begin_time = begin_time;
if (params.pages.empty()) {
for (int i = 0; i < page_count; ++i) {
RenderPage(printParams.page_size, content_area, scale_factor, i, frame,
&metafile);
+ page_begin_time = ReportPreviewPageRenderTime(page_begin_time);
}
} else {
for (size_t i = 0; i < params.pages.size(); ++i) {
@@ -88,19 +90,18 @@ bool PrintWebViewHelper::CreatePreviewDocument(
break;
RenderPage(printParams.page_size, content_area, scale_factor,
static_cast<int>(params.pages[i]), frame, &metafile);
+ page_begin_time = ReportPreviewPageRenderTime(page_begin_time);
}
}
- 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();
- 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);
PrintHostMsg_DidPreviewDocument_Params preview_params;
preview_params.data_size = metafile.GetDataSize();