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

Side by Side Diff: components/pdf/renderer/ppb_pdf_impl.cc

Issue 718453003: Initialize V8 in PDFium from external files (plugin process only) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix API 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 unified diff | Download patch
« no previous file with comments | « chrome/plugin/chrome_content_plugin_client.cc ('k') | pdf/instance.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/pdf/renderer/ppb_pdf_impl.h" 5 #include "components/pdf/renderer/ppb_pdf_impl.h"
6 6
7 #include "base/files/scoped_file.h" 7 #include "base/files/scoped_file.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/numerics/safe_conversions.h" 9 #include "base/numerics/safe_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 } 323 }
324 324
325 void SetLinkUnderCursor(PP_Instance instance_id, const char* url) { 325 void SetLinkUnderCursor(PP_Instance instance_id, const char* url) {
326 content::PepperPluginInstance* instance = 326 content::PepperPluginInstance* instance =
327 content::PepperPluginInstance::Get(instance_id); 327 content::PepperPluginInstance::Get(instance_id);
328 if (!instance) 328 if (!instance)
329 return; 329 return;
330 instance->SetLinkUnderCursor(url); 330 instance->SetLinkUnderCursor(url);
331 } 331 }
332 332
333 void GetV8ExternalSnapshotData(const char** natives_data_out, 333 void GetV8ExternalSnapshotData(PP_Instance instance_id,
334 const char** natives_data_out,
334 int* natives_size_out, 335 int* natives_size_out,
335 const char** snapshot_data_out, 336 const char** snapshot_data_out,
336 int* snapshot_size_out) { 337 int* snapshot_size_out) {
337 gin::IsolateHolder::GetV8ExternalSnapshotData(natives_data_out, 338 gin::IsolateHolder::GetV8ExternalSnapshotData(natives_data_out,
338 natives_size_out, snapshot_data_out, snapshot_size_out); 339 natives_size_out, snapshot_data_out, snapshot_size_out);
339 } 340 }
340 341
341 const PPB_PDF ppb_pdf = { // 342 const PPB_PDF ppb_pdf = { //
342 &GetLocalizedString, // 343 &GetLocalizedString, //
343 &GetResourceImage, // 344 &GetResourceImage, //
(...skipping 28 matching lines...) Expand all
372 bool PPB_PDF_Impl::InvokePrintingForInstance(PP_Instance instance_id) { 373 bool PPB_PDF_Impl::InvokePrintingForInstance(PP_Instance instance_id) {
373 return g_print_client ? g_print_client->Print(instance_id) : false; 374 return g_print_client ? g_print_client->Print(instance_id) : false;
374 } 375 }
375 376
376 void PPB_PDF_Impl::SetPrintClient(PPB_PDF_Impl::PrintClient* client) { 377 void PPB_PDF_Impl::SetPrintClient(PPB_PDF_Impl::PrintClient* client) {
377 CHECK(!g_print_client) << "There should only be a single PrintClient."; 378 CHECK(!g_print_client) << "There should only be a single PrintClient.";
378 g_print_client = client; 379 g_print_client = client;
379 } 380 }
380 381
381 } // namespace pdf 382 } // namespace pdf
OLDNEW
« no previous file with comments | « chrome/plugin/chrome_content_plugin_client.cc ('k') | pdf/instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698