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

Side by Side Diff: ios/web/navigation/crw_session_controller.mm

Issue 2607053002: Remove POST data from navigations for which the state is replaced. (Closed)
Patch Set: rebase + fixes Created 3 years, 11 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
« no previous file with comments | « no previous file | ios/web/navigation/history_state_operations_inttest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #import "ios/web/navigation/crw_session_controller.h" 5 #import "ios/web/navigation/crw_session_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 } 537 }
538 538
539 - (void)updateCurrentEntryWithURL:(const GURL&)url 539 - (void)updateCurrentEntryWithURL:(const GURL&)url
540 stateObject:(NSString*)stateObject { 540 stateObject:(NSString*)stateObject {
541 DCHECK(!_transientEntry); 541 DCHECK(!_transientEntry);
542 CRWSessionEntry* currentEntry = self.currentEntry; 542 CRWSessionEntry* currentEntry = self.currentEntry;
543 web::NavigationItemImpl* currentItem = self.currentEntry.navigationItemImpl; 543 web::NavigationItemImpl* currentItem = self.currentEntry.navigationItemImpl;
544 currentItem->SetURL(url); 544 currentItem->SetURL(url);
545 currentItem->SetSerializedStateObject(stateObject); 545 currentItem->SetSerializedStateObject(stateObject);
546 currentItem->SetHasStateBeenReplaced(true); 546 currentItem->SetHasStateBeenReplaced(true);
547 currentItem->SetPostData(nil);
547 currentEntry.navigationItem->SetURL(url); 548 currentEntry.navigationItem->SetURL(url);
548 // If the change is to a committed entry, notify interested parties. 549 // If the change is to a committed entry, notify interested parties.
549 if (currentEntry != self.pendingEntry && _navigationManager) 550 if (currentEntry != self.pendingEntry && _navigationManager)
550 _navigationManager->OnNavigationItemChanged(); 551 _navigationManager->OnNavigationItemChanged();
551 } 552 }
552 553
553 - (void)discardNonCommittedEntries { 554 - (void)discardNonCommittedEntries {
554 [self discardTransientEntry]; 555 [self discardTransientEntry];
555 _pendingEntry.reset(); 556 _pendingEntry.reset();
556 _pendingEntryIndex = -1; 557 _pendingEntryIndex = -1;
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 return [[CRWSessionEntry alloc] initWithNavigationItem:std::move(item)]; 743 return [[CRWSessionEntry alloc] initWithNavigationItem:std::move(item)];
743 } 744 }
744 745
745 - (BOOL)isRedirectTransitionForEntryAtIndex:(NSInteger)index { 746 - (BOOL)isRedirectTransitionForEntryAtIndex:(NSInteger)index {
746 ui::PageTransition transition = 747 ui::PageTransition transition =
747 [_entries[index] navigationItem]->GetTransitionType(); 748 [_entries[index] navigationItem]->GetTransitionType();
748 return (transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK) ? YES : NO; 749 return (transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK) ? YES : NO;
749 } 750 }
750 751
751 @end 752 @end
OLDNEW
« no previous file with comments | « no previous file | ios/web/navigation/history_state_operations_inttest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698