OLD | NEW |
---|---|
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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
200 | 200 |
201 // Sets the screenshot manager for this NavigationControllerImpl. Setting a | 201 // Sets the screenshot manager for this NavigationControllerImpl. Setting a |
202 // NULL manager recreates the default screenshot manager and uses that. | 202 // NULL manager recreates the default screenshot manager and uses that. |
203 void SetScreenshotManager( | 203 void SetScreenshotManager( |
204 std::unique_ptr<NavigationEntryScreenshotManager> manager); | 204 std::unique_ptr<NavigationEntryScreenshotManager> manager); |
205 | 205 |
206 // Discards only the pending entry. |was_failure| should be set if the pending | 206 // Discards only the pending entry. |was_failure| should be set if the pending |
207 // entry is being discarded because it failed to load. | 207 // entry is being discarded because it failed to load. |
208 void DiscardPendingEntry(bool was_failure); | 208 void DiscardPendingEntry(bool was_failure); |
209 | 209 |
210 // Sets a flag on the pending NavigationEntryImpl instance if any that the | |
211 // navigation failed due to an SSL error. | |
212 void SetPendingNavigationSSLError(bool error); | |
213 | |
210 private: | 214 private: |
211 friend class RestoreHelper; | 215 friend class RestoreHelper; |
212 | 216 |
213 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest, | 217 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest, |
214 PurgeScreenshot); | 218 PurgeScreenshot); |
215 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, Basic); | 219 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, Basic); |
216 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, SingleDuplicate); | 220 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, SingleDuplicate); |
217 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, ManyDuplicates); | 221 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, ManyDuplicates); |
218 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, ClockBackwardsJump); | 222 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, ClockBackwardsJump); |
219 | 223 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
361 | 365 |
362 // An entry we haven't gotten a response for yet. This will be discarded | 366 // An entry we haven't gotten a response for yet. This will be discarded |
363 // when we navigate again. It's used only so we know what the currently | 367 // when we navigate again. It's used only so we know what the currently |
364 // displayed tab is. | 368 // displayed tab is. |
365 // | 369 // |
366 // This may refer to an item in the entries_ list if the pending_entry_index_ | 370 // This may refer to an item in the entries_ list if the pending_entry_index_ |
367 // == -1, or it may be its own entry that should be deleted. Be careful with | 371 // == -1, or it may be its own entry that should be deleted. Be careful with |
368 // the memory management. | 372 // the memory management. |
369 NavigationEntryImpl* pending_entry_; | 373 NavigationEntryImpl* pending_entry_; |
370 | 374 |
375 // Navigations could occur in succession. This field holds the last pending | |
376 // entry for which we haven't received a response yet. | |
377 NavigationEntryImpl* last_pending_entry_; | |
scottmg
2016/12/20 22:34:05
Does this need to be a raw pointer?
ananta
2016/12/20 23:14:10
This is on the same lines as pending_entry_ which
| |
378 | |
371 // If a new entry fails loading, details about it are temporarily held here | 379 // If a new entry fails loading, details about it are temporarily held here |
372 // until the error page is shown (or 0 otherwise). | 380 // until the error page is shown (or 0 otherwise). |
373 // | 381 // |
374 // TODO(avi): We need a better way to handle the connection between failed | 382 // TODO(avi): We need a better way to handle the connection between failed |
375 // loads and the subsequent load of the error page. This current approach has | 383 // loads and the subsequent load of the error page. This current approach has |
376 // issues: 1. This might hang around longer than we'd like if there is no | 384 // issues: 1. This might hang around longer than we'd like if there is no |
377 // error page loaded, and 2. This doesn't work very well for frames. | 385 // error page loaded, and 2. This doesn't work very well for frames. |
378 // http://crbug.com/474261 | 386 // http://crbug.com/474261 |
379 int failed_pending_entry_id_; | 387 int failed_pending_entry_id_; |
380 | 388 |
381 // The index of the currently visible entry. | 389 // The index of the currently visible entry. |
382 int last_committed_entry_index_; | 390 int last_committed_entry_index_; |
383 | 391 |
384 // The index of the pending entry if it is in entries_, or -1 if | 392 // The index of the pending entry if it is in entries_, or -1 if |
385 // pending_entry_ is a new entry (created by LoadURL). | 393 // pending_entry_ is a new entry (created by LoadURL). |
386 int pending_entry_index_; | 394 int pending_entry_index_; |
387 | 395 |
388 // The index for the entry that is shown until a navigation occurs. This is | 396 // The index for the entry that is shown until a navigation occurs. This is |
389 // used for interstitial pages. -1 if there are no such entry. | 397 // used for interstitial pages. -1 if there are no such entry. |
390 // Note that this entry really appears in the list of entries, but only | 398 // Note that this entry really appears in the list of entries, but only |
391 // temporarily (until the next navigation). Any index pointing to an entry | 399 // temporarily (until the next navigation). Any index pointing to an entry |
392 // after the transient entry will become invalid if you navigate forward. | 400 // after the transient entry will become invalid if you navigate forward. |
393 int transient_entry_index_; | 401 int transient_entry_index_; |
394 | 402 |
403 // The index of the last pending entry if it is in entries, or -1 if it was | |
404 // created by LoadURL. | |
405 int last_pending_entry_index_; | |
406 | |
407 // The index of the last transient entry. Defaults to -1. | |
408 int last_transient_entry_index_; | |
409 | |
395 // The delegate associated with the controller. Possibly NULL during | 410 // The delegate associated with the controller. Possibly NULL during |
396 // setup. | 411 // setup. |
397 NavigationControllerDelegate* delegate_; | 412 NavigationControllerDelegate* delegate_; |
398 | 413 |
399 // Manages the SSL security UI. | 414 // Manages the SSL security UI. |
400 SSLManager ssl_manager_; | 415 SSLManager ssl_manager_; |
401 | 416 |
402 // Whether we need to be reloaded when made active. | 417 // Whether we need to be reloaded when made active. |
403 bool needs_reload_; | 418 bool needs_reload_; |
404 | 419 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
443 // these are ReloadType::NONE and a null timestamp, respectively. | 458 // these are ReloadType::NONE and a null timestamp, respectively. |
444 ReloadType last_committed_reload_type_; | 459 ReloadType last_committed_reload_type_; |
445 base::Time last_committed_reload_time_; | 460 base::Time last_committed_reload_time_; |
446 | 461 |
447 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); | 462 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); |
448 }; | 463 }; |
449 | 464 |
450 } // namespace content | 465 } // namespace content |
451 | 466 |
452 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ | 467 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ |
OLD | NEW |