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

Unified Diff: pdf/instance.cc

Issue 705623002: Initialize V8 in PDFium from external files (in-renderer process only). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Explicitly cast size_t to int Created 6 years, 1 month 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 | « pdf/DEPS ('k') | ppapi/c/private/ppb_pdf.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/instance.cc
diff --git a/pdf/instance.cc b/pdf/instance.cc
index 37192ba7b279f588c90fe8fdddbf04eff22cd9db..2ffc7d47f4edf274b10cbeb00a5475aa9155cd2c 100644
--- a/pdf/instance.cc
+++ b/pdf/instance.cc
@@ -41,6 +41,7 @@
#include "ppapi/cpp/resource.h"
#include "ppapi/cpp/url_request_info.h"
#include "ui/events/keycodes/keyboard_codes.h"
+#include "v8/include/v8.h"
#if defined(OS_MACOSX)
#include "base/mac/mac_util.h"
@@ -319,6 +320,17 @@ Instance::~Instance() {
}
bool Instance::Init(uint32_t argc, const char* argn[], const char* argv[]) {
+ v8::StartupData natives;
+ v8::StartupData snapshot;
+ pp::PDF::GetV8ExternalSnapshotData(&natives.data, &natives.raw_size,
+ &snapshot.data, &snapshot.raw_size);
+ if (natives.data) {
+ natives.compressed_size = natives.raw_size;
+ snapshot.compressed_size = snapshot.raw_size;
+ v8::V8::SetNativesDataBlob(&natives);
+ v8::V8::SetSnapshotDataBlob(&snapshot);
+ }
+
// For now, we hide HiDPI support behind a flag.
if (pp::PDF::IsFeatureEnabled(this, PP_PDFFEATURE_HIDPI))
hidpi_enabled_ = true;
« no previous file with comments | « pdf/DEPS ('k') | ppapi/c/private/ppb_pdf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698