diff options
author | shishir@chromium.org <shishir@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 19:11:59 +0000 |
---|---|---|
committer | shishir@chromium.org <shishir@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-07 19:11:59 +0000 |
commit | 57b9396ce02f494dee0eb42a7eafde525aea1028 (patch) | |
tree | 3d0b99609965a76e85d711bb19a6eb727149be56 /content/browser/tab_contents | |
parent | d7b10554d4bbe6d8224be2a14775e1a4b8089d99 (diff) | |
download | chromium_src-57b9396ce02f494dee0eb42a7eafde525aea1028.zip chromium_src-57b9396ce02f494dee0eb42a7eafde525aea1028.tar.gz chromium_src-57b9396ce02f494dee0eb42a7eafde525aea1028.tar.bz2 |
Changes for cross domain prerenders to not cancel when there is a window.opener set.
This change will only cancel prerenders with window.opener set where the
prerender is in the same domain as the page doing the prerendering.
The window.opener case can be broken down into two cases:
1. When the page embedding the "link rel=prerender" does not have an opener
set, but the opener is set only for the prerendered page.
2. The embedder page itself has the opener set and the prerendered page
inherits it.
This CL fixes both cases.
BUG=85042
TEST=PrerenderBrowserTest
Review URL: http://codereview.chromium.org/7906017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104538 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/tab_contents')
5 files changed, 9 insertions, 9 deletions
diff --git a/content/browser/tab_contents/navigation_controller_unittest.cc b/content/browser/tab_contents/navigation_controller_unittest.cc index 92685d1..39b6603 100644 --- a/content/browser/tab_contents/navigation_controller_unittest.cc +++ b/content/browser/tab_contents/navigation_controller_unittest.cc @@ -469,7 +469,7 @@ TEST_F(NavigationControllerTest, LoadURL_RedirectAbortCancelsPending) { rvh()->TestOnMessageReceived( ViewHostMsg_DidRedirectProvisionalLoad(0, // routing_id -1, // pending page_id - false, // opener + GURL(), // opener kNewURL, // old url kRedirectURL)); // new url diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index c5f7725..855956d 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -860,7 +860,7 @@ void TabContents::SetContentRestrictions(int restrictions) { void TabContents::OnDidStartProvisionalLoadForFrame(int64 frame_id, bool is_main_frame, - bool has_opener_set, + const GURL& opener_url, const GURL& url) { bool is_error_page = (url.spec() == chrome::kUnreachableWebDataURL); GURL validated_url(url); @@ -878,12 +878,12 @@ void TabContents::OnDidStartProvisionalLoadForFrame(int64 frame_id, if (is_main_frame) { // Notify observers about the provisional change in the main frame URL. FOR_EACH_OBSERVER(TabContentsObserver, observers_, - ProvisionalChangeToMainFrameUrl(url, has_opener_set)); + ProvisionalChangeToMainFrameUrl(url, opener_url)); } } void TabContents::OnDidRedirectProvisionalLoad(int32 page_id, - bool has_opener_set, + const GURL& opener_url, const GURL& source_url, const GURL& target_url) { // TODO(creis): Remove this method and have the pre-rendering code listen to @@ -900,7 +900,7 @@ void TabContents::OnDidRedirectProvisionalLoad(int32 page_id, // Notify observers about the provisional change in the main frame URL. FOR_EACH_OBSERVER(TabContentsObserver, observers_, ProvisionalChangeToMainFrameUrl(target_url, - has_opener_set)); + opener_url)); } void TabContents::OnDidFailProvisionalLoadWithError( diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h index d6465be..9307e63 100644 --- a/content/browser/tab_contents/tab_contents.h +++ b/content/browser/tab_contents/tab_contents.h @@ -505,10 +505,10 @@ class CONTENT_EXPORT TabContents : public PageNavigator, // Message handlers. void OnDidStartProvisionalLoadForFrame(int64 frame_id, bool main_frame, - bool has_opener_set, + const GURL& opener_url, const GURL& url); void OnDidRedirectProvisionalLoad(int32 page_id, - bool has_opener_set, + const GURL& opener_url, const GURL& source_url, const GURL& target_url); void OnDidFailProvisionalLoadWithError(int64 frame_id, diff --git a/content/browser/tab_contents/tab_contents_observer.cc b/content/browser/tab_contents/tab_contents_observer.cc index fa5ff3c..f1e71ff 100644 --- a/content/browser/tab_contents/tab_contents_observer.cc +++ b/content/browser/tab_contents/tab_contents_observer.cc @@ -36,7 +36,7 @@ void TabContentsObserver::DidStartProvisionalLoadForFrame( void TabContentsObserver::ProvisionalChangeToMainFrameUrl( const GURL& url, - bool has_opener_set) { + const GURL& opener_url) { } void TabContentsObserver::DidCommitProvisionalLoadForFrame( diff --git a/content/browser/tab_contents/tab_contents_observer.h b/content/browser/tab_contents/tab_contents_observer.h index fdc157d..dfb884c 100644 --- a/content/browser/tab_contents/tab_contents_observer.h +++ b/content/browser/tab_contents/tab_contents_observer.h @@ -38,7 +38,7 @@ class CONTENT_EXPORT TabContentsObserver : public IPC::Channel::Listener, bool is_error_page, RenderViewHost* render_view_host); virtual void ProvisionalChangeToMainFrameUrl(const GURL& url, - bool has_opener_set); + const GURL& opener_url); virtual void DidCommitProvisionalLoadForFrame( int64 frame_id, bool is_main_frame, |