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

Unified Diff: pdf/pdf.cc

Issue 819473002: Load V8 external data prior to initializng PDFium SDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unused v8 includes Created 6 years 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/out_of_process_instance.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdf.cc
diff --git a/pdf/pdf.cc b/pdf/pdf.cc
index 51a1e2e35ff438fac4a8c1bea7bcbb303460cce4..d6c9863df7b1f319218f8ef698051f4e93f28aa3 100644
--- a/pdf/pdf.cc
+++ b/pdf/pdf.cc
@@ -14,6 +14,7 @@
#include "pdf/out_of_process_instance.h"
#include "ppapi/c/ppp.h"
#include "ppapi/cpp/private/pdf.h"
+#include "v8/include/v8.h"
bool g_sdk_initialized_via_pepper = false;
@@ -97,6 +98,15 @@ bool PDFModule::Init() {
pp::Instance* PDFModule::CreateInstance(PP_Instance instance) {
if (!g_sdk_initialized_via_pepper) {
+ v8::StartupData natives;
+ v8::StartupData snapshot;
+ pp::PDF::GetV8ExternalSnapshotData(pp::InstanceHandle(instance),
+ &natives.data, &natives.raw_size,
+ &snapshot.data, &snapshot.raw_size);
+ if (natives.data) {
+ v8::V8::SetNativesDataBlob(&natives);
+ v8::V8::SetSnapshotDataBlob(&snapshot);
+ }
if (!chrome_pdf::InitializeSDK())
return NULL;
g_sdk_initialized_via_pepper = true;
« no previous file with comments | « pdf/out_of_process_instance.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698