Commit 3df5f766 authored by jam's avatar jam Committed by Commit bot

Roll PDFium

This brings in:
f650510  Fix build after previous commit.
217ecf35  Simplify PDFium by removing code that's not used in the open source repo.
2399550  m_pColorSpace can not be NULL for image object with DCTDecode filter
8695172  Do not do strict check of BitsPerComponent for RunLengthDecode filter
381b911  Lab colorspace needs to be 3 component
ca5d769  Trailer should be a dictionary object
4429eaa  Replace manual/error-prone/hard-to-verify arraysize calculations with safe FX_ArraySize macro.
b69da0b  Getting rid of more (FX_LPCWSTR) casts and fixing two bugs revealed by this.
4b87f7b  Cleanup: Remove an unused function.
df76a19  Add a missing 'using' keyword in big integer library
91dd8c7  Modify big integer library
44047c3  Remove unnecessary files in third_party/bigint
7504b3d  Initial check in of big integer library, v2010.04.30
4643533  Update to openjpeg r2944

Review URL: https://codereview.chromium.org/803733002

Cr-Commit-Position: refs/heads/master@{#308417}
parent 4c172eea
......@@ -68,7 +68,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling PDFium
# and whatever else without interference from each other.
'pdfium_revision': 'ef619d0562b39f30943cfdc4985a0df233d00e42',
'pdfium_revision': 'f6505100fc132ef866adaf3ff1fb7f06d0ca7a9b',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling openmax_dl
# and whatever else without interference from each other.
......
......@@ -28,7 +28,6 @@ bool g_sdk_initialized_via_pepper = false;
#endif
#if defined(OS_WIN)
HMODULE g_hmodule;
void HandleInvalidParameter(const wchar_t* expression,
const wchar_t* function,
......@@ -48,7 +47,6 @@ void HandlePureVirtualCall() {
BOOL APIENTRY DllMain(HMODULE module, DWORD reason_for_call, LPVOID reserved) {
g_hmodule = module;
if (reason_for_call == DLL_PROCESS_ATTACH) {
// On windows following handlers work only inside module. So breakpad in
// chrome.dll does not catch that. To avoid linking related code or
......@@ -99,11 +97,7 @@ bool PDFModule::Init() {
pp::Instance* PDFModule::CreateInstance(PP_Instance instance) {
if (!g_sdk_initialized_via_pepper) {
void* data = NULL;
#if defined(OS_WIN)
data = g_hmodule;
#endif
if (!chrome_pdf::InitializeSDK(data))
if (!chrome_pdf::InitializeSDK())
return NULL;
g_sdk_initialized_via_pepper = true;
}
......@@ -166,7 +160,7 @@ PP_EXPORT bool RenderPDFPageToDC(const void* pdf_buffer,
bool center_in_bounds,
bool autorotate) {
if (!g_sdk_initialized_via_pepper) {
if (!chrome_pdf::InitializeSDK(g_hmodule)) {
if (!chrome_pdf::InitializeSDK()) {
return false;
}
}
......@@ -194,11 +188,7 @@ bool GetPDFDocInfo(const void* pdf_buffer,
int buffer_size, int* page_count,
double* max_page_width) {
if (!g_sdk_initialized_via_pepper) {
void* data = NULL;
#if defined(OS_WIN)
data = g_hmodule;
#endif
if (!chrome_pdf::InitializeSDK(data))
if (!chrome_pdf::InitializeSDK())
return false;
}
scoped_ptr<chrome_pdf::PDFEngineExports> engine_exports(
......@@ -225,11 +215,7 @@ bool GetPDFPageSizeByIndex(const void* pdf_buffer,
int pdf_buffer_size, int page_number,
double* width, double* height) {
if (!g_sdk_initialized_via_pepper) {
void* data = NULL;
#if defined(OS_WIN)
data = g_hmodule;
#endif
if (!chrome_pdf::InitializeSDK(data))
if (!chrome_pdf::InitializeSDK())
return false;
}
scoped_ptr<chrome_pdf::PDFEngineExports> engine_exports(
......@@ -263,11 +249,7 @@ bool RenderPDFPageToBitmap(const void* pdf_buffer,
int dpi,
bool autorotate) {
if (!g_sdk_initialized_via_pepper) {
void* data = NULL;
#if defined(OS_WIN)
data = g_hmodule;
#endif
if (!chrome_pdf::InitializeSDK(data))
if (!chrome_pdf::InitializeSDK())
return false;
}
scoped_ptr<chrome_pdf::PDFEngineExports> engine_exports(
......
......@@ -41,9 +41,8 @@ const uint32 kDefaultKeyModifier = PP_INPUTEVENT_MODIFIER_METAKEY;
const uint32 kDefaultKeyModifier = PP_INPUTEVENT_MODIFIER_CONTROLKEY;
#endif // OS_MACOSX
// Do one time initialization of the SDK. data is platform specific, on Windows
// it's the instance of the DLL and it's unused on other platforms.
bool InitializeSDK(void* data);
// Do one time initialization of the SDK.
bool InitializeSDK();
// Tells the SDK that we're shutting down.
void ShutdownSDK();
......
......@@ -36,7 +36,6 @@
#include "third_party/pdfium/fpdfsdk/include/fpdf_sysfontinfo.h"
#include "third_party/pdfium/fpdfsdk/include/fpdf_transformpage.h"
#include "third_party/pdfium/fpdfsdk/include/fpdfedit.h"
#include "third_party/pdfium/fpdfsdk/include/fpdfoom.h"
#include "third_party/pdfium/fpdfsdk/include/fpdfppo.h"
#include "third_party/pdfium/fpdfsdk/include/fpdfsave.h"
#include "third_party/pdfium/fpdfsdk/include/pdfwindow/PDFWindow.h"
......@@ -290,19 +289,6 @@ FPDF_SYSFONTINFO g_font_info = {
};
#endif // defined(OS_LINUX)
void OOM_Handler(_OOM_INFO*) {
// Kill the process. This is important for security, since the code doesn't
// NULL-check many memory allocations. If a malloc fails, returns NULL, and
// the buffer is then used, it provides a handy mapping of memory starting at
// address 0 for an attacker to utilize.
abort();
}
OOM_INFO g_oom_info = {
1,
OOM_Handler
};
PDFiumEngine* g_engine_for_unsupported;
void Unsupported_Handler(UNSUPPORT_INFO*, int type) {
......@@ -529,15 +515,14 @@ void FormatStringForOS(base::string16* text) {
} // namespace
bool InitializeSDK(void* data) {
FPDF_InitLibrary(data);
bool InitializeSDK() {
FPDF_InitLibrary();
#if defined(OS_LINUX)
// Font loading doesn't work in the renderer sandbox in Linux.
FPDF_SetSystemFontInfo(&g_font_info);
#endif
FSDK_SetOOMHandler(&g_oom_info);
FSDK_SetUnSpObjProcessHandler(&g_unsuppored_info);
return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment