Trust the renderer's same-document navigation flag if it is a same-origin nav.
commit8d5cb21f876a51c4fddcb90954e0dd819a09a7a5
authorjaphet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Wed, 4 Jun 2014 09:00:39 +0000 (4 09:00 +0000)
committerjaphet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Wed, 4 Jun 2014 09:00:39 +0000 (4 09:00 +0000)
tree0005719b9fbf9fd1757f5d028f557215487d1645
parentce3651bc735d21ca677642616c454cf2e97797ca
Trust the renderer's same-document navigation flag if it is a same-origin nav.

Currently in AreURLsInPageNavigation, we only trust renderer_says_in_page if
the before and after urls are identical. This prevents us from correctly
classifying history.pushState and history.replaceState navigations as in-page.
Navigations via the history API are required to be same-origin, but can differ
by more than just the ref component, so we get the correct behavior without
the renderer process being able to lie about a cross-origin navigation.

BUG=138324
TEST=Added cases to NavigationControllerTest.IsInPageNavigation

Review URL: https://codereview.chromium.org/304763002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274734 0039d316-1c4b-4281-b951-d872f2087c98
12 files changed:
android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
chrome/browser/extensions/active_script_controller_unittest.cc
chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
chrome/browser/translate/translate_manager_render_view_host_unittest.cc
content/browser/android/web_contents_observer_android.cc
content/browser/frame_host/navigation_controller_impl.cc
content/browser/frame_host/navigation_controller_impl.h
content/browser/frame_host/navigation_controller_impl_unittest.cc
content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
content/public/android/java/src/org/chromium/content/browser/WebContentsObserverAndroid.java
content/public/test/test_renderer_host.cc
content/test/test_render_frame_host.cc