Index: pdf/instance.cc |
diff --git a/pdf/instance.cc b/pdf/instance.cc |
index 37192ba7b279f588c90fe8fdddbf04eff22cd9db..42179dbd72e60adcfa50739e78c5c12631d7af4f 100644 |
--- a/pdf/instance.cc |
+++ b/pdf/instance.cc |
@@ -46,6 +46,10 @@ |
#include "base/mac/mac_util.h" |
#endif |
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA |
+#include "v8/include/v8.h" |
+#endif |
+ |
namespace chrome_pdf { |
struct ToolbarButtonInfo { |
@@ -319,6 +323,17 @@ Instance::~Instance() { |
} |
bool Instance::Init(uint32_t argc, const char* argn[], const char* argv[]) { |
+#ifdef V8_USE_EXTERNAL_STARTUP_DATA |
raymes
2014/11/10 03:29:06
It would be better not to use the #ifdef here. Ins
baixo1
2014/11/10 15:59:48
Done.
|
+ v8::StartupData natives; |
+ v8::StartupData snapshot; |
+ pp::PDF::GetV8ExternalSnapshotData(this, &natives.data, &natives.raw_size, |
+ &snapshot.data, &snapshot.raw_size); |
+ natives.compressed_size = natives.raw_size; |
+ snapshot.compressed_size = snapshot.raw_size; |
+ v8::V8::SetNativesDataBlob(&natives); |
+ v8::V8::SetSnapshotDataBlob(&snapshot); |
+#endif |
+ |
// For now, we hide HiDPI support behind a flag. |
if (pp::PDF::IsFeatureEnabled(this, PP_PDFFEATURE_HIDPI)) |
hidpi_enabled_ = true; |