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

Unified Diff: extensions/shell/browser/shell_network_delegate.cc

Issue 2264973002: Adjust callers and networking delegates in extensions/ to modified APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@URLRequestRead
Patch Set: Created 4 years, 3 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: extensions/shell/browser/shell_network_delegate.cc
diff --git a/extensions/shell/browser/shell_network_delegate.cc b/extensions/shell/browser/shell_network_delegate.cc
index 7fe905f899b10d578a998afaecdfe664f3af7e87..51ea88a3b8dcc1564c8901728616f1780b4ff7d5 100644
--- a/extensions/shell/browser/shell_network_delegate.cc
+++ b/extensions/shell/browser/shell_network_delegate.cc
@@ -76,35 +76,30 @@ void ShellNetworkDelegate::OnBeforeRedirect(
browser_context_, extension_info_map_.get(), request, new_location);
}
-
-void ShellNetworkDelegate::OnResponseStarted(
- net::URLRequest* request) {
+void ShellNetworkDelegate::OnResponseStarted(net::URLRequest* request,
+ int net_error) {
ExtensionWebRequestEventRouter::GetInstance()->OnResponseStarted(
- browser_context_, extension_info_map_.get(), request);
+ browser_context_, extension_info_map_.get(), request, net_error);
}
-void ShellNetworkDelegate::OnCompleted(
- net::URLRequest* request,
- bool started) {
- if (request->status().status() == net::URLRequestStatus::SUCCESS) {
+void ShellNetworkDelegate::OnCompleted(net::URLRequest* request,
+ bool started,
+ int net_error) {
+ DCHECK_NE(net::ERR_IO_PENDING, net_error);
+
+ if (net_error == net::OK) {
bool is_redirect = request->response_headers() &&
net::HttpResponseHeaders::IsRedirectResponseCode(
request->response_headers()->response_code());
if (!is_redirect) {
ExtensionWebRequestEventRouter::GetInstance()->OnCompleted(
- browser_context_, extension_info_map_.get(), request);
+ browser_context_, extension_info_map_.get(), request, net_error);
}
- return;
- }
-
- if (request->status().status() == net::URLRequestStatus::FAILED ||
- request->status().status() == net::URLRequestStatus::CANCELED) {
+ } else {
ExtensionWebRequestEventRouter::GetInstance()->OnErrorOccurred(
- browser_context_, extension_info_map_.get(), request, started);
- return;
+ browser_context_, extension_info_map_.get(), request, started,
+ net_error);
}
-
- NOTREACHED();
}
void ShellNetworkDelegate::OnURLRequestDestroyed(

Powered by Google App Engine
This is Rietveld 408576698