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

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

Issue 2151323003: Add a check for mismatching URL and origin in the renderer process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable the test on Mac, until more debugging can be done. Created 4 years, 5 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
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager_browsertest.cc ('k') | no next file » | 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 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 4754 matching lines...) Expand 10 before | Expand all | Expand 10 after
4765 else 4765 else
4766 params.transition = ui::PAGE_TRANSITION_AUTO_SUBFRAME; 4766 params.transition = ui::PAGE_TRANSITION_AUTO_SUBFRAME;
4767 4767
4768 DCHECK(!navigation_state->request_params().should_clear_history_list); 4768 DCHECK(!navigation_state->request_params().should_clear_history_list);
4769 params.history_list_was_cleared = false; 4769 params.history_list_was_cleared = false;
4770 params.report_type = FrameMsg_UILoadMetricsReportType::NO_REPORT; 4770 params.report_type = FrameMsg_UILoadMetricsReportType::NO_REPORT;
4771 // Subframes should match the zoom level of the main frame. 4771 // Subframes should match the zoom level of the main frame.
4772 render_view_->SetZoomLevel(render_view_->page_zoom_level()); 4772 render_view_->SetZoomLevel(render_view_->page_zoom_level());
4773 } 4773 }
4774 4774
4775 // Standard URLs must match the reported origin, when it is not unique.
4776 // This check is very similar to RenderFrameHostImpl::CanCommitOrigin, but
4777 // adapted to the renderer process side.
4778 if (!params.origin.unique() && params.url.IsStandard() &&
4779 render_view_->GetWebkitPreferences().web_security_enabled) {
4780 // Exclude file: URLs when settings allow them access any origin.
4781 if (params.origin.scheme() != url::kFileScheme ||
4782 !render_view_->GetWebkitPreferences()
4783 .allow_universal_access_from_file_urls) {
4784 CHECK(params.origin.IsSameOriginWith(url::Origin(params.url)))
4785 << " url:" << params.url << " origin:" << params.origin;
4786 }
4787 }
4788
4775 // This message needs to be sent before any of allowScripts(), 4789 // This message needs to be sent before any of allowScripts(),
4776 // allowImages(), allowPlugins() is called for the new page, so that when 4790 // allowImages(), allowPlugins() is called for the new page, so that when
4777 // these functions send a ViewHostMsg_ContentBlocked message, it arrives 4791 // these functions send a ViewHostMsg_ContentBlocked message, it arrives
4778 // after the FrameHostMsg_DidCommitProvisionalLoad message. 4792 // after the FrameHostMsg_DidCommitProvisionalLoad message.
4779 Send(new FrameHostMsg_DidCommitProvisionalLoad(routing_id_, params)); 4793 Send(new FrameHostMsg_DidCommitProvisionalLoad(routing_id_, params));
4780 4794
4781 // If we end up reusing this WebRequest (for example, due to a #ref click), 4795 // If we end up reusing this WebRequest (for example, due to a #ref click),
4782 // we don't want the transition type to persist. Just clear it. 4796 // we don't want the transition type to persist. Just clear it.
4783 navigation_state->set_transition_type(ui::PAGE_TRANSITION_LINK); 4797 navigation_state->set_transition_type(ui::PAGE_TRANSITION_LINK);
4784 } 4798 }
(...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after
6335 // event target. Potentially a Pepper plugin will receive the event. 6349 // event target. Potentially a Pepper plugin will receive the event.
6336 // In order to tell whether a plugin gets the last mouse event and which it 6350 // In order to tell whether a plugin gets the last mouse event and which it
6337 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6351 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6338 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6352 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6339 // |pepper_last_mouse_event_target_|. 6353 // |pepper_last_mouse_event_target_|.
6340 pepper_last_mouse_event_target_ = nullptr; 6354 pepper_last_mouse_event_target_ = nullptr;
6341 #endif 6355 #endif
6342 } 6356 }
6343 6357
6344 } // namespace content 6358 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698