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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 2526983002: Refactor ResourceHandler API. (Closed)
Patch Set: Response to comments Created 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 5669449ed703cfe52feab5132a6010e7da6c29b1..71577dc8cdccd795cb80afd653e2195c2e259c0b 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -53,6 +53,7 @@
#include "content/browser/loader/navigation_resource_handler.h"
#include "content/browser/loader/navigation_resource_throttle.h"
#include "content/browser/loader/navigation_url_loader_impl_core.h"
+#include "content/browser/loader/null_resource_controller.h"
#include "content/browser/loader/power_save_block_resource_throttle.h"
#include "content/browser/loader/redirect_to_file_resource_handler.h"
#include "content/browser/loader/resource_loader.h"
@@ -2345,12 +2346,14 @@ void ResourceDispatcherHostImpl::BeginRequestInternal(
// status -- it has no effect beyond this, since the request hasn't started.
request->CancelWithError(net::ERR_INSUFFICIENT_RESOURCES);
- bool defer = false;
- handler->OnResponseCompleted(request->status(), &defer);
- if (defer) {
- // TODO(darin): The handler is not ready for us to kill the request. Oops!
- NOTREACHED();
- }
+ bool was_resumed = false;
+ // TODO(mmenke): Get rid of NullResourceController and do something more
+ // reasonable.
+ handler->OnResponseCompleted(
+ request->status(),
+ base::MakeUnique<NullResourceController>(&was_resumed));
+ // TODO(darin): The handler is not ready for us to kill the request. Oops!
+ DCHECK(was_resumed);
IncrementOutstandingRequestsMemory(-1, *info);
« no previous file with comments | « content/browser/loader/resource_controller.h ('k') | content/browser/loader/resource_dispatcher_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698