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

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

Issue 1777903003: Ensure the NavigationHandle's nav entry ID is updated during transfers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move fix to another CL (now cleanup only) Created 4 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_HANDLE_IMPL_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_
7 7
8 #include "content/public/browser/navigation_handle.h" 8 #include "content/public/browser/navigation_handle.h"
9 9
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // This should only be accessed after a redirect was encountered or after the 119 // This should only be accessed after a redirect was encountered or after the
120 // navigation is ready to commit. The headers returned should not be modified, 120 // navigation is ready to commit. The headers returned should not be modified,
121 // as modifications will not be reflected in the network stack. 121 // as modifications will not be reflected in the network stack.
122 const net::HttpResponseHeaders* GetResponseHeaders(); 122 const net::HttpResponseHeaders* GetResponseHeaders();
123 123
124 // Get the unique id from the NavigationEntry associated with this 124 // Get the unique id from the NavigationEntry associated with this
125 // NavigationHandle. Note that a synchronous, renderer-initiated navigation 125 // NavigationHandle. Note that a synchronous, renderer-initiated navigation
126 // will not have a NavigationEntry associated with it, and this will return 0. 126 // will not have a NavigationEntry associated with it, and this will return 0.
127 int pending_nav_entry_id() const { return pending_nav_entry_id_; } 127 int pending_nav_entry_id() const { return pending_nav_entry_id_; }
128 128
129 // Changes the pending NavigationEntry ID for this handle. This is currently
130 // required during transfer navigations.
131 // TODO(creis): Remove this when transfer navigations do not require pending
132 // entries. See https://crbug.com/495161.
133 void update_entry_id_for_transfer(int nav_entry_id) {
134 pending_nav_entry_id_ = nav_entry_id;
135 }
136
129 void set_net_error_code(net::Error net_error_code) { 137 void set_net_error_code(net::Error net_error_code) {
130 net_error_code_ = net_error_code; 138 net_error_code_ = net_error_code;
131 } 139 }
132 140
133 // Returns whether the navigation is currently being transferred from one 141 // Returns whether the navigation is currently being transferred from one
134 // RenderFrameHost to another. In particular, a DidStartProvisionalLoad IPC 142 // RenderFrameHost to another. In particular, a DidStartProvisionalLoad IPC
135 // for the navigation URL, received in the new RenderFrameHost, should not 143 // for the navigation URL, received in the new RenderFrameHost, should not
136 // indicate the start of a new navigation in that case. 144 // indicate the start of a new navigation in that case.
137 bool is_transferring() const { return is_transferring_; } 145 bool is_transferring() const { return is_transferring_; }
138 void set_is_transferring(bool is_transferring) { 146 void set_is_transferring(bool is_transferring) {
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 // A list of Throttles registered for this navigation. 278 // A list of Throttles registered for this navigation.
271 ScopedVector<NavigationThrottle> throttles_; 279 ScopedVector<NavigationThrottle> throttles_;
272 280
273 // The index of the next throttle to check. 281 // The index of the next throttle to check.
274 size_t next_index_; 282 size_t next_index_;
275 283
276 // The time this navigation started. 284 // The time this navigation started.
277 const base::TimeTicks navigation_start_; 285 const base::TimeTicks navigation_start_;
278 286
279 // The unique id of the corresponding NavigationEntry. 287 // The unique id of the corresponding NavigationEntry.
280 const int pending_nav_entry_id_; 288 int pending_nav_entry_id_;
281 289
282 // This callback will be run when all throttle checks have been performed. 290 // This callback will be run when all throttle checks have been performed.
283 ThrottleChecksFinishedCallback complete_callback_; 291 ThrottleChecksFinishedCallback complete_callback_;
284 292
285 // PlzNavigate 293 // PlzNavigate
286 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a 294 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a
287 // corresponding ServiceWorkerNetworkProvider is created in the renderer. 295 // corresponding ServiceWorkerNetworkProvider is created in the renderer.
288 scoped_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; 296 scoped_ptr<ServiceWorkerNavigationHandle> service_worker_handle_;
289 297
290 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); 298 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl);
291 }; 299 };
292 300
293 } // namespace content 301 } // namespace content
294 302
295 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ 303 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698