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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 1709833002: Remove partially implemented PDF FFI_* handlers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | 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 b4c07e8478a8fd659955c72aee2a7d47c3d66268..bc13cb79395ec446b72f9348234189a0c9fe40b5 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -876,47 +876,18 @@ void PDFiumEngine::Form_UploadTo(FPDF_FORMFILLINFO* param,
FPDF_LPFILEHANDLER PDFiumEngine::Form_DownloadFromURL(FPDF_FORMFILLINFO* param,
FPDF_WIDESTRING url) {
- std::string url_str =
- base::UTF16ToUTF8(reinterpret_cast<const base::char16*>(url));
-
- // Now should get data from url.
- // For testing purpose, use data read from file
- // TODO: needs the full implementation here
- FILE* file = fopen(XFA_TESTFILE("downloadtest.tem"), "w");
-
- FPDF_FILE* file_wrapper = new FPDF_FILE;
- file_wrapper->file = file;
- file_wrapper->file_handler.clientData = file_wrapper;
- file_wrapper->file_handler.Flush = Sample_Flush;
- file_wrapper->file_handler.GetSize = Sample_GetSize;
- file_wrapper->file_handler.ReadBlock = Sample_ReadBlock;
- file_wrapper->file_handler.Release = Sample_Release;
- file_wrapper->file_handler.Truncate = Sample_Truncate;
- file_wrapper->file_handler.WriteBlock = Sample_WriteBlock;
-
- return &file_wrapper->file_handler;
+ // NOTE: Think hard about the security implications before allowing
+ // a PDF file to perform this action.
+ return nullptr;
}
FPDF_FILEHANDLER* PDFiumEngine::Form_OpenFile(FPDF_FORMFILLINFO* param,
int file_flag,
FPDF_WIDESTRING url,
const char* mode) {
- std::string url_str = url ?
- base::UTF16ToUTF8(reinterpret_cast<const base::char16*>(url)) : "NULL";
-
- // 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;
- file_wrapper->file_handler.clientData = file_wrapper;
- file_wrapper->file_handler.Flush = Sample_Flush;
- file_wrapper->file_handler.GetSize = Sample_GetSize;
- file_wrapper->file_handler.ReadBlock = Sample_ReadBlock;
- file_wrapper->file_handler.Release = Sample_Release;
- file_wrapper->file_handler.Truncate = Sample_Truncate;
- file_wrapper->file_handler.WriteBlock = Sample_WriteBlock;
- return &file_wrapper->file_handler;
+ // NOTE: Think hard about the security implications before allowing
+ // a PDF file to perform this action.
+ return nullptr;
}
void PDFiumEngine::Form_GotoURL(FPDF_FORMFILLINFO* param,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698