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

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

Issue 12886022: Implement offline mode behind a flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to r190685 (past landing of https://codereview.chromium.org/12310075). Created 7 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: 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 3849313958054add332c20ecf097b12344f45395..477366c1e75d25ea7c9829a64c37035857b3c629 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -231,8 +231,9 @@ net::Error CallbackAndReturn(
return net_error;
}
-int BuildLoadFlagsForRequest(const ResourceHostMsg_Request& request_data,
- int child_id, bool is_sync_load) {
+int BuildLoadFlagsForRequest(
+ const ResourceHostMsg_Request& request_data, int child_id,
+ bool is_sync_load) {
int load_flags = request_data.load_flags;
// Although EV status is irrelevant to sub-frames and sub-resources, we have
@@ -701,6 +702,9 @@ void ResourceDispatcherHostImpl::DidReceiveRedirect(ResourceLoader* loader,
void ResourceDispatcherHostImpl::DidReceiveResponse(ResourceLoader* loader) {
ResourceRequestInfoImpl* info = loader->GetRequestInfo();
+ offline_manager_.RequestCompleted(info->GetChildID(), info->GetRouteID(),
+ loader->request());
+
int render_process_id, render_view_id;
if (!info->GetAssociatedRenderView(&render_process_id, &render_view_id))
return;
@@ -933,6 +937,8 @@ void ResourceDispatcherHostImpl::BeginRequest(
bool is_sync_load = sync_result != NULL;
int load_flags =
BuildLoadFlagsForRequest(request_data, child_id, is_sync_load);
+ load_flags |= offline_manager_.OfflineLoadFlags(
+ child_id, route_id, request_data);
// Construct the request.
scoped_ptr<net::URLRequest> new_request;
@@ -1368,6 +1374,9 @@ void ResourceDispatcherHostImpl::CancelRequestsForRoute(int child_id,
CancelBlockedRequestsForRoute(child_id, *iter);
}
}
+
+ // Cleanup the offline state for the route.
+ offline_manager_.RouteDeleted(child_id, route_id);
}
// Cancels the request and removes it from the list.

Powered by Google App Engine
This is Rietveld 408576698