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
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::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 @@
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 @@
// 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(