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

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

Issue 1578253002: Don't try to store POST data for a nil CWRSessionEntry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2564
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 <cmath> 8 #include <cmath>
9 9
10 #include "base/ios/block_types.h" 10 #include "base/ios/block_types.h"
(...skipping 2803 matching lines...) Expand 10 before | Expand all | Expand 10 after
2814 // Record the URL so that errors reported following the 'NO' reply can be 2814 // Record the URL so that errors reported following the 'NO' reply can be
2815 // safely ignored. 2815 // safely ignored.
2816 [_openedApplicationURL addObject:request.URL]; 2816 [_openedApplicationURL addObject:request.URL];
2817 if ([self shouldClosePageOnNativeApplicationLoad]) 2817 if ([self shouldClosePageOnNativeApplicationLoad])
2818 [_delegate webPageOrderedClose]; 2818 [_delegate webPageOrderedClose];
2819 } 2819 }
2820 return NO; 2820 return NO;
2821 } 2821 }
2822 2822
2823 if ([[request HTTPMethod] isEqualToString:@"POST"]) { 2823 if ([[request HTTPMethod] isEqualToString:@"POST"]) {
2824 [self cachePOSTDataForRequest:request 2824 CRWSessionEntry* currentEntry = [self currentSessionEntry];
2825 inSessionEntry:[self currentSessionEntry]]; 2825 // TODO(crbug.com/570699): Remove this check once it's no longer possible to
2826 // have no current entries.
2827 if (currentEntry)
2828 [self cachePOSTDataForRequest:request inSessionEntry:currentEntry];
2826 } 2829 }
2827 2830
2828 return YES; 2831 return YES;
2829 } 2832 }
2830 2833
2831 - (void)restoreStateAfterURLRejection { 2834 - (void)restoreStateAfterURLRejection {
2832 [[self sessionController] discardNonCommittedEntries]; 2835 [[self sessionController] discardNonCommittedEntries];
2833 2836
2834 // Re-register the user agent, because UIWebView will sometimes try to read 2837 // Re-register the user agent, because UIWebView will sometimes try to read
2835 // the agent again from a saved search result page in which no other page has 2838 // the agent again from a saved search result page in which no other page has
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
3902 if ([MIMEType isEqualToString:@"text/html"] || 3905 if ([MIMEType isEqualToString:@"text/html"] ||
3903 [MIMEType isEqualToString:@"application/xhtml+xml"] || 3906 [MIMEType isEqualToString:@"application/xhtml+xml"] ||
3904 [MIMEType isEqualToString:@"application/xml"]) { 3907 [MIMEType isEqualToString:@"application/xml"]) {
3905 return web::WEB_VIEW_DOCUMENT_TYPE_HTML; 3908 return web::WEB_VIEW_DOCUMENT_TYPE_HTML;
3906 } 3909 }
3907 3910
3908 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; 3911 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC;
3909 } 3912 }
3910 3913
3911 @end 3914 @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