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

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

Issue 1048963002: Fix incorrect creation of duplicate navigation entries for repeated page load failures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@committype3
Patch Set: works Created 5 years, 8 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 "base/callback.h" 8 #include "base/callback.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 // Takes a screenshot of the page at the current state. 192 // Takes a screenshot of the page at the current state.
193 void TakeScreenshot(); 193 void TakeScreenshot();
194 194
195 // Sets the screenshot manager for this NavigationControllerImpl. The 195 // Sets the screenshot manager for this NavigationControllerImpl. The
196 // controller takes ownership of the screenshot manager and destroys it when 196 // controller takes ownership of the screenshot manager and destroys it when
197 // a new screenshot-manager is set, or when the controller is destroyed. 197 // a new screenshot-manager is set, or when the controller is destroyed.
198 // Setting a NULL manager recreates the default screenshot manager and uses 198 // Setting a NULL manager recreates the default screenshot manager and uses
199 // that. 199 // that.
200 void SetScreenshotManager(NavigationEntryScreenshotManager* manager); 200 void SetScreenshotManager(NavigationEntryScreenshotManager* manager);
201 201
202 // Discards only the pending entry. 202 // Discards only the pending entry. |was_failure| should be set if the pending
203 void DiscardPendingEntry(); 203 // entry is being discarded because it failed to load.
204 void DiscardPendingEntry(bool was_failure);
204 205
205 private: 206 private:
206 friend class RestoreHelper; 207 friend class RestoreHelper;
207 208
208 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest, 209 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest,
209 PurgeScreenshot); 210 PurgeScreenshot);
210 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, Basic); 211 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, Basic);
211 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, SingleDuplicate); 212 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, SingleDuplicate);
212 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, ManyDuplicates); 213 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, ManyDuplicates);
213 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, ClockBackwardsJump); 214 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, ClockBackwardsJump);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 339
339 // An entry we haven't gotten a response for yet. This will be discarded 340 // An entry we haven't gotten a response for yet. This will be discarded
340 // when we navigate again. It's used only so we know what the currently 341 // when we navigate again. It's used only so we know what the currently
341 // displayed tab is. 342 // displayed tab is.
342 // 343 //
343 // This may refer to an item in the entries_ list if the pending_entry_index_ 344 // This may refer to an item in the entries_ list if the pending_entry_index_
344 // == -1, or it may be its own entry that should be deleted. Be careful with 345 // == -1, or it may be its own entry that should be deleted. Be careful with
345 // the memory management. 346 // the memory management.
346 NavigationEntryImpl* pending_entry_; 347 NavigationEntryImpl* pending_entry_;
347 348
348 // currently visible entry 349 // If a new entry fails loading, it is temporarily held here until the error
350 // page is shown.
Charlie Reis 2015/04/03 20:59:46 This needs to mention that it will stick around un
Avi (use Gerrit) 2015/04/06 19:38:17 Done.
351 scoped_ptr<NavigationEntryImpl> failed_pending_entry_;
Charlie Reis 2015/04/03 20:59:46 How bad would it be to store just the things we ne
Avi (use Gerrit) 2015/04/06 19:38:17 Done.
352
353 // The index of the currently visible entry.
349 int last_committed_entry_index_; 354 int last_committed_entry_index_;
350 355
351 // index of pending entry if it is in entries_, or -1 if pending_entry_ is a 356 // The index of the pending entry if it is in entries_, or -1 if
352 // new entry (created by LoadURL). 357 // pending_entry_ is a new entry (created by LoadURL).
353 int pending_entry_index_; 358 int pending_entry_index_;
354 359
355 // The index for the entry that is shown until a navigation occurs. This is 360 // The index for the entry that is shown until a navigation occurs. This is
356 // used for interstitial pages. -1 if there are no such entry. 361 // used for interstitial pages. -1 if there are no such entry.
357 // Note that this entry really appears in the list of entries, but only 362 // Note that this entry really appears in the list of entries, but only
358 // temporarily (until the next navigation). Any index pointing to an entry 363 // temporarily (until the next navigation). Any index pointing to an entry
359 // after the transient entry will become invalid if you navigate forward. 364 // after the transient entry will become invalid if you navigate forward.
360 int transient_entry_index_; 365 int transient_entry_index_;
361 366
362 // The delegate associated with the controller. Possibly NULL during 367 // The delegate associated with the controller. Possibly NULL during
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 TimeSmoother time_smoother_; 413 TimeSmoother time_smoother_;
409 414
410 scoped_ptr<NavigationEntryScreenshotManager> screenshot_manager_; 415 scoped_ptr<NavigationEntryScreenshotManager> screenshot_manager_;
411 416
412 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); 417 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl);
413 }; 418 };
414 419
415 } // namespace content 420 } // namespace content
416 421
417 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ 422 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698