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

Issue 317803005: Add function to document_loader to get PDF as pp::FileRef (Closed)

Created:
6 years, 6 months ago by raymes
Modified:
4 years, 11 months ago
Reviewers:
Lei Zhang
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org, asanka
Visibility:
Public.

Description

Add function to document_loader to get PDF as pp::FileRef BUG=224520

Patch Set 1 #

Total comments: 11

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+171 lines, -1 line) Patch
M .gitignore View 1 chunk +0 lines, -1 line 0 comments Download
M pdf/chunk_stream.h View 1 chunk +2 lines, -0 lines 0 comments Download
M pdf/document_loader.h View 3 chunks +9 lines, -0 lines 0 comments Download
M pdf/document_loader.cc View 1 2 chunks +19 lines, -0 lines 0 comments Download
A pdf/file_writer.h View 1 1 chunk +50 lines, -0 lines 0 comments Download
A pdf/file_writer.cc View 1 1 chunk +89 lines, -0 lines 0 comments Download
M pdf/pdf.gyp View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
raymes
I drafted up this CL to save the PDF to a file ref, but I'm ...
6 years, 6 months ago (2014-06-05 06:25:56 UTC) #1
Lei Zhang
Mostly good. I assume this is going to stay here until we figure out all ...
6 years, 6 months ago (2014-06-05 07:23:53 UTC) #2
raymes
6 years, 6 months ago (2014-06-06 01:57:14 UTC) #3
Thanks. Yeah I'll just leave it here until the download manager part is done,
then I'll be happy to hook it up.

https://codereview.chromium.org/317803005/diff/1/pdf/document_loader.cc
File pdf/document_loader.cc (right):

https://codereview.chromium.org/317803005/diff/1/pdf/document_loader.cc#newco...
pdf/document_loader.cc:132: pp::CompletionCallbackWithOutput<pp::FileRef>
callback) {
On 2014/06/05 07:23:54, Lei Zhang wrote:
> nit: indentation

Done.

https://codereview.chromium.org/317803005/diff/1/pdf/document_loader.cc#newco...
pdf/document_loader.cc:133: if (!IsDocumentComplete() ||
chunk_stream_.data().size() == 0) {
On 2014/06/05 07:23:54, Lei Zhang wrote:
> nit: size() == 0  -> empty()

Done.

https://codereview.chromium.org/317803005/diff/1/pdf/document_loader.cc#newco...
pdf/document_loader.cc:141: "pdf",
This will just be a temporary filename. The download manager should prompt the
user for the file name and then copy/move this file to the given location.

https://codereview.chromium.org/317803005/diff/1/pdf/file_writer.cc
File pdf/file_writer.cc (right):

https://codereview.chromium.org/317803005/diff/1/pdf/file_writer.cc#newcode58
pdf/file_writer.cc:58: callback_->Run(result);
On 2014/06/05 07:23:54, Lei Zhang wrote:
> Do you need to call io_.Close() here? Same with the error handling in
> FileWriter::OnFlushComplete().

Done.

https://codereview.chromium.org/317803005/diff/1/pdf/file_writer.h
File pdf/file_writer.h (right):

https://codereview.chromium.org/317803005/diff/1/pdf/file_writer.h#newcode1
pdf/file_writer.h:1: // Copyright (c) 2014 The Chromium Authors. All rights
reserved.
On 2014/06/05 07:23:54, Lei Zhang wrote:
> nit: no (c) in new code.

Done.

Powered by Google App Engine
This is Rietveld 408576698