Chromium Code Reviews| Index: content/browser/web_contents/navigation_controller_impl.h |
| =================================================================== |
| --- content/browser/web_contents/navigation_controller_impl.h (revision 153532) |
| +++ content/browser/web_contents/navigation_controller_impl.h (working copy) |
| @@ -156,14 +156,23 @@ |
| // pending and in page navigations only happen on committed pages. If there |
| // is no last committed entry, then nothing will be in-page. |
| // |
| - // Special note: if the URLs are the same, it does NOT count as an in-page |
| - // navigation. Neither does an input URL that has no ref, even if the rest is |
| - // the same. This may seem weird, but when we're considering whether a |
| - // navigation happened without loading anything, the same URL would be a |
| - // reload, while only a different ref would be in-page (pages can't clear |
| + // Special note: if the URLs are the same, it does NOT automatically count as |
| + // an in-page navigation. Neither does an input URL that has no ref, even if |
| + // the rest is the same. This may seem weird, but when we're considering |
| + // whether a navigation happened without loading anything, the same URL could |
| + // be a reload, while only a different ref would be in-page (pages can't clear |
| // refs without reload, only change to "#" which we don't count as empty). |
| - bool IsURLInPageNavigation(const GURL& url) const; |
| + bool IsURLInPageNavigation(const GURL& url) const { |
| + return IsURLInPageNavigation(url, false); |
|
Charlie Reis
2012/08/28 20:06:16
Isn't overloading usually frowned upon in Chrome?
Tom Sepez
2012/08/28 20:17:41
Yep, but it avoids having to write a comment about
|
| + } |
| + // The situation is made murkier by history.replaceState(), which could |
| + // provide the same URL as part of an in-page navigation, not a reload. So |
| + // we need this form which lets this the (untrustworthy) renderer resolve the |
|
Charlie Reis
2012/08/28 20:06:16
nit: which lets the
Tom Sepez
2012/08/28 20:17:41
Done.
|
| + // ambiguity, but only when the URLs are equal. This should be safe since the |
|
Charlie Reis
2012/08/28 20:06:16
maybe: "URLs are equal (apart from refs)"?
Tom Sepez
2012/08/28 20:17:41
Current impl is strict equality.
|
| + // origin isn't changing. |
| + bool IsURLInPageNavigation(const GURL& url, bool renderer_says_in_page) const; |
| + |
| // Sets the SessionStorageNamespace for the given |partition_id|. This is |
| // used during initialization of a new NavigationController to allow |
| // pre-population of the SessionStorageNamespace objects. Session restore, |