Commit 73c77f0c authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Remove cruft in pdf_child_init.cc.

Change-Id: Ic15188f601b2acb50c233558e9942118643456ec
Reviewed-on: https://chromium-review.googlesource.com/923712
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: default avatardsinclair <dsinclair@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539135}
parent c6d46d2f
...@@ -4,21 +4,19 @@ ...@@ -4,21 +4,19 @@
#include "chrome/child/pdf_child_init.h" #include "chrome/child/pdf_child_init.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/path_service.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/common/chrome_paths.h"
#include "content/public/child/child_thread.h"
#if defined(OS_WIN) #if defined(OS_WIN)
#include "base/win/current_module.h" #include "base/win/current_module.h"
#include "base/win/iat_patch_function.h" #include "base/win/iat_patch_function.h"
#include "content/public/child/child_thread.h"
#endif #endif
namespace { namespace {
#if defined(OS_WIN) #if defined(OS_WIN)
static base::win::IATPatchFunction g_iat_patch_createdca; base::win::IATPatchFunction g_iat_patch_createdca;
HDC WINAPI CreateDCAPatch(LPCSTR driver_name, HDC WINAPI CreateDCAPatch(LPCSTR driver_name,
LPCSTR device_name, LPCSTR device_name,
LPCSTR output, LPCSTR output,
...@@ -37,8 +35,10 @@ typedef DWORD (WINAPI* GetFontDataPtr) (HDC hdc, ...@@ -37,8 +35,10 @@ typedef DWORD (WINAPI* GetFontDataPtr) (HDC hdc,
DWORD offset, DWORD offset,
LPVOID buffer, LPVOID buffer,
DWORD length); DWORD length);
GetFontDataPtr g_original_get_font_data = NULL; GetFontDataPtr g_original_get_font_data = nullptr;
static base::win::IATPatchFunction g_iat_patch_get_font_data;
base::win::IATPatchFunction g_iat_patch_get_font_data;
DWORD WINAPI GetFontDataPatch(HDC hdc, DWORD WINAPI GetFontDataPatch(HDC hdc,
DWORD table, DWORD table,
DWORD offset, DWORD offset,
...@@ -50,7 +50,6 @@ DWORD WINAPI GetFontDataPatch(HDC hdc, ...@@ -50,7 +50,6 @@ DWORD WINAPI GetFontDataPatch(HDC hdc,
LOGFONT logfont; LOGFONT logfont;
if (GetObject(font, sizeof(LOGFONT), &logfont)) { if (GetObject(font, sizeof(LOGFONT), &logfont)) {
std::vector<char> font_data;
if (content::ChildThread::Get()) if (content::ChildThread::Get())
content::ChildThread::Get()->PreCacheFont(logfont); content::ChildThread::Get()->PreCacheFont(logfont);
rv = g_original_get_font_data(hdc, table, offset, buffer, length); rv = g_original_get_font_data(hdc, table, offset, buffer, length);
...@@ -60,7 +59,7 @@ DWORD WINAPI GetFontDataPatch(HDC hdc, ...@@ -60,7 +59,7 @@ DWORD WINAPI GetFontDataPatch(HDC hdc,
} }
return rv; return rv;
} }
#endif // OS_WIN #endif // defined(OS_WIN)
} // namespace } // namespace
...@@ -75,6 +74,5 @@ void InitializePDF() { ...@@ -75,6 +74,5 @@ void InitializePDF() {
"GetFontData", GetFontDataPatch); "GetFontData", GetFontDataPatch);
g_original_get_font_data = reinterpret_cast<GetFontDataPtr>( g_original_get_font_data = reinterpret_cast<GetFontDataPtr>(
g_iat_patch_get_font_data.original_function()); g_iat_patch_get_font_data.original_function());
#endif // OS_WIN #endif // defined(OS_WIN)
} }
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