| Index: chrome/browser/ui/browser_navigator.cc
|
| diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc
|
| index 2d65644d9c921d2d1955c7308b7f605b96820010..8df9bb505404b4b3e3c39647a02d902ea777aff3 100644
|
| --- a/chrome/browser/ui/browser_navigator.cc
|
| +++ b/chrome/browser/ui/browser_navigator.cc
|
| @@ -613,21 +613,16 @@ void Navigate(NavigateParams* params) {
|
| // same as the source.
|
| DCHECK(params->source_contents);
|
| params->target_contents = params->source_contents;
|
| - DCHECK(params->target_contents);
|
| - // Prerender expects |params->target_contents| to be attached to a browser
|
| - // window, so only call for CURRENT_TAB navigations. (Others are currently
|
| - // unsupported because of session storage namespaces anyway.)
|
| - // Notice that this includes middle-clicking, since middle clicking
|
| - // translates into a chrome::Navigate call with no URL followed by a
|
| - // CURRENT_TAB navigation.
|
| - // TODO(tburkard): We can actually swap in in non-CURRENT_TAB cases, as
|
| - // long as the WebContents we swap into is part of a TabStrip model.
|
| - // Therefore, we should swap in regardless of CURRENT_TAB, and instead,
|
| - // check in the swapin function whether the WebContents is not in a
|
| - // TabStrip model, in which case we must not swap in.
|
| - swapped_in_prerender = SwapInPrerender(url, params);
|
| }
|
|
|
| + // Note: at this point, if |params->disposition| is not CURRENT_TAB,
|
| + // |params->target_contents| has not been attached to a Browser yet. (That
|
| + // happens later in this function.) However, in that case, the
|
| + // sessionStorage namespace could not match, so prerender will use the
|
| + // asynchronous codepath and still swap.
|
| + DCHECK(params->target_contents);
|
| + swapped_in_prerender = SwapInPrerender(url, params);
|
| +
|
| if (user_initiated)
|
| params->target_contents->UserGestureDone();
|
|
|
|
|