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

Unified Diff: pdf/pdf.cc

Issue 803733002: Roll PDFium (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « DEPS ('k') | pdf/pdf_engine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdf.cc
diff --git a/pdf/pdf.cc b/pdf/pdf.cc
index f15c8892278a6e4bf9b134ae322e0ad73bd4ddfa..51a1e2e35ff438fac4a8c1bea7bcbb303460cce4 100644
--- a/pdf/pdf.cc
+++ b/pdf/pdf.cc
@@ -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(
« no previous file with comments | « DEPS ('k') | pdf/pdf_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698