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

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

Issue 2702503002: Block renderer-initiated main frame navigations to data URLs (Closed)
Patch Set: kinuko 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 4697 matching lines...) Expand 10 before | Expand all | Expand 10 after
4708 if (!default_value) 4708 if (!default_value)
4709 return false; 4709 return false;
4710 4710
4711 bool blocked = true; 4711 bool blocked = true;
4712 Send(new FrameHostMsg_Are3DAPIsBlocked( 4712 Send(new FrameHostMsg_Are3DAPIsBlocked(
4713 routing_id_, url::Origin(frame_->Top()->GetSecurityOrigin()).GetURL(), 4713 routing_id_, url::Origin(frame_->Top()->GetSecurityOrigin()).GetURL(),
4714 THREE_D_API_TYPE_WEBGL, &blocked)); 4714 THREE_D_API_TYPE_WEBGL, &blocked));
4715 return !blocked; 4715 return !blocked;
4716 } 4716 }
4717 4717
4718 bool RenderFrameImpl::AllowContentInitiatedDataUrlNavigations(
4719 const blink::WebURL& url) {
4720 // Error pages can navigate to data URLs.
4721 return url.GetString() == kUnreachableWebDataURL;
4722 }
4723
4718 blink::WebScreenOrientationClient* 4724 blink::WebScreenOrientationClient*
4719 RenderFrameImpl::GetWebScreenOrientationClient() { 4725 RenderFrameImpl::GetWebScreenOrientationClient() {
4720 if (!screen_orientation_dispatcher_) 4726 if (!screen_orientation_dispatcher_)
4721 screen_orientation_dispatcher_ = new ScreenOrientationDispatcher(this); 4727 screen_orientation_dispatcher_ = new ScreenOrientationDispatcher(this);
4722 return screen_orientation_dispatcher_; 4728 return screen_orientation_dispatcher_;
4723 } 4729 }
4724 4730
4725 void RenderFrameImpl::PostAccessibilityEvent(const blink::WebAXObject& obj, 4731 void RenderFrameImpl::PostAccessibilityEvent(const blink::WebAXObject& obj,
4726 blink::WebAXEvent event) { 4732 blink::WebAXEvent event) {
4727 HandleWebAccessibilityEvent(obj, event); 4733 HandleWebAccessibilityEvent(obj, event);
(...skipping 2245 matching lines...) Expand 10 before | Expand all | Expand 10 after
6973 policy(info.default_policy), 6979 policy(info.default_policy),
6974 replaces_current_history_item(info.replaces_current_history_item), 6980 replaces_current_history_item(info.replaces_current_history_item),
6975 history_navigation_in_new_child_frame( 6981 history_navigation_in_new_child_frame(
6976 info.is_history_navigation_in_new_child_frame), 6982 info.is_history_navigation_in_new_child_frame),
6977 client_redirect(info.is_client_redirect), 6983 client_redirect(info.is_client_redirect),
6978 cache_disabled(info.is_cache_disabled), 6984 cache_disabled(info.is_cache_disabled),
6979 form(info.form), 6985 form(info.form),
6980 source_location(info.source_location) {} 6986 source_location(info.source_location) {}
6981 6987
6982 } // namespace content 6988 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698