summaryrefslogtreecommitdiffstats
path: root/pdf/out_of_process_instance.cc
diff options
context:
space:
mode:
authorbaixo <baixo@chromium.org>2014-11-14 08:34:30 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-14 16:34:55 +0000
commit5c1aafbd7729d2d1fd1bea34e865cd83080ddd8c (patch)
tree4fc145a0f67bc95f1803fc23f5f8666b406cde28 /pdf/out_of_process_instance.cc
parentca3743ab392e96a9499392f4b310e28d8e665526 (diff)
downloadchromium_src-5c1aafbd7729d2d1fd1bea34e865cd83080ddd8c.zip
chromium_src-5c1aafbd7729d2d1fd1bea34e865cd83080ddd8c.tar.gz
chromium_src-5c1aafbd7729d2d1fd1bea34e865cd83080ddd8c.tar.bz2
Initialize V8 in PDFium from external files (plugin process only)
BUG=421063 Review URL: https://codereview.chromium.org/718453003 Cr-Commit-Position: refs/heads/master@{#304223}
Diffstat (limited to 'pdf/out_of_process_instance.cc')
-rw-r--r--pdf/out_of_process_instance.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index bfbcb93..92ef550 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