Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: content/browser/frame_host/navigation_controller_impl.h

Issue 2032903007: Allow about:blank to be considered in-page if origin matches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests and add test Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // and it will return false. 148 // and it will return false.
149 bool RendererDidNavigate( 149 bool RendererDidNavigate(
150 RenderFrameHostImpl* rfh, 150 RenderFrameHostImpl* rfh,
151 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, 151 const FrameHostMsg_DidCommitProvisionalLoad_Params& params,
152 LoadCommittedDetails* details); 152 LoadCommittedDetails* details);
153 153
154 // Notifies us that we just became active. This is used by the WebContentsImpl 154 // Notifies us that we just became active. This is used by the WebContentsImpl
155 // so that we know to load URLs that were pending as "lazy" loads. 155 // so that we know to load URLs that were pending as "lazy" loads.
156 void SetActive(bool is_active); 156 void SetActive(bool is_active);
157 157
158 // Returns true if the given URL would be an in-page navigation (i.e. only the 158 // Returns true if the given URL would be an in-page navigation (e.g., if the
159 // reference fragment is different) from the last committed URL in the 159 // reference fragment is different, or after a pushState) from the last
160 // specified frame. If there is no last committed entry, then nothing will be 160 // committed URL in the specified frame. If there is no last committed entry,
161 // in-page. 161 // then nothing will be in-page.
162 // 162 //
163 // Special note: if the URLs are the same, it does NOT automatically count as 163 // Special note: if the URLs are the same, it does NOT automatically count as
164 // an in-page navigation. Neither does an input URL that has no ref, even if 164 // an in-page navigation. Neither does an input URL that has no ref, even if
165 // the rest is the same. This may seem weird, but when we're considering 165 // the rest is the same. This may seem weird, but when we're considering
166 // whether a navigation happened without loading anything, the same URL could 166 // whether a navigation happened without loading anything, the same URL could
167 // be a reload, while only a different ref would be in-page (pages can't clear 167 // be a reload, while only a different ref would be in-page (pages can't clear
168 // refs without reload, only change to "#" which we don't count as empty). 168 // refs without reload, only change to "#" which we don't count as empty).
169 // 169 //
170 // The situation is made murkier by history.replaceState(), which could 170 // The situation is made murkier by history.replaceState(), which could
171 // provide the same URL as part of an in-page navigation, not a reload. So 171 // provide the same URL as part of an in-page navigation, not a reload. So
172 // we need to let the (untrustworthy) renderer resolve the ambiguity, but 172 // we need to let the (untrustworthy) renderer resolve the ambiguity, but
173 // only when the URLs are on the same origin. 173 // only when the URLs are on the same origin. We rely on |origin|, which
174 bool IsURLInPageNavigation( 174 // matters in cases like about:blank that otherwise look cross-origin.
175 const GURL& url, 175 bool IsURLInPageNavigation(const GURL& url,
176 bool renderer_says_in_page, 176 const url::Origin& origin,
177 RenderFrameHost* rfh) const; 177 bool renderer_says_in_page,
178 RenderFrameHost* rfh) const;
178 179
179 // Sets the SessionStorageNamespace for the given |partition_id|. This is 180 // Sets the SessionStorageNamespace for the given |partition_id|. This is
180 // used during initialization of a new NavigationController to allow 181 // used during initialization of a new NavigationController to allow
181 // pre-population of the SessionStorageNamespace objects. Session restore, 182 // pre-population of the SessionStorageNamespace objects. Session restore,
182 // prerendering, and the implementaion of window.open() are the primary users 183 // prerendering, and the implementaion of window.open() are the primary users
183 // of this API. 184 // of this API.
184 // 185 //
185 // Calling this function when a SessionStorageNamespace has already been 186 // Calling this function when a SessionStorageNamespace has already been
186 // associated with a |partition_id| will CHECK() fail. 187 // associated with a |partition_id| will CHECK() fail.
187 void SetSessionStorageNamespace( 188 void SetSessionStorageNamespace(
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 TimeSmoother time_smoother_; 450 TimeSmoother time_smoother_;
450 451
451 std::unique_ptr<NavigationEntryScreenshotManager> screenshot_manager_; 452 std::unique_ptr<NavigationEntryScreenshotManager> screenshot_manager_;
452 453
453 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); 454 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl);
454 }; 455 };
455 456
456 } // namespace content 457 } // namespace content
457 458
458 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ 459 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698