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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 887223005: Skip interstitials and don't block requests for localhost SSL errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes from previous round of feedback Created 5 years, 10 months 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
OLDNEW
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
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 2607 matching lines...) Expand 10 before | Expand all | Expand 10 after
2735 TRACE_EVENT_INSTANT0("WebCore", "LoadFinished", 2738 TRACE_EVENT_INSTANT0("WebCore", "LoadFinished",
2736 TRACE_EVENT_SCOPE_PROCESS); 2739 TRACE_EVENT_SCOPE_PROCESS);
2737 } 2740 }
2738 document_state->set_finish_load_time(Time::Now()); 2741 document_state->set_finish_load_time(Time::Now());
2739 } 2742 }
2740 2743
2741 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(), 2744 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers(),
2742 DidFinishLoad(frame)); 2745 DidFinishLoad(frame));
2743 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, DidFinishLoad()); 2746 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, DidFinishLoad());
2744 2747
2748 // If the navigation is to a localhost URL (and the flag is set to
2749 // allow localhost SSL misconfigurations), print a warning to the
2750 // console telling the developer to check their SSL configuration
2751 // before going to production.
2752 bool allow_localhost =
2753 base::CommandLine::ForCurrentProcess()->HasSwitch(
2754 switches::kAllowInsecureLocalhost);
2755
2756 if (allow_localhost) {
2757 SSLStatus ssl_status = render_view_->GetSSLStatusOfFrame(frame_);
2758 bool is_cert_error = net::IsCertStatusError(ssl_status.cert_status);
Ryan Sleevi 2015/02/09 19:31:34 Note: We only block for IsCertStatusError && !IsCe
estark 2015/02/09 20:48:40 Done.
2759 bool is_localhost = net::IsLocalhost(GURL(ds->request().url()).host());
2760
2761 if (is_cert_error && is_localhost) {
2762 frame_->addMessageToConsole(
2763 blink::WebConsoleMessage(
2764 blink::WebConsoleMessage::LevelWarning,
2765 base::ASCIIToUTF16("This site does not have a valid SSL "
2766 "certificate! Without SSL, your site's and "
2767 "visitors' data is vulnerable to theft and "
2768 "tampering. Get a valid SSL certificate before"
2769 " releasing your website to the public.")));
2770 }
2771 }
2772
2745 // Don't send this message while the frame is swapped out. 2773 // Don't send this message while the frame is swapped out.
2746 if (is_swapped_out()) 2774 if (is_swapped_out())
2747 return; 2775 return;
2748 2776
2749 Send(new FrameHostMsg_DidFinishLoad(routing_id_, 2777 Send(new FrameHostMsg_DidFinishLoad(routing_id_,
2750 ds->request().url())); 2778 ds->request().url()));
2751 } 2779 }
2752 2780
2753 void RenderFrameImpl::didNavigateWithinPage(blink::WebLocalFrame* frame, 2781 void RenderFrameImpl::didNavigateWithinPage(blink::WebLocalFrame* frame,
2754 const blink::WebHistoryItem& item, 2782 const blink::WebHistoryItem& item,
(...skipping 1722 matching lines...) Expand 10 before | Expand all | Expand 10 after
4477 4505
4478 #if defined(ENABLE_BROWSER_CDMS) 4506 #if defined(ENABLE_BROWSER_CDMS)
4479 RendererCdmManager* RenderFrameImpl::GetCdmManager() { 4507 RendererCdmManager* RenderFrameImpl::GetCdmManager() {
4480 if (!cdm_manager_) 4508 if (!cdm_manager_)
4481 cdm_manager_ = new RendererCdmManager(this); 4509 cdm_manager_ = new RendererCdmManager(this);
4482 return cdm_manager_; 4510 return cdm_manager_;
4483 } 4511 }
4484 #endif // defined(ENABLE_BROWSER_CDMS) 4512 #endif // defined(ENABLE_BROWSER_CDMS)
4485 4513
4486 } // namespace content 4514 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698