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

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

Issue 1489253002: Plumb document's strict mixed content checking for RemoteFrames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nasko comments 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
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_frame_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2495 matching lines...) Expand 10 before | Expand all | Expand 10 after
2506 // can be optimized further by only sending the update if there are any 2506 // can be optimized further by only sending the update if there are any
2507 // remote frames in the frame tree, or delaying and batching up IPCs if 2507 // remote frames in the frame tree, or delaying and batching up IPCs if
2508 // updates are happening too frequently. 2508 // updates are happening too frequently.
2509 if (SiteIsolationPolicy::AreCrossProcessFramesPossible() || 2509 if (SiteIsolationPolicy::AreCrossProcessFramesPossible() ||
2510 render_view_->renderer_preferences_.report_frame_name_changes) { 2510 render_view_->renderer_preferences_.report_frame_name_changes) {
2511 Send(new FrameHostMsg_DidChangeName( 2511 Send(new FrameHostMsg_DidChangeName(
2512 routing_id_, base::UTF16ToUTF8(base::StringPiece16(name)))); 2512 routing_id_, base::UTF16ToUTF8(base::StringPiece16(name))));
2513 } 2513 }
2514 } 2514 }
2515 2515
2516 void RenderFrameImpl::didEnforceStrictMixedContentChecking() {
2517 Send(new FrameHostMsg_EnforceStrictMixedContentChecking(routing_id_));
2518 }
2519
2516 void RenderFrameImpl::didChangeSandboxFlags(blink::WebFrame* child_frame, 2520 void RenderFrameImpl::didChangeSandboxFlags(blink::WebFrame* child_frame,
2517 blink::WebSandboxFlags flags) { 2521 blink::WebSandboxFlags flags) {
2518 Send(new FrameHostMsg_DidChangeSandboxFlags( 2522 Send(new FrameHostMsg_DidChangeSandboxFlags(
2519 routing_id_, GetRoutingIdForFrameOrProxy(child_frame), flags)); 2523 routing_id_, GetRoutingIdForFrameOrProxy(child_frame), flags));
2520 } 2524 }
2521 2525
2522 void RenderFrameImpl::didChangeFrameOwnerProperties( 2526 void RenderFrameImpl::didChangeFrameOwnerProperties(
2523 blink::WebFrame* child_frame, 2527 blink::WebFrame* child_frame,
2524 const blink::WebFrameOwnerProperties& frame_owner_properties) { 2528 const blink::WebFrameOwnerProperties& frame_owner_properties) {
2525 Send(new FrameHostMsg_DidChangeFrameOwnerProperties( 2529 Send(new FrameHostMsg_DidChangeFrameOwnerProperties(
(...skipping 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after
4159 // client to be based on the routing_id of the RenderFrameHost. 4163 // client to be based on the routing_id of the RenderFrameHost.
4160 params.render_view_routing_id = render_view_->routing_id(); 4164 params.render_view_routing_id = render_view_->routing_id();
4161 params.socket_address.set_host(response.remoteIPAddress().utf8()); 4165 params.socket_address.set_host(response.remoteIPAddress().utf8());
4162 params.socket_address.set_port(response.remotePort()); 4166 params.socket_address.set_port(response.remotePort());
4163 WebURLResponseExtraDataImpl* extra_data = GetExtraDataFromResponse(response); 4167 WebURLResponseExtraDataImpl* extra_data = GetExtraDataFromResponse(response);
4164 if (extra_data) 4168 if (extra_data)
4165 params.was_fetched_via_proxy = extra_data->was_fetched_via_proxy(); 4169 params.was_fetched_via_proxy = extra_data->was_fetched_via_proxy();
4166 params.was_within_same_page = navigation_state->WasWithinSamePage(); 4170 params.was_within_same_page = navigation_state->WasWithinSamePage();
4167 params.security_info = response.securityInfo(); 4171 params.security_info = response.securityInfo();
4168 4172
4169 // Set the URL to be displayed in the browser UI to the user.
4170 params.url = GetLoadingUrl();
4171 DCHECK(!is_swapped_out_ || params.url == GURL(kSwappedOutURL));
4172
4173 // Set the origin of the frame. This will be replicated to the corresponding 4173 // Set the origin of the frame. This will be replicated to the corresponding
4174 // RenderFrameProxies in other processes. 4174 // RenderFrameProxies in other processes.
4175 // TODO(alexmos): Origins for URLs with non-standard schemes are excluded due 4175 // TODO(alexmos): Origins for URLs with non-standard schemes are excluded due
4176 // to https://crbug.com/439608 and will be replicated as unique origins. 4176 // to https://crbug.com/439608 and will be replicated as unique origins.
4177 if (!is_swapped_out_) { 4177 if (!is_swapped_out_) {
4178 std::string scheme = frame->document().securityOrigin().protocol().utf8(); 4178 std::string scheme = frame->document().securityOrigin().protocol().utf8();
4179 if (url::IsStandard(scheme.c_str(), 4179 if (url::IsStandard(scheme.c_str(),
4180 url::Component(0, static_cast<int>(scheme.length())))) { 4180 url::Component(0, static_cast<int>(scheme.length())))) {
4181 params.origin = frame->document().securityOrigin(); 4181 params.origin = frame->document().securityOrigin();
4182 } 4182 }
4183 } 4183 }
4184 4184
4185 params.should_enforce_strict_mixed_content_checking =
4186 frame->shouldEnforceStrictMixedContentChecking();
4187
4188 // Set the URL to be displayed in the browser UI to the user.
4189 params.url = GetLoadingUrl();
4190 DCHECK(!is_swapped_out_ || params.url == GURL(kSwappedOutURL));
4191
4185 if (frame->document().baseURL() != params.url) 4192 if (frame->document().baseURL() != params.url)
4186 params.base_url = frame->document().baseURL(); 4193 params.base_url = frame->document().baseURL();
4187 4194
4188 GetRedirectChain(ds, &params.redirects); 4195 GetRedirectChain(ds, &params.redirects);
4189 params.should_update_history = !ds->hasUnreachableURL() && 4196 params.should_update_history = !ds->hasUnreachableURL() &&
4190 !response.isMultipartPayload() && (response.httpStatusCode() != 404); 4197 !response.isMultipartPayload() && (response.httpStatusCode() != 404);
4191 4198
4192 params.searchable_form_url = internal_data->searchable_form_url(); 4199 params.searchable_form_url = internal_data->searchable_form_url();
4193 params.searchable_form_encoding = internal_data->searchable_form_encoding(); 4200 params.searchable_form_encoding = internal_data->searchable_form_encoding();
4194 4201
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after
5463 media::ConvertToSwitchOutputDeviceCB(web_callbacks); 5470 media::ConvertToSwitchOutputDeviceCB(web_callbacks);
5464 scoped_refptr<media::AudioOutputDevice> device = 5471 scoped_refptr<media::AudioOutputDevice> device =
5465 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(), 5472 AudioDeviceFactory::NewOutputDevice(routing_id_, 0, sink_id.utf8(),
5466 security_origin); 5473 security_origin);
5467 media::OutputDeviceStatus status = device->GetDeviceStatus(); 5474 media::OutputDeviceStatus status = device->GetDeviceStatus();
5468 device->Stop(); 5475 device->Stop();
5469 callback.Run(status); 5476 callback.Run(status);
5470 } 5477 }
5471 5478
5472 } // namespace content 5479 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_frame_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698