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

Unified Diff: components/pdf/renderer/ppb_pdf_impl.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: components/pdf/renderer/ppb_pdf_impl.cc
diff --git a/components/pdf/renderer/ppb_pdf_impl.cc b/components/pdf/renderer/ppb_pdf_impl.cc
index 7dda10a8de62b61613f8faa5180e43fbe3381150..b447fdda55006b3336469ff66b438f4e6ae42d99 100644
--- a/components/pdf/renderer/ppb_pdf_impl.cc
+++ b/components/pdf/renderer/ppb_pdf_impl.cc
@@ -329,6 +329,40 @@ void SetLinkUnderCursor(PP_Instance instance_id, const char* url) {
instance->SetLinkUnderCursor(url);
}
+#if !defined(OS_ANDROID) && defined(V8_USE_EXTERNAL_STARTUP_DATA)
+const char* GetV8NativesData(PP_Instance instance_id) {
rmcilroy 2014/11/04 21:58:12 Random drive-by comment: Could we just have a sing
raymes 2014/11/04 22:18:13 +1
baixo1 2014/11/07 21:35:34 Done.
+ content::PepperPluginInstance* instance =
+ content::PepperPluginInstance::Get(instance_id);
+ if (!instance)
+ return NULL;
+ return instance->GetV8NativesData();
+}
+
+const char* GetV8SnapshotData(PP_Instance instance_id) {
+ content::PepperPluginInstance* instance =
+ content::PepperPluginInstance::Get(instance_id);
+ if (!instance)
+ return NULL;
+ return instance->GetV8SnapshotData();
+}
+
+int GetV8NativesSize(PP_Instance instance_id) {
+ content::PepperPluginInstance* instance =
+ content::PepperPluginInstance::Get(instance_id);
+ if (!instance)
+ return 0;
+ return instance->GetV8NativesSize();
+}
+
+int GetV8SnapshotSize(PP_Instance instance_id) {
+ content::PepperPluginInstance* instance =
+ content::PepperPluginInstance::Get(instance_id);
+ if (!instance)
+ return 0;
+ return instance->GetV8SnapshotSize();
+}
+#endif // !defined(OS_ANDROID) && defined(V8_USE_EXTERNAL_STARTUP_DATA)
+
const PPB_PDF ppb_pdf = { //
&GetLocalizedString, //
&GetResourceImage, //
@@ -349,6 +383,12 @@ const PPB_PDF ppb_pdf = { //
&IsOutOfProcess, //
&SetSelectedText, //
&SetLinkUnderCursor, //
+#if !defined(OS_ANDROID) && defined(V8_USE_EXTERNAL_STARTUP_DATA)
+ &GetV8NativesData, //
+ &GetV8SnapshotData, //
+ &GetV8NativesSize, //
+ &GetV8SnapshotSize, //
+#endif // !defined(OS_ANDROID) && defined(V8_USE_EXTERNAL_STARTUP_DATA)
};
} // namespace

Powered by Google App Engine
This is Rietveld 408576698