Chromium Code Reviews| Index: content/browser/frame_host/navigator_impl.cc |
| diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc |
| index eb722c4fd34e0a5855c842a6a45c6e6df62f3716..bbf61f2ac378660c0dd15605eae475fdb73d7f97 100644 |
| --- a/content/browser/frame_host/navigator_impl.cc |
| +++ b/content/browser/frame_host/navigator_impl.cc |
| @@ -302,6 +302,16 @@ bool NavigatorImpl::NavigateToEntry( |
| dest_referrer = Referrer(); |
| } |
| + // Don't attempt to navigate if the virtual URL is non-empty and invalid. |
| + if (frame_tree_node->IsMainFrame()) { |
| + GURL virtual_url = entry.GetVirtualURL(); |
|
Charlie Reis
2016/10/26 23:07:09
const ref?
nasko
2016/10/26 23:37:47
Done.
|
| + if (!virtual_url.is_valid() && !virtual_url.is_empty()) { |
| + LOG(WARNING) << "Refusing to load for invalid virtual URL: " |
| + << virtual_url.possibly_invalid_spec(); |
| + return false; |
| + } |
| + } |
| + |
| // Don't attempt to navigate to non-empty invalid URLs. |
| if (!dest_url.is_valid() && !dest_url.is_empty()) { |
| LOG(WARNING) << "Refusing to load invalid URL: " |
| @@ -1230,6 +1240,12 @@ void NavigatorImpl::DidStartMainFrameNavigation( |
| url, content::Referrer(), ui::PAGE_TRANSITION_LINK, |
| true /* is_renderer_initiated */, std::string(), |
| controller_->GetBrowserContext())); |
| + |
| + // If the creation of NavigationEntry failed, just return early and |
| + // don't set a pending entry. |
| + if (!entry.get()) |
|
Charlie Reis
2016/10/26 23:07:09
Is this stale? I don't see any changes to CreateN
nasko
2016/10/26 23:37:47
Oops, indeed. This is leftover from my previous tr
|
| + return; |
| + |
| entry->set_site_instance(site_instance); |
| // TODO(creis): If there's a pending entry already, find a safe way to |
| // update it instead of replacing it and copying over things like this. |