| 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(
|
|
|