Chromium Code Reviews| 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" |
| 11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 12 #include "base/metrics/user_metrics_action.h" | 12 #include "base/metrics/user_metrics_action.h" |
| 13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "chrome/common/chrome_paths.h" | 17 #include "chrome/common/chrome_paths.h" |
| 18 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
| 19 #include "chrome/common/chrome_version_info.h" | 19 #include "chrome/common/chrome_version_info.h" |
| 20 #include "chrome/common/crash_keys.h" | 20 #include "chrome/common/crash_keys.h" |
| 21 #include "chrome/common/extensions/extension_metrics.h" | 21 #include "chrome/common/extensions/extension_metrics.h" |
| 22 #include "chrome/common/localized_error.h" | 22 #include "chrome/common/localized_error.h" |
| 23 #include "chrome/common/origin_util.h" | |
| 23 #include "chrome/common/pepper_permission_util.h" | 24 #include "chrome/common/pepper_permission_util.h" |
| 24 #include "chrome/common/render_messages.h" | 25 #include "chrome/common/render_messages.h" |
| 25 #include "chrome/common/url_constants.h" | 26 #include "chrome/common/url_constants.h" |
| 26 #include "chrome/grit/generated_resources.h" | 27 #include "chrome/grit/generated_resources.h" |
| 27 #include "chrome/grit/locale_settings.h" | 28 #include "chrome/grit/locale_settings.h" |
| 28 #include "chrome/grit/renderer_resources.h" | 29 #include "chrome/grit/renderer_resources.h" |
| 29 #include "chrome/renderer/benchmarking_extension.h" | 30 #include "chrome/renderer/benchmarking_extension.h" |
| 30 #include "chrome/renderer/chrome_render_frame_observer.h" | 31 #include "chrome/renderer/chrome_render_frame_observer.h" |
| 31 #include "chrome/renderer/chrome_render_process_observer.h" | 32 #include "chrome/renderer/chrome_render_process_observer.h" |
| 32 #include "chrome/renderer/chrome_render_view_observer.h" | 33 #include "chrome/renderer/chrome_render_view_observer.h" |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 502 // Report if the renderer process has been patched by chrome_elf. | 503 // Report if the renderer process has been patched by chrome_elf. |
| 503 // TODO(csharp): Remove once the renderer is no longer getting | 504 // TODO(csharp): Remove once the renderer is no longer getting |
| 504 // patched this way. | 505 // patched this way. |
| 505 if (blacklist::IsBlacklistInitialized()) | 506 if (blacklist::IsBlacklistInitialized()) |
| 506 UMA_HISTOGRAM_BOOLEAN("Blacklist.PatchedInRenderer", true); | 507 UMA_HISTOGRAM_BOOLEAN("Blacklist.PatchedInRenderer", true); |
| 507 #endif | 508 #endif |
| 508 #if defined(ENABLE_PRINT_PREVIEW) | 509 #if defined(ENABLE_PRINT_PREVIEW) |
| 509 pdf_print_client_.reset(new ChromePDFPrintClient()); | 510 pdf_print_client_.reset(new ChromePDFPrintClient()); |
| 510 pdf::PPB_PDF_Impl::SetPrintClient(pdf_print_client_.get()); | 511 pdf::PPB_PDF_Impl::SetPrintClient(pdf_print_client_.get()); |
| 511 #endif | 512 #endif |
| 513 | |
| 514 const std::set<GURL>& origins = GetWhiteListedSecureOrigins(); | |
| 515 for (const GURL& origin : origins) | |
|
palmer
2015/04/20 22:16:18
Nit: auto here too?
| |
| 516 WebSecurityPolicy::addOriginTrustworthyWhiteList(origin); | |
| 512 } | 517 } |
| 513 | 518 |
| 514 void ChromeContentRendererClient::RenderFrameCreated( | 519 void ChromeContentRendererClient::RenderFrameCreated( |
| 515 content::RenderFrame* render_frame) { | 520 content::RenderFrame* render_frame) { |
| 516 new ChromeRenderFrameObserver(render_frame); | 521 new ChromeRenderFrameObserver(render_frame); |
| 517 | 522 |
| 518 bool should_whitelist_for_content_settings = | 523 bool should_whitelist_for_content_settings = |
| 519 base::CommandLine::ForCurrentProcess()->HasSwitch( | 524 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 520 switches::kInstantProcess); | 525 switches::kInstantProcess); |
| 521 extensions::Dispatcher* ext_dispatcher = NULL; | 526 extensions::Dispatcher* ext_dispatcher = NULL; |
| (...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1639 | 1644 |
| 1640 void ChromeContentRendererClient::RecordRappor(const std::string& metric, | 1645 void ChromeContentRendererClient::RecordRappor(const std::string& metric, |
| 1641 const std::string& sample) { | 1646 const std::string& sample) { |
| 1642 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRappor(metric, sample)); | 1647 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRappor(metric, sample)); |
| 1643 } | 1648 } |
| 1644 | 1649 |
| 1645 void ChromeContentRendererClient::RecordRapporURL(const std::string& metric, | 1650 void ChromeContentRendererClient::RecordRapporURL(const std::string& metric, |
| 1646 const GURL& url) { | 1651 const GURL& url) { |
| 1647 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRapporURL(metric, url)); | 1652 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRapporURL(metric, url)); |
| 1648 } | 1653 } |
| OLD | NEW |