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 "chrome/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/crash_logging.h" | 8 #include "base/debug/crash_logging.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #include "chrome/renderer/worker_content_settings_client_proxy.h" | 56 #include "chrome/renderer/worker_content_settings_client_proxy.h" |
57 #include "components/autofill/content/renderer/autofill_agent.h" | 57 #include "components/autofill/content/renderer/autofill_agent.h" |
58 #include "components/autofill/content/renderer/password_autofill_agent.h" | 58 #include "components/autofill/content/renderer/password_autofill_agent.h" |
59 #include "components/autofill/content/renderer/password_generation_agent.h" | 59 #include "components/autofill/content/renderer/password_generation_agent.h" |
60 #include "components/content_settings/core/common/content_settings_pattern.h" | 60 #include "components/content_settings/core/common/content_settings_pattern.h" |
61 #include "components/dom_distiller/core/url_constants.h" | 61 #include "components/dom_distiller/core/url_constants.h" |
62 #include "components/nacl/renderer/ppb_nacl_private.h" | 62 #include "components/nacl/renderer/ppb_nacl_private.h" |
63 #include "components/nacl/renderer/ppb_nacl_private_impl.h" | 63 #include "components/nacl/renderer/ppb_nacl_private_impl.h" |
64 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" | 64 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" |
65 #include "components/password_manager/content/renderer/credential_manager_client
.h" | 65 #include "components/password_manager/content/renderer/credential_manager_client
.h" |
66 #include "components/pdf/renderer/ppb_pdf_impl.h" | 66 #include "components/pdf/renderer/pepper_pdf_host.h" |
67 #include "components/plugins/renderer/mobile_youtube_plugin.h" | 67 #include "components/plugins/renderer/mobile_youtube_plugin.h" |
68 #include "components/signin/core/common/profile_management_switches.h" | 68 #include "components/signin/core/common/profile_management_switches.h" |
69 #include "components/visitedlink/renderer/visitedlink_slave.h" | 69 #include "components/visitedlink/renderer/visitedlink_slave.h" |
70 #include "components/web_cache/renderer/web_cache_render_process_observer.h" | 70 #include "components/web_cache/renderer/web_cache_render_process_observer.h" |
71 #include "content/public/common/content_constants.h" | 71 #include "content/public/common/content_constants.h" |
72 #include "content/public/renderer/plugin_instance_throttler.h" | 72 #include "content/public/renderer/plugin_instance_throttler.h" |
73 #include "content/public/renderer/render_frame.h" | 73 #include "content/public/renderer/render_frame.h" |
74 #include "content/public/renderer/render_thread.h" | 74 #include "content/public/renderer/render_thread.h" |
75 #include "content/public/renderer/render_view.h" | 75 #include "content/public/renderer/render_view.h" |
76 #include "content/public/renderer/render_view_visitor.h" | 76 #include "content/public/renderer/render_view_visitor.h" |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 | 500 |
501 #if defined(OS_WIN) | 501 #if defined(OS_WIN) |
502 // Report if the renderer process has been patched by chrome_elf. | 502 // Report if the renderer process has been patched by chrome_elf. |
503 // TODO(csharp): Remove once the renderer is no longer getting | 503 // TODO(csharp): Remove once the renderer is no longer getting |
504 // patched this way. | 504 // patched this way. |
505 if (blacklist::IsBlacklistInitialized()) | 505 if (blacklist::IsBlacklistInitialized()) |
506 UMA_HISTOGRAM_BOOLEAN("Blacklist.PatchedInRenderer", true); | 506 UMA_HISTOGRAM_BOOLEAN("Blacklist.PatchedInRenderer", true); |
507 #endif | 507 #endif |
508 #if defined(ENABLE_PRINT_PREVIEW) | 508 #if defined(ENABLE_PRINT_PREVIEW) |
509 pdf_print_client_.reset(new ChromePDFPrintClient()); | 509 pdf_print_client_.reset(new ChromePDFPrintClient()); |
510 pdf::PPB_PDF_Impl::SetPrintClient(pdf_print_client_.get()); | 510 pdf::PepperPDFHost::SetPrintClient(pdf_print_client_.get()); |
511 #endif | 511 #endif |
512 | 512 |
513 std::set<GURL> origins; | 513 std::set<GURL> origins; |
514 GetSecureOriginWhitelist(&origins); | 514 GetSecureOriginWhitelist(&origins); |
515 for (const GURL& origin : origins) { | 515 for (const GURL& origin : origins) { |
516 WebSecurityPolicy::addOriginTrustworthyWhiteList( | 516 WebSecurityPolicy::addOriginTrustworthyWhiteList( |
517 WebSecurityOrigin::create(origin)); | 517 WebSecurityOrigin::create(origin)); |
518 } | 518 } |
519 } | 519 } |
520 | 520 |
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1478 #if defined(ENABLE_EXTENSIONS) | 1478 #if defined(ENABLE_EXTENSIONS) |
1479 return g_current_client->extension_dispatcher_ | 1479 return g_current_client->extension_dispatcher_ |
1480 ->WasWebRequestUsedBySomeExtensions(); | 1480 ->WasWebRequestUsedBySomeExtensions(); |
1481 #else | 1481 #else |
1482 return false; | 1482 return false; |
1483 #endif | 1483 #endif |
1484 } | 1484 } |
1485 | 1485 |
1486 const void* ChromeContentRendererClient::CreatePPAPIInterface( | 1486 const void* ChromeContentRendererClient::CreatePPAPIInterface( |
1487 const std::string& interface_name) { | 1487 const std::string& interface_name) { |
1488 #if defined(ENABLE_PLUGINS) | 1488 #if defined(ENABLE_PLUGINS) && !defined(DISABLE_NACL) |
1489 #if !defined(DISABLE_NACL) | |
1490 if (interface_name == PPB_NACL_PRIVATE_INTERFACE) | 1489 if (interface_name == PPB_NACL_PRIVATE_INTERFACE) |
1491 return nacl::GetNaClPrivateInterface(); | 1490 return nacl::GetNaClPrivateInterface(); |
1492 #endif // DISABLE_NACL | |
1493 if (interface_name == PPB_PDF_INTERFACE) | |
1494 return pdf::PPB_PDF_Impl::GetInterface(); | |
1495 #endif | 1491 #endif |
1496 return NULL; | 1492 return NULL; |
1497 } | 1493 } |
1498 | 1494 |
1499 bool ChromeContentRendererClient::IsExternalPepperPlugin( | 1495 bool ChromeContentRendererClient::IsExternalPepperPlugin( |
1500 const std::string& module_name) { | 1496 const std::string& module_name) { |
1501 // TODO(bbudge) remove this when the trusted NaCl plugin has been removed. | 1497 // TODO(bbudge) remove this when the trusted NaCl plugin has been removed. |
1502 // We must defer certain plugin events for NaCl instances since we switch | 1498 // We must defer certain plugin events for NaCl instances since we switch |
1503 // from the in-process to the out-of-process proxy after instantiating them. | 1499 // from the in-process to the out-of-process proxy after instantiating them. |
1504 return module_name == "Native Client"; | 1500 return module_name == "Native Client"; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1645 | 1641 |
1646 void ChromeContentRendererClient::RecordRappor(const std::string& metric, | 1642 void ChromeContentRendererClient::RecordRappor(const std::string& metric, |
1647 const std::string& sample) { | 1643 const std::string& sample) { |
1648 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRappor(metric, sample)); | 1644 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRappor(metric, sample)); |
1649 } | 1645 } |
1650 | 1646 |
1651 void ChromeContentRendererClient::RecordRapporURL(const std::string& metric, | 1647 void ChromeContentRendererClient::RecordRapporURL(const std::string& metric, |
1652 const GURL& url) { | 1648 const GURL& url) { |
1653 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRapporURL(metric, url)); | 1649 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRapporURL(metric, url)); |
1654 } | 1650 } |
OLD | NEW |