Adds a "PdfPartialLoading" feature to control whether or not the PDF
viewer tries to use partial loading. The default state is enabled, as
this feature has shipped already, but we would like to experiment with
disabling it to address certain problems related to partial loading.
Bug: 1115149
Change-Id: Ie66fddf5b633269226bc01fca20ac7013f0c1e7c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2349429
Commit-Queue: K. Moon <kmoon@chromium.org>
Reviewed-by: Daniel Hosseinian <dhoss@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797378}
Switches chrome_pdf::URLLoaderWrapper's API from pp::CompletionCallback
to base::OnceCallback. pp::CompletionCallback is still used internally
when calling Pepper APIs., but clients of URLLoaderWrapper no longer
need to deal with pp::CompletionCallback.
Using base::OnceCallback also simplifies resource management,
eliminating the need to manage references to pp::CompletionCallback.
With respect to thread safety, most Pepper APIs invoke asynchronous
callbacks on the original caller's thread, so there should be no new
thread safety issues. The base:: APIs also do sequence checking in
DCHECK mode, which should catch any unanticipated issues.
Bug: 1099022, 1101169
Change-Id: Ia355588b25b54a776ac972a7b5b2104b1a3b18c8
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2278169
Commit-Queue: K. Moon <kmoon@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#785816}
CHECK, CHECK_EQ etc., and NOTREACHED/NOTIMPLEMENTED have moved
to the much smaller headers check.h, check_op.h, and notreached.h,
respectively.
This CL updates .cc files to use those headers instead when
possible, with the purpose of saving compile time.
(Split out from https://crrev.com/c/2164525 which also has
notes on how the change was generated.)
Bug: 1031540
Change-Id: Ia89f8dd8a7ca818e539d4be41556e247e9849017
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2164637
Auto-Submit: Hans Wennborg <hans@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#763916}
TestDocumentLoader currently loads the entire test PDF file as soon as
PDFiumEngine calls DocumentLoader::RequestData(0, 1). This change adds a
new TestDocumentLoader::SimulateLoadData(uint32_t) method that allows a
test to control how quickly the document loads.
A future test will take advantage of this to put the PDFiumEngine into a
partially-loaded state.
A test can request the TestDocumentLoader by calling PDFiumTestBase's
InitializeEngineWithoutLoading() method instead of InitializeEngine().
This change also removes the DocumentLoader::SetDocumentSize() method,
which only was used internally by DocumentLoaderImpl anyway.
Bug: 1051548
Change-Id: Ib5256aa70c468284e0f01964b409f2a85a9a066a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2067692
Commit-Queue: K Moon <kmoon@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Daniel Hosseinian <dhoss@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751597}
This CL removes MimeHandlerService::AbortStream and all uses of it,
since it's a no-op. The pdf viewer currently calls it via
CancelBrowserDownload, which this CL also removes. The pdf request
actually gets stopped by resetting the chrome_pdf::URLLoaderWrapper,
which closes the connection on desctruction.
Bug: 934009
Change-Id: Ib3cc6fb1aa12270d39c16a6770d3726a3198682c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1696444
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Toni Baržić <tbarzic@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Cr-Commit-Position: refs/heads/master@{#677545}
To make it easier to write fake DocumentLoaders for testing. Split the
implementation off into DocumentLoaderImpl.
Change-Id: I44f16c757b8a9be133936c41c231a552a7e05f0a
Reviewed-on: https://chromium-review.googlesource.com/1013998
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553816}