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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 1155963004: PDF: Cleanup more code now that it is completely out of process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bad rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pdf/pdfium/pdfium_engine.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdfium/pdfium_engine.cc
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index f9feec8e0a7ed290440a750d89b0a3f51179a107..4b279462043f0ec0d381973849d26b5f089a255a 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -941,8 +941,8 @@ FPDF_FILEHANDLER* PDFiumEngine::Form_OpenFile(FPDF_FORMFILLINFO* param,
url_str =
base::UTF16ToUTF8(reinterpret_cast<const base::char16*>(url));
}
- // TODO: need to implement open file from the url
- // Use a file path for the ease of testing
+ // TODO: need to implement open file from the url
+ // Use a file path for the ease of testing
FILE* file = fopen(XFA_TESTFILE("tem.txt"), mode);
FPDF_FILE* file_wrapper = new FPDF_FILE;
file_wrapper->file = file;
@@ -992,17 +992,11 @@ void PDFiumEngine::AddSegment(FX_DOWNLOADHINTS* param,
return download_hints->loader->RequestData(offset, size);
}
-bool PDFiumEngine::New(const char* url) {
- url_ = url;
- headers_ = std::string();
- return true;
-}
-
bool PDFiumEngine::New(const char* url,
const char* headers) {
url_ = url;
if (!headers)
- headers_ = std::string();
+ headers_.clear();
else
headers_ = headers;
return true;
@@ -1243,7 +1237,7 @@ void PDFiumEngine::FinishLoadingDocument() {
FORM_DoPageAAction(new_page, form_, FPDFPAGE_AACTION_OPEN);
}
- if (doc_) // This can only happen if loading |doc_| fails.
+ if (doc_) // This can only happen if loading |doc_| fails.
client_->DocumentLoadComplete(pages_.size());
}
@@ -2003,8 +1997,8 @@ void PDFiumEngine::StartFind(const char* text, bool case_sensitive) {
if (pages_[current_page]->available()) {
base::string16 str = base::UTF8ToUTF16(text);
- // Don't use PDFium to search for now, since it doesn't support unicode text.
- // Leave the code for now to avoid bit-rot, in case it's fixed later.
+ // Don't use PDFium to search for now, since it doesn't support unicode
+ // text. Leave the code for now to avoid bit-rot, in case it's fixed later.
if (0) {
SearchUsingPDFium(
str, case_sensitive, first_search, character_to_start_searching_from,
@@ -2483,7 +2477,7 @@ bool PDFiumEngine::GetPageSizeAndUniformity(pp::Size* size) {
}
void PDFiumEngine::AppendBlankPages(int num_pages) {
- DCHECK(num_pages != 0);
+ DCHECK_NE(num_pages, 0);
if (!doc_)
return;
« no previous file with comments | « pdf/pdfium/pdfium_engine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698