OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
99 #include "gin/modules/module_registry.h" | 99 #include "gin/modules/module_registry.h" |
100 #include "media/base/audio_renderer_mixer_input.h" | 100 #include "media/base/audio_renderer_mixer_input.h" |
101 #include "media/base/media_log.h" | 101 #include "media/base/media_log.h" |
102 #include "media/blink/webcontentdecryptionmodule_impl.h" | 102 #include "media/blink/webcontentdecryptionmodule_impl.h" |
103 #include "media/blink/webencryptedmediaclient_impl.h" | 103 #include "media/blink/webencryptedmediaclient_impl.h" |
104 #include "media/blink/webmediaplayer_impl.h" | 104 #include "media/blink/webmediaplayer_impl.h" |
105 #include "media/blink/webmediaplayer_params.h" | 105 #include "media/blink/webmediaplayer_params.h" |
106 #include "media/filters/gpu_video_accelerator_factories.h" | 106 #include "media/filters/gpu_video_accelerator_factories.h" |
107 #include "net/base/data_url.h" | 107 #include "net/base/data_url.h" |
108 #include "net/base/net_errors.h" | 108 #include "net/base/net_errors.h" |
109 #include "net/base/net_util.h" | |
109 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 110 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
111 #include "net/cert/cert_status_flags.h" | |
110 #include "net/http/http_util.h" | 112 #include "net/http/http_util.h" |
111 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" | 113 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" |
112 #include "third_party/WebKit/public/platform/WebString.h" | 114 #include "third_party/WebKit/public/platform/WebString.h" |
113 #include "third_party/WebKit/public/platform/WebURL.h" | 115 #include "third_party/WebKit/public/platform/WebURL.h" |
114 #include "third_party/WebKit/public/platform/WebURLError.h" | 116 #include "third_party/WebKit/public/platform/WebURLError.h" |
115 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 117 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
116 #include "third_party/WebKit/public/platform/WebVector.h" | 118 #include "third_party/WebKit/public/platform/WebVector.h" |
117 #include "third_party/WebKit/public/web/WebColorSuggestion.h" | 119 #include "third_party/WebKit/public/web/WebColorSuggestion.h" |
120 #include "third_party/WebKit/public/web/WebConsoleMessage.h" | |
118 #include "third_party/WebKit/public/web/WebDocument.h" | 121 #include "third_party/WebKit/public/web/WebDocument.h" |
119 #include "third_party/WebKit/public/web/WebFrameWidget.h" | 122 #include "third_party/WebKit/public/web/WebFrameWidget.h" |
120 #include "third_party/WebKit/public/web/WebGlyphCache.h" | 123 #include "third_party/WebKit/public/web/WebGlyphCache.h" |
121 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 124 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
122 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" | 125 #include "third_party/WebKit/public/web/WebMediaStreamRegistry.h" |
123 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" | 126 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" |
124 #include "third_party/WebKit/public/web/WebPlugin.h" | 127 #include "third_party/WebKit/public/web/WebPlugin.h" |
125 #include "third_party/WebKit/public/web/WebPluginParams.h" | 128 #include "third_party/WebKit/public/web/WebPluginParams.h" |
126 #include "third_party/WebKit/public/web/WebPluginPlaceholder.h" | 129 #include "third_party/WebKit/public/web/WebPluginPlaceholder.h" |
127 #include "third_party/WebKit/public/web/WebRange.h" | 130 #include "third_party/WebKit/public/web/WebRange.h" |
(...skipping 2601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2729 TRACE_EVENT_INSTANT0("WebCore", "LoadFinished", | 2732 TRACE_EVENT_INSTANT0("WebCore", "LoadFinished", |
2730 TRACE_EVENT_SCOPE_PROCESS); | 2733 TRACE_EVENT_SCOPE_PROCESS); |
2731 } | 2734 } |
2732 document_state->set_finish_load_time(Time::Now()); | 2735 document_state->set_finish_load_time(Time::Now()); |
2733 } | 2736 } |
2734 | 2737 |
2735 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(), | 2738 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(), |
2736 DidFinishLoad(frame)); | 2739 DidFinishLoad(frame)); |
2737 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, DidFinishLoad()); | 2740 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, DidFinishLoad()); |
2738 | 2741 |
2742 // If the navigation is to a localhost URL (and the flag is set to | |
2743 // allow localhost SSL misconfigurations), print a warning to the | |
2744 // console telling the developer to check their SSL configuration | |
2745 // before going to production. | |
davidben
2015/02/11 04:13:14
This only pays attention to the navigation request
estark
2015/02/11 18:54:42
Done -- mostly. DidCommitProvisionalLoad doesn't s
davidben
2015/02/11 19:41:35
Huh. I guess some things are ordered funny. I wond
| |
2746 bool allow_localhost = base::CommandLine::ForCurrentProcess()->HasSwitch( | |
2747 switches::kAllowInsecureLocalhost); | |
2748 | |
2749 if (allow_localhost) { | |
2750 SSLStatus ssl_status = render_view_->GetSSLStatusOfFrame(frame_); | |
2751 bool is_cert_error = net::IsCertStatusError(ssl_status.cert_status) && | |
2752 !net::IsCertStatusMinorError(ssl_status.cert_status); | |
2753 bool is_localhost = net::IsLocalhost(GURL(ds->request().url()).host()); | |
2754 | |
2755 if (is_cert_error && is_localhost) { | |
2756 frame_->addMessageToConsole(blink::WebConsoleMessage( | |
2757 blink::WebConsoleMessage::LevelWarning, | |
2758 base::ASCIIToUTF16( | |
2759 "This site does not have a valid SSL " | |
2760 "certificate! Without SSL, your site's and " | |
2761 "visitors' data is vulnerable to theft and " | |
2762 "tampering. Get a valid SSL certificate before" | |
2763 " releasing your website to the public."))); | |
2764 } | |
2765 } | |
2766 | |
2739 // Don't send this message while the frame is swapped out. | 2767 // Don't send this message while the frame is swapped out. |
2740 if (is_swapped_out()) | 2768 if (is_swapped_out()) |
2741 return; | 2769 return; |
2742 | 2770 |
2743 Send(new FrameHostMsg_DidFinishLoad(routing_id_, | 2771 Send(new FrameHostMsg_DidFinishLoad(routing_id_, |
2744 ds->request().url())); | 2772 ds->request().url())); |
2745 } | 2773 } |
2746 | 2774 |
2747 void RenderFrameImpl::didNavigateWithinPage(blink::WebLocalFrame* frame, | 2775 void RenderFrameImpl::didNavigateWithinPage(blink::WebLocalFrame* frame, |
2748 const blink::WebHistoryItem& item, | 2776 const blink::WebHistoryItem& item, |
(...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4474 | 4502 |
4475 #if defined(ENABLE_BROWSER_CDMS) | 4503 #if defined(ENABLE_BROWSER_CDMS) |
4476 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 4504 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
4477 if (!cdm_manager_) | 4505 if (!cdm_manager_) |
4478 cdm_manager_ = new RendererCdmManager(this); | 4506 cdm_manager_ = new RendererCdmManager(this); |
4479 return cdm_manager_; | 4507 return cdm_manager_; |
4480 } | 4508 } |
4481 #endif // defined(ENABLE_BROWSER_CDMS) | 4509 #endif // defined(ENABLE_BROWSER_CDMS) |
4482 | 4510 |
4483 } // namespace content | 4511 } // namespace content |
OLD | NEW |