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

Unified Diff: android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc

Issue 1001003004: [Android WebView] Implement a better OnReceivedError callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restored empty line Created 5 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 side-by-side diff with in-line comments
Download patch
Index: android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
diff --git a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
index 36f37d475348d75b0bd85d1d81a74ef288313eea..a2ff7dea99f37a76308c40398a75648b29f2c8e0 100644
--- a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
+++ b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
@@ -24,6 +24,7 @@
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request.h"
+#include "net/url_request/url_request_status.h"
#include "url/url_constants.h"
using android_webview::AwContentsIoThreadClient;
@@ -241,6 +242,26 @@ void AwResourceDispatcherHostDelegate::OnRequestRedirected(
AddExtraHeadersIfNeeded(request, resource_context);
}
+void AwResourceDispatcherHostDelegate::RequestComplete(
+ net::URLRequest* request) {
+ const content::ResourceRequestInfo* request_info =
+ content::ResourceRequestInfo::ForRequest(request);
+ if (!request_info) {
sgurun-gerrit only 2015/03/17 00:30:04 curious if this can this can actually be null, sin
mnaganov (inactive) 2015/03/17 15:29:09 Thanks for pointing this out! ChromeResourceDispat
+ DLOG(FATAL) << "Completed request without associated info: " <<
+ request->url();
+ return;
+ }
+
+ if (!request->status().is_success()) {
+ scoped_ptr<AwContentsIoThreadClient> io_client =
+ AwContentsIoThreadClient::FromID(request_info->GetChildID(),
+ request_info->GetRenderFrameID());
+ if (io_client) {
+ io_client->OnReceivedError(request);
+ }
sgurun-gerrit only 2015/03/17 00:30:04 maybe dlog here if there is no io_client, otherwis
mnaganov (inactive) 2015/03/17 15:29:09 Done.
+ }
+}
+
void AwResourceDispatcherHostDelegate::DownloadStarting(
net::URLRequest* request,

Powered by Google App Engine
This is Rietveld 408576698