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

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

Issue 101573003: Add the navigation redirect-chain to Sync sessions proto for offline analysis. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Trivial change. Created 6 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 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 void SetScreenshotManager(NavigationEntryScreenshotManager* manager); 207 void SetScreenshotManager(NavigationEntryScreenshotManager* manager);
208 208
209 // Discards only the pending entry. 209 // Discards only the pending entry.
210 void DiscardPendingEntry(); 210 void DiscardPendingEntry();
211 211
212 private: 212 private:
213 friend class RestoreHelper; 213 friend class RestoreHelper;
214 214
215 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest, 215 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest,
216 PurgeScreenshot); 216 PurgeScreenshot);
217 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest,
218 GetMergedRedirectChainNewPage);
219 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest,
220 GetMergedRedirectChainSamePage);
221 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest,
222 GetMergedRedirectChainMergeNoOverlap);
223 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest,
224 GetMergedRedirectChainMergeOneOverlap);
225 FRIEND_TEST_ALL_PREFIXES(NavigationControllerTest,
226 GetMergedRedirectChainMergeTwoOverlap);
217 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, Basic); 227 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, Basic);
218 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, SingleDuplicate); 228 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, SingleDuplicate);
219 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, ManyDuplicates); 229 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, ManyDuplicates);
220 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, ClockBackwardsJump); 230 FRIEND_TEST_ALL_PREFIXES(TimeSmoother, ClockBackwardsJump);
221 231
222 // Helper class to smooth out runs of duplicate timestamps while still 232 // Helper class to smooth out runs of duplicate timestamps while still
223 // allowing time to jump backwards. 233 // allowing time to jump backwards.
224 class CONTENT_EXPORT TimeSmoother { 234 class CONTENT_EXPORT TimeSmoother {
225 public: 235 public:
226 // Returns |t| with possibly some time added on. 236 // Returns |t| with possibly some time added on.
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 // Inserts up to |max_index| entries from |source| into this. This does NOT 339 // Inserts up to |max_index| entries from |source| into this. This does NOT
330 // adjust any of the members that reference entries_ 340 // adjust any of the members that reference entries_
331 // (last_committed_entry_index_, pending_entry_index_ or 341 // (last_committed_entry_index_, pending_entry_index_ or
332 // transient_entry_index_). 342 // transient_entry_index_).
333 void InsertEntriesFrom(const NavigationControllerImpl& source, int max_index); 343 void InsertEntriesFrom(const NavigationControllerImpl& source, int max_index);
334 344
335 // Returns the navigation index that differs from the current entry by the 345 // Returns the navigation index that differs from the current entry by the
336 // specified |offset|. The index returned is not guaranteed to be valid. 346 // specified |offset|. The index returned is not guaranteed to be valid.
337 int GetIndexForOffset(int offset) const; 347 int GetIndexForOffset(int offset) const;
338 348
349 // Produces a redirect chain by merging the active entry redirects with the
350 // redirects given in the params, taking into account the type of navigation
351 // specified in the params.
352 std::vector<GURL> GetMergedRedirectChain(
353 const FrameHostMsg_DidCommitProvisionalLoad_Params& params,
354 const std::vector<GURL>& active_entry_redirects) const;
355
339 // --------------------------------------------------------------------------- 356 // ---------------------------------------------------------------------------
340 357
341 // The user browser context associated with this controller. 358 // The user browser context associated with this controller.
342 BrowserContext* browser_context_; 359 BrowserContext* browser_context_;
343 360
344 // List of NavigationEntry for this tab 361 // List of NavigationEntry for this tab
345 typedef std::vector<linked_ptr<NavigationEntryImpl> > NavigationEntries; 362 typedef std::vector<linked_ptr<NavigationEntryImpl> > NavigationEntries;
346 NavigationEntries entries_; 363 NavigationEntries entries_;
347 364
348 // An entry we haven't gotten a response for yet. This will be discarded 365 // An entry we haven't gotten a response for yet. This will be discarded
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 TimeSmoother time_smoother_; 431 TimeSmoother time_smoother_;
415 432
416 scoped_ptr<NavigationEntryScreenshotManager> screenshot_manager_; 433 scoped_ptr<NavigationEntryScreenshotManager> screenshot_manager_;
417 434
418 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl); 435 DISALLOW_COPY_AND_ASSIGN(NavigationControllerImpl);
419 }; 436 };
420 437
421 } // namespace content 438 } // namespace content
422 439
423 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_ 440 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_CONTROLLER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698