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

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

Issue 1415923015: Downgrade lock icon for broken-HTTPS subresources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove console message; see comment to mike Created 5 years 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 27 matching lines...) Expand all
38 #include "content/child/weburlresponse_extradata_impl.h" 38 #include "content/child/weburlresponse_extradata_impl.h"
39 #include "content/common/accessibility_messages.h" 39 #include "content/common/accessibility_messages.h"
40 #include "content/common/clipboard_messages.h" 40 #include "content/common/clipboard_messages.h"
41 #include "content/common/frame_messages.h" 41 #include "content/common/frame_messages.h"
42 #include "content/common/frame_replication_state.h" 42 #include "content/common/frame_replication_state.h"
43 #include "content/common/input_messages.h" 43 #include "content/common/input_messages.h"
44 #include "content/common/navigation_params.h" 44 #include "content/common/navigation_params.h"
45 #include "content/common/savable_subframe.h" 45 #include "content/common/savable_subframe.h"
46 #include "content/common/service_worker/service_worker_types.h" 46 #include "content/common/service_worker/service_worker_types.h"
47 #include "content/common/site_isolation_policy.h" 47 #include "content/common/site_isolation_policy.h"
48 #include "content/common/ssl_status_serialization.h"
48 #include "content/common/swapped_out_messages.h" 49 #include "content/common/swapped_out_messages.h"
49 #include "content/common/view_messages.h" 50 #include "content/common/view_messages.h"
50 #include "content/public/common/bindings_policy.h" 51 #include "content/public/common/bindings_policy.h"
51 #include "content/public/common/content_constants.h" 52 #include "content/public/common/content_constants.h"
52 #include "content/public/common/content_switches.h" 53 #include "content/public/common/content_switches.h"
53 #include "content/public/common/context_menu_params.h" 54 #include "content/public/common/context_menu_params.h"
54 #include "content/public/common/isolated_world_ids.h" 55 #include "content/public/common/isolated_world_ids.h"
55 #include "content/public/common/page_state.h" 56 #include "content/public/common/page_state.h"
56 #include "content/public/common/resource_response.h" 57 #include "content/public/common/resource_response.h"
57 #include "content/public/common/url_constants.h" 58 #include "content/public/common/url_constants.h"
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 return navigation_type == FrameMsg_Navigate_Type::RELOAD || 535 return navigation_type == FrameMsg_Navigate_Type::RELOAD ||
535 navigation_type == FrameMsg_Navigate_Type::RELOAD_IGNORING_CACHE || 536 navigation_type == FrameMsg_Navigate_Type::RELOAD_IGNORING_CACHE ||
536 navigation_type == FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL; 537 navigation_type == FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL;
537 } 538 }
538 539
539 RenderFrameImpl::CreateRenderFrameImplFunction g_create_render_frame_impl = 540 RenderFrameImpl::CreateRenderFrameImplFunction g_create_render_frame_impl =
540 nullptr; 541 nullptr;
541 542
542 void OnGotContentHandlerID(uint32_t content_handler_id) {} 543 void OnGotContentHandlerID(uint32_t content_handler_id) {}
543 544
545 bool IsContentWithCertificateErrorsRelevantToUI(
546 const blink::WebURL& url,
547 const blink::WebCString& security_info,
548 const blink::WebURL& main_resource_url,
549 const blink::WebCString& main_resource_security_info) {
550 content::SSLStatus ssl_status;
551 content::SSLStatus main_resource_ssl_status;
552 CHECK(DeserializeSecurityInfo(security_info, &ssl_status));
553 CHECK(DeserializeSecurityInfo(main_resource_security_info,
554 &main_resource_ssl_status));
555
556 if (!GURL(main_resource_url).SchemeIsCryptographic())
557 return false;
558
559 // Do not handle subresource certificate errors if they are the same
560 // as errors that occured during the main page load. This compares
561 // most, but not all, fields of SSLStatus. For example, this check
562 // does not compare |content_status| because the navigation entry
563 // might have mixed content but also have the exact same SSL
564 // connection properties as the subresource, thereby making the
565 // subresource errors duplicative.
566 return (!url::Origin(GURL(url))
567 .IsSameOriginWith(url::Origin(GURL(main_resource_url))) ||
568 main_resource_ssl_status.security_style !=
569 ssl_status.security_style ||
570 main_resource_ssl_status.cert_id != ssl_status.cert_id ||
571 main_resource_ssl_status.cert_status != ssl_status.cert_status ||
572 main_resource_ssl_status.security_bits != ssl_status.security_bits ||
573 main_resource_ssl_status.connection_status !=
574 ssl_status.connection_status);
575 }
576
544 } // namespace 577 } // namespace
545 578
546 // static 579 // static
547 RenderFrameImpl* RenderFrameImpl::Create(RenderViewImpl* render_view, 580 RenderFrameImpl* RenderFrameImpl::Create(RenderViewImpl* render_view,
548 int32 routing_id) { 581 int32 routing_id) {
549 DCHECK(routing_id != MSG_ROUTING_NONE); 582 DCHECK(routing_id != MSG_ROUTING_NONE);
550 CreateParams params(render_view, routing_id); 583 CreateParams params(render_view, routing_id);
551 584
552 if (g_create_render_frame_impl) 585 if (g_create_render_frame_impl)
553 return g_create_render_frame_impl(params); 586 return g_create_render_frame_impl(params);
(...skipping 3065 matching lines...) Expand 10 before | Expand all | Expand 10 after
3619 } 3652 }
3620 3653
3621 void RenderFrameImpl::didDisplayInsecureContent() { 3654 void RenderFrameImpl::didDisplayInsecureContent() {
3622 Send(new FrameHostMsg_DidDisplayInsecureContent(routing_id_)); 3655 Send(new FrameHostMsg_DidDisplayInsecureContent(routing_id_));
3623 } 3656 }
3624 3657
3625 void RenderFrameImpl::didRunInsecureContent( 3658 void RenderFrameImpl::didRunInsecureContent(
3626 const blink::WebSecurityOrigin& origin, 3659 const blink::WebSecurityOrigin& origin,
3627 const blink::WebURL& target) { 3660 const blink::WebURL& target) {
3628 Send(new FrameHostMsg_DidRunInsecureContent( 3661 Send(new FrameHostMsg_DidRunInsecureContent(
3629 routing_id_, origin.toString().utf8(), target)); 3662 routing_id_, GURL(origin.toString().utf8()), target));
3630 GetContentClient()->renderer()->RecordRapporURL( 3663 GetContentClient()->renderer()->RecordRapporURL(
3631 "ContentSettings.MixedScript.RanMixedScript", 3664 "ContentSettings.MixedScript.RanMixedScript",
3632 GURL(origin.toString().utf8())); 3665 GURL(origin.toString().utf8()));
3633 } 3666 }
3634 3667
3668 void RenderFrameImpl::didDisplayContentWithCertificateErrors(
3669 const blink::WebURL& url,
3670 const blink::WebCString& security_info,
3671 const blink::WebURL& main_resource_url,
3672 const blink::WebCString& main_resource_security_info) {
3673 if (!IsContentWithCertificateErrorsRelevantToUI(
3674 url, security_info, main_resource_url, main_resource_security_info)) {
3675 return;
3676 }
3677 Send(new FrameHostMsg_DidDisplayContentWithCertificateErrors(routing_id_, url,
3678 security_info));
3679 }
3680
3681 void RenderFrameImpl::didRunContentWithCertificateErrors(
3682 const blink::WebURL& url,
3683 const blink::WebCString& security_info,
3684 const blink::WebURL& main_resource_url,
3685 const blink::WebCString& main_resource_security_info) {
3686 if (!IsContentWithCertificateErrorsRelevantToUI(
3687 url, security_info, main_resource_url, main_resource_security_info)) {
3688 return;
3689 }
3690 Send(new FrameHostMsg_DidRunContentWithCertificateErrors(
3691 routing_id_, GURL(main_resource_url).GetOrigin(), url, security_info));
3692 }
3693
3635 void RenderFrameImpl::didChangePerformanceTiming() { 3694 void RenderFrameImpl::didChangePerformanceTiming() {
3636 FOR_EACH_OBSERVER(RenderFrameObserver, 3695 FOR_EACH_OBSERVER(RenderFrameObserver,
3637 observers_, 3696 observers_,
3638 DidChangePerformanceTiming()); 3697 DidChangePerformanceTiming());
3639 } 3698 }
3640 3699
3641 void RenderFrameImpl::didAbortLoading(blink::WebLocalFrame* frame) { 3700 void RenderFrameImpl::didAbortLoading(blink::WebLocalFrame* frame) {
3642 DCHECK(!frame_ || frame_ == frame); 3701 DCHECK(!frame_ || frame_ == frame);
3643 #if defined(ENABLE_PLUGINS) 3702 #if defined(ENABLE_PLUGINS)
3644 if (frame != render_view_->webview()->mainFrame()) 3703 if (frame != render_view_->webview()->mainFrame())
(...skipping 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after
5361 media::ConvertToSwitchOutputDeviceCB(web_callbacks); 5420 media::ConvertToSwitchOutputDeviceCB(web_callbacks);
5362 scoped_refptr<media::AudioOutputDevice> device = 5421 scoped_refptr<media::AudioOutputDevice> device =
5363 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(), 5422 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(),
5364 security_origin); 5423 security_origin);
5365 media::OutputDeviceStatus status = device->GetDeviceStatus(); 5424 media::OutputDeviceStatus status = device->GetDeviceStatus();
5366 device->Stop(); 5425 device->Stop();
5367 callback.Run(status); 5426 callback.Run(status);
5368 } 5427 }
5369 5428
5370 } // namespace content 5429 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | third_party/WebKit/Source/core/loader/EmptyClients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698