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

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: 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
Index: pdf/instance.cc
diff --git a/pdf/instance.cc b/pdf/instance.cc
index 37192ba7b279f588c90fe8fdddbf04eff22cd9db..79894175a008a3e392e7fa3a0cc713c8cbd9b431 100644
--- a/pdf/instance.cc
+++ b/pdf/instance.cc
@@ -46,6 +46,10 @@
#include "base/mac/mac_util.h"
#endif
+#if !defined(OS_ANDROID) && defined(V8_USE_EXTERNAL_STARTUP_DATA)
raymes 2014/11/04 22:18:13 *You should be able to get rid of all the OS_ANDRO
baixo1 2014/11/07 21:35:34 Done.
+#include "v8/include/v8.h"
raymes 2014/11/04 22:18:13 I just want to make sure - does pdfium use this sa
baixo1 2014/11/07 21:35:34 According to Lei, this file is part of pdf.dll, wh
raymes 2014/11/10 03:29:05 That sounds right to me. Thanks!
+#endif
+
namespace chrome_pdf {
struct ToolbarButtonInfo {
@@ -319,6 +323,20 @@ Instance::~Instance() {
}
bool Instance::Init(uint32_t argc, const char* argn[], const char* argv[]) {
+#if !defined(OS_ANDROID) && defined(V8_USE_EXTERNAL_STARTUP_DATA)
+ v8::StartupData natives;
+ natives.data = pp::PDF::GetV8NativesData(this);
+ natives.raw_size = pp::PDF::GetV8NativesSize(this);
+ natives.compressed_size = pp::PDF::GetV8NativesSize(this);
+ v8::V8::SetNativesDataBlob(&natives);
+
+ v8::StartupData snapshot;
+ snapshot.data = pp::PDF::GetV8SnapshotData(this);
+ snapshot.raw_size = pp::PDF::GetV8SnapshotSize(this);
+ snapshot.compressed_size = pp::PDF::GetV8SnapshotSize(this);
+ v8::V8::SetSnapshotDataBlob(&snapshot);
+#endif // !defined(OS_ANDROID) && defined(V8_USE_EXTERNAL_STARTUP_DATA)
+
// For now, we hide HiDPI support behind a flag.
if (pp::PDF::IsFeatureEnabled(this, PP_PDFFEATURE_HIDPI))
hidpi_enabled_ = true;

Powered by Google App Engine
This is Rietveld 408576698