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

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

Issue 2702503002: Block renderer-initiated main frame navigations to data URLs (Closed)
Patch Set: Re-block data to data navigations, rebase, address nasko comments Created 3 years, 8 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 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 4689 matching lines...) Expand 10 before | Expand all | Expand 10 after
4700 if (!default_value) 4700 if (!default_value)
4701 return false; 4701 return false;
4702 4702
4703 bool blocked = true; 4703 bool blocked = true;
4704 Send(new FrameHostMsg_Are3DAPIsBlocked( 4704 Send(new FrameHostMsg_Are3DAPIsBlocked(
4705 routing_id_, url::Origin(frame_->top()->getSecurityOrigin()).GetURL(), 4705 routing_id_, url::Origin(frame_->top()->getSecurityOrigin()).GetURL(),
4706 THREE_D_API_TYPE_WEBGL, &blocked)); 4706 THREE_D_API_TYPE_WEBGL, &blocked));
4707 return !blocked; 4707 return !blocked;
4708 } 4708 }
4709 4709
4710 bool RenderFrameImpl::allowInsecureDataUrlNavigations(
4711 const blink::WebURL& url) {
4712 // Error pages can navigate to data URLs.
4713 return url.string() == kUnreachableWebDataURL;
nasko 2017/04/05 23:55:19 Given this implementation, naming this method "all
meacer 2017/04/06 01:25:42 Done.
4714 }
4715
4710 blink::WebScreenOrientationClient* 4716 blink::WebScreenOrientationClient*
4711 RenderFrameImpl::webScreenOrientationClient() { 4717 RenderFrameImpl::webScreenOrientationClient() {
4712 if (!screen_orientation_dispatcher_) 4718 if (!screen_orientation_dispatcher_)
4713 screen_orientation_dispatcher_ = new ScreenOrientationDispatcher(this); 4719 screen_orientation_dispatcher_ = new ScreenOrientationDispatcher(this);
4714 return screen_orientation_dispatcher_; 4720 return screen_orientation_dispatcher_;
4715 } 4721 }
4716 4722
4717 void RenderFrameImpl::postAccessibilityEvent(const blink::WebAXObject& obj, 4723 void RenderFrameImpl::postAccessibilityEvent(const blink::WebAXObject& obj,
4718 blink::WebAXEvent event) { 4724 blink::WebAXEvent event) {
4719 HandleWebAccessibilityEvent(obj, event); 4725 HandleWebAccessibilityEvent(obj, event);
(...skipping 2252 matching lines...) Expand 10 before | Expand all | Expand 10 after
6972 policy(info.defaultPolicy), 6978 policy(info.defaultPolicy),
6973 replaces_current_history_item(info.replacesCurrentHistoryItem), 6979 replaces_current_history_item(info.replacesCurrentHistoryItem),
6974 history_navigation_in_new_child_frame( 6980 history_navigation_in_new_child_frame(
6975 info.isHistoryNavigationInNewChildFrame), 6981 info.isHistoryNavigationInNewChildFrame),
6976 client_redirect(info.isClientRedirect), 6982 client_redirect(info.isClientRedirect),
6977 cache_disabled(info.isCacheDisabled), 6983 cache_disabled(info.isCacheDisabled),
6978 form(info.form), 6984 form(info.form),
6979 source_location(info.sourceLocation) {} 6985 source_location(info.sourceLocation) {}
6980 6986
6981 } // namespace content 6987 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698