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

Unified Diff: pdf/out_of_process_instance.cc

Issue 718453003: Initialize V8 in PDFium from external files (plugin process only) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix API 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/instance.cc ('k') | ppapi/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/out_of_process_instance.cc
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index bfbcb93bc1255db0cab0cf177703ca89f1ed25c9..92ef55003b3f22636b232e7a9df87466d8441a10 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -40,6 +40,7 @@
#include "ppapi/cpp/var_array.h"
#include "ppapi/cpp/var_dictionary.h"
#include "ui/events/keycodes/keyboard_codes.h"
+#include "v8/include/v8.h"
#if defined(OS_MACOSX)
#include "base/mac/mac_util.h"
@@ -266,6 +267,17 @@ OutOfProcessInstance::~OutOfProcessInstance() {
bool OutOfProcessInstance::Init(uint32_t argc,
const char* argn[],
const char* argv[]) {
+ v8::StartupData natives;
+ v8::StartupData snapshot;
+ pp::PDF::GetV8ExternalSnapshotData(this, &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);
+ }
+
// Check if the PDF is being loaded in the PDF chrome extension. We only allow
// the plugin to be put into "full frame" mode when it is being loaded in the
// extension because this enables some features that we don't want pages
« no previous file with comments | « pdf/instance.cc ('k') | ppapi/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698