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

Side by Side Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 1575683002: Don't try to store POST data for a nil CWRSessionEntry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | no next file » | 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/web_state/ui/crw_web_controller.h" 5 #import "ios/web/web_state/ui/crw_web_controller.h"
6 6
7 #import <objc/runtime.h> 7 #import <objc/runtime.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 2801 matching lines...) Expand 10 before | Expand all | Expand 10 after
2812 // Record the URL so that errors reported following the 'NO' reply can be 2812 // Record the URL so that errors reported following the 'NO' reply can be
2813 // safely ignored. 2813 // safely ignored.
2814 [_openedApplicationURL addObject:request.URL]; 2814 [_openedApplicationURL addObject:request.URL];
2815 if ([self shouldClosePageOnNativeApplicationLoad]) 2815 if ([self shouldClosePageOnNativeApplicationLoad])
2816 [_delegate webPageOrderedClose]; 2816 [_delegate webPageOrderedClose];
2817 } 2817 }
2818 return NO; 2818 return NO;
2819 } 2819 }
2820 2820
2821 if ([[request HTTPMethod] isEqualToString:@"POST"]) { 2821 if ([[request HTTPMethod] isEqualToString:@"POST"]) {
2822 [self cachePOSTDataForRequest:request 2822 CRWSessionEntry* currentEntry = [self currentSessionEntry];
2823 inSessionEntry:[self currentSessionEntry]]; 2823 // TODO(crbug.com/570699): Remove this check once it's no longer possible to
2824 // have no current entries.
2825 if (currentEntry)
2826 [self cachePOSTDataForRequest:request inSessionEntry:currentEntry];
2824 } 2827 }
2825 2828
2826 return YES; 2829 return YES;
2827 } 2830 }
2828 2831
2829 - (void)restoreStateAfterURLRejection { 2832 - (void)restoreStateAfterURLRejection {
2830 [[self sessionController] discardNonCommittedEntries]; 2833 [[self sessionController] discardNonCommittedEntries];
2831 2834
2832 // Reset |_lastRegisteredRequestURL| so that it reflects the URL from before 2835 // Reset |_lastRegisteredRequestURL| so that it reflects the URL from before
2833 // the load was rejected. This value may be out of sync because 2836 // the load was rejected. This value may be out of sync because
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after
3895 if ([MIMEType isEqualToString:@"text/html"] || 3898 if ([MIMEType isEqualToString:@"text/html"] ||
3896 [MIMEType isEqualToString:@"application/xhtml+xml"] || 3899 [MIMEType isEqualToString:@"application/xhtml+xml"] ||
3897 [MIMEType isEqualToString:@"application/xml"]) { 3900 [MIMEType isEqualToString:@"application/xml"]) {
3898 return web::WEB_VIEW_DOCUMENT_TYPE_HTML; 3901 return web::WEB_VIEW_DOCUMENT_TYPE_HTML;
3899 } 3902 }
3900 3903
3901 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; 3904 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC;
3902 } 3905 }
3903 3906
3904 @end 3907 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698