New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 612315 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Feature



Sign in to add a comment

Printing on Android is slow

Project Member Reported by moltm...@google.com, May 16 2016

Issue description

Steps to reproduce the problem:
Printing on android has two step. First onLayout is called and the onWrite. The purpose of onLayout is to figure out how many pages the printed document has. It is allowed to return PAGE_COUNT_UNKNOWN as the number of pages. In this case the page count will be determined from the document written in onWrite.

In my experiments a complicated web page (cultofmac.com mobile version) lays out in 2.3 seconds and is written in 2.8 seconds. As the layout is almost as slow as the write, can we just return UNKNOWN_PAGE_COUNT instead of spending 2.3 seconds? Of course this would only make sense if in the case we "skip" the layout the write does not get longer.

As a side-effect this would fix issue 593387.

Please make sure that this behavior does not cause issues in Android versions older than N. Esp. please verify that you can select and actually print a set of pages that does not include the last page.

What is the expected behavior?

What went wrong?
We might be able to speed up printing by 2.3 seconds.

Did this work before? N/A 

Chrome version: 51.0.2704.36  Channel: n/a
OS Version: N
Flash Version: Shockwave Flash 21.0 r0
 
Cc: ppolise...@chromium.org
Labels: triage-te
Project Member

Comment 2 by sheriffbot@chromium.org, Jun 2 2016

Labels: Hotlist-Google
Cc: -ppolise...@chromium.org kerz@chromium.org klo...@chromium.org
Labels: -triage-te
Status: Available (was: Unconfirmed)
Owner: ctzsm@chromium.org
Project Member

Comment 5 by bugdroid1@chromium.org, Jun 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6f1e92580993746423754ec992be005c7d102afc

commit 6f1e92580993746423754ec992be005c7d102afc
Author: Shimi Zhang <ctzsm@chromium.org>
Date: Mon Jun 12 20:50:34 2017

[Android] Set page count to unknown in onLayout stage for printing

This CL:

1) Set page count to unknown for PrintDocumentInfo in onLayout
stage since we don't need to report pages count of a file. Android
framework will get page count from the file produced from onWrite
stage. This change will fix crbug/593387.

2) Removed printing jobs started from onLayout. We don't need to
report pages count of the file at that stage, hence no need to
start printing jobs from onLayout. As a replacement, starting all
printing jobs from onWrite. It is related to crbug/612315, but
crbug/612315 is not really true about saving file generating time
since we didn't generate a file twice.

3) With other cleanup because variables such as mLastKnownMaxPages
is not useful anymore.

Bug: 593387,  612315 
Change-Id: Ic52d9aa12b4aeb659156e1e2eb21f2f11afbd60c
Reviewed-on: https://chromium-review.googlesource.com/521205
Commit-Queue: Shimi Zhang <ctzsm@chromium.org>
Reviewed-by: Nicolas Dossou-Gbété <dgn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#478753}
[modify] https://crrev.com/6f1e92580993746423754ec992be005c7d102afc/printing/android/java/src/org/chromium/printing/PrintingControllerImpl.java

Comment 6 by ctzsm@chromium.org, Jun 12 2017

Status: Fixed (was: Available)
Project Member

Comment 7 by bugdroid1@chromium.org, Jun 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/11edc8dc94dffca4c32649699efbaae1099143db

commit 11edc8dc94dffca4c32649699efbaae1099143db
Author: Henrik Grunell <grunell@chromium.org>
Date: Tue Jun 13 08:47:22 2017

Revert "[Android] Set page count to unknown in onLayout stage for printing"

This reverts commit 6f1e92580993746423754ec992be005c7d102afc.

Reason for revert: Suspecting that this causes flaky failure, see bug.

Original change's description:
> [Android] Set page count to unknown in onLayout stage for printing
> 
> This CL:
> 
> 1) Set page count to unknown for PrintDocumentInfo in onLayout
> stage since we don't need to report pages count of a file. Android
> framework will get page count from the file produced from onWrite
> stage. This change will fix crbug/593387.
> 
> 2) Removed printing jobs started from onLayout. We don't need to
> report pages count of the file at that stage, hence no need to
> start printing jobs from onLayout. As a replacement, starting all
> printing jobs from onWrite. It is related to crbug/612315, but
> crbug/612315 is not really true about saving file generating time
> since we didn't generate a file twice.
> 
> 3) With other cleanup because variables such as mLastKnownMaxPages
> is not useful anymore.
> 
> Bug: 593387,  612315 
> Change-Id: Ic52d9aa12b4aeb659156e1e2eb21f2f11afbd60c
> Reviewed-on: https://chromium-review.googlesource.com/521205
> Commit-Queue: Shimi Zhang <ctzsm@chromium.org>
> Reviewed-by: Nicolas Dossou-Gbété <dgn@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#478753}

TBR=dgn@chromium.org,ctzsm@chromium.org
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 593387,  612315 ,  732698 

Change-Id: I5d74580fb52438aac13f9b9da7fb22206c73d5d8
Reviewed-on: https://chromium-review.googlesource.com/532894
Reviewed-by: Henrik Grunell <grunell@chromium.org>
Commit-Queue: Henrik Grunell <grunell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#478937}
[modify] https://crrev.com/11edc8dc94dffca4c32649699efbaae1099143db/printing/android/java/src/org/chromium/printing/PrintingControllerImpl.java

Sign in to add a comment