| OLD | NEW |
| 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/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "base/threading/thread_local.h" | 12 #include "base/threading/thread_local.h" |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "components/pdf/common/pdf_messages.h" | 14 #include "components/pdf/common/pdf_messages.h" |
| 15 #include "components/pdf/renderer/pdf_resource_util.h" | 15 #include "components/pdf/renderer/pdf_resource_util.h" |
| 16 #include "content/public/common/child_process_sandbox_support_linux.h" | 16 #include "content/public/common/child_process_sandbox_support_linux.h" |
| 17 #include "content/public/common/referrer.h" | 17 #include "content/public/common/referrer.h" |
| 18 #include "content/public/renderer/pepper_plugin_instance.h" | 18 #include "content/public/renderer/pepper_plugin_instance.h" |
| 19 #include "content/public/renderer/render_thread.h" | 19 #include "content/public/renderer/render_thread.h" |
| 20 #include "content/public/renderer/render_view.h" | 20 #include "content/public/renderer/render_view.h" |
| 21 #include "gin/public/isolate_holder.h" | 21 #include "gin/v8_startup_data.h" |
| 22 #include "ppapi/c/pp_resource.h" | 22 #include "ppapi/c/pp_resource.h" |
| 23 #include "ppapi/c/private/ppb_pdf.h" | 23 #include "ppapi/c/private/ppb_pdf.h" |
| 24 #include "ppapi/c/trusted/ppb_browser_font_trusted.h" | 24 #include "ppapi/c/trusted/ppb_browser_font_trusted.h" |
| 25 #include "ppapi/shared_impl/ppapi_globals.h" | 25 #include "ppapi/shared_impl/ppapi_globals.h" |
| 26 #include "ppapi/shared_impl/resource.h" | 26 #include "ppapi/shared_impl/resource.h" |
| 27 #include "ppapi/shared_impl/resource_tracker.h" | 27 #include "ppapi/shared_impl/resource_tracker.h" |
| 28 #include "ppapi/shared_impl/var.h" | 28 #include "ppapi/shared_impl/var.h" |
| 29 #include "third_party/WebKit/public/web/WebDocument.h" | 29 #include "third_party/WebKit/public/web/WebDocument.h" |
| 30 #include "third_party/WebKit/public/web/WebElement.h" | 30 #include "third_party/WebKit/public/web/WebElement.h" |
| 31 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 31 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 if (!instance) | 336 if (!instance) |
| 337 return; | 337 return; |
| 338 instance->SetLinkUnderCursor(url); | 338 instance->SetLinkUnderCursor(url); |
| 339 } | 339 } |
| 340 | 340 |
| 341 void GetV8ExternalSnapshotData(PP_Instance instance_id, | 341 void GetV8ExternalSnapshotData(PP_Instance instance_id, |
| 342 const char** natives_data_out, | 342 const char** natives_data_out, |
| 343 int* natives_size_out, | 343 int* natives_size_out, |
| 344 const char** snapshot_data_out, | 344 const char** snapshot_data_out, |
| 345 int* snapshot_size_out) { | 345 int* snapshot_size_out) { |
| 346 gin::IsolateHolder::GetV8ExternalSnapshotData(natives_data_out, | 346 gin::V8StartupData::GetV8ExternalSnapshotData( |
| 347 natives_size_out, snapshot_data_out, snapshot_size_out); | 347 natives_data_out, natives_size_out, snapshot_data_out, snapshot_size_out); |
| 348 } | 348 } |
| 349 | 349 |
| 350 const PPB_PDF ppb_pdf = { // | 350 const PPB_PDF ppb_pdf = { // |
| 351 &GetLocalizedString, // | 351 &GetLocalizedString, // |
| 352 &GetResourceImage, // | 352 &GetResourceImage, // |
| 353 &GetFontFileWithFallback, // | 353 &GetFontFileWithFallback, // |
| 354 &GetFontTableForPrivateFontFile, // | 354 &GetFontTableForPrivateFontFile, // |
| 355 &SearchString, // | 355 &SearchString, // |
| 356 &DidStartLoading, // | 356 &DidStartLoading, // |
| 357 &DidStopLoading, // | 357 &DidStopLoading, // |
| (...skipping 26 matching lines...) Expand all Loading... |
| 384 : false; | 384 : false; |
| 385 } | 385 } |
| 386 | 386 |
| 387 void PPB_PDF_Impl::SetPrintClient(PPB_PDF_Impl::PrintClient* client) { | 387 void PPB_PDF_Impl::SetPrintClient(PPB_PDF_Impl::PrintClient* client) { |
| 388 CHECK(!g_print_client_tls.Pointer()->Get()) | 388 CHECK(!g_print_client_tls.Pointer()->Get()) |
| 389 << "There should only be a single PrintClient for one RenderThread."; | 389 << "There should only be a single PrintClient for one RenderThread."; |
| 390 g_print_client_tls.Pointer()->Set(client); | 390 g_print_client_tls.Pointer()->Set(client); |
| 391 } | 391 } |
| 392 | 392 |
| 393 } // namespace pdf | 393 } // namespace pdf |
| OLD | NEW |