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

Unified Diff: ios/web/web_state/ui/crw_ui_web_view_web_controller.mm

Issue 1178063007: Updated error translation logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/web_state/error_translation_util.mm ('k') | ios/web/web_state/ui/crw_web_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_ui_web_view_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_ui_web_view_web_controller.mm b/ios/web/web_state/ui/crw_ui_web_view_web_controller.mm
index 1cb9902c351c7f624e7a41fc9394c34c108d5aab..8d84161aeef11bf90a57ecd3abbef4ceb69c5f4b 100644
--- a/ios/web/web_state/ui/crw_ui_web_view_web_controller.mm
+++ b/ios/web/web_state/ui/crw_ui_web_view_web_controller.mm
@@ -4,6 +4,7 @@
#import "ios/web/web_state/ui/crw_ui_web_view_web_controller.h"
+#import "base/ios/ns_error_util.h"
#import "base/ios/weak_nsobject.h"
#include "base/json/json_reader.h"
#include "base/json/string_escape.h"
@@ -35,6 +36,7 @@
#import "ios/web/web_state/web_state_impl.h"
#import "ios/web/web_state/web_view_internal_creation_util.h"
#import "net/base/mac/url_conversions.h"
+#include "net/base/net_errors.h"
#include "url/url_constants.h"
namespace web {
@@ -804,8 +806,15 @@ const size_t kMaxMessageQueueSize = 262144;
self.webScrollView.zoomScale = zoomScale;
}
--(BOOL)shouldAbortLoadForCancelledURL:(const GURL&)cancelledURL {
- return YES;
+- (BOOL)shouldAbortLoadForCancelledError:(NSError*)cancelledError {
+ // NSURLErrorCancelled errors generated by the Chrome net stack should be
+ // aborted. If the error was generated by the UIWebView, it will not have
+ // an underlying net error and will be automatically retried by the web view.
+ DCHECK_EQ(cancelledError.code, NSURLErrorCancelled);
+ NSError* underlyingError =
+ base::ios::GetFinalUnderlyingErrorFromError(cancelledError);
+ NSString* netDomain = base::SysUTF8ToNSString(net::kErrorDomain);
+ return [underlyingError.domain isEqualToString:netDomain];
}
#pragma mark - JS to ObjC messaging
« no previous file with comments | « ios/web/web_state/error_translation_util.mm ('k') | ios/web/web_state/ui/crw_web_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698