Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 // | |
| 5 // This class manages the switch between offline and online for resource | |
|
darin (slow to review)
2013/03/27 18:33:59
I think it'd be helpful to describe the goal of th
Randy Smith (Not in Mondays)
2013/04/03 19:20:34
Hmmm. I had considered that in the realm of polic
| |
| 6 // loading. | |
| 7 | |
| 8 #ifndef CONTENT_BROWSER_LOADER_OFFLINE_MANAGER | |
| 9 #define CONTENT_BROWSER_LOADER_OFFLINE_MANAGER | |
| 10 | |
| 11 #include <map> | |
| 12 | |
| 13 #include "base/basictypes.h" | |
| 14 | |
| 15 struct ResourceHostMsg_Request; | |
| 16 | |
| 17 namespace net { | |
| 18 class HttpResponseInfo; | |
| 19 class URLRequest; | |
| 20 } | |
| 21 | |
| 22 namespace content { | |
| 23 | |
| 24 class OfflineManager { | |
|
darin (slow to review)
2013/03/27 18:33:59
nit: manager is such a generic term. I wonder if
Randy Smith (Not in Mondays)
2013/04/03 19:20:34
Done.
| |
| 25 public: | |
| 26 OfflineManager(); | |
| 27 ~OfflineManager(); | |
| 28 | |
| 29 // Return any additional load flags to be |'d for the current request. | |
| 30 int OfflineLoadFlags(int child_id, int route_id, | |
|
darin (slow to review)
2013/03/27 18:33:59
nit: maybe call this GetAdditionalLoadFlags? What
Randy Smith (Not in Mondays)
2013/04/03 19:20:34
Done.
| |
| 31 const ResourceHostMsg_Request& request_data); | |
| 32 | |
| 33 // Incorporate online/offline information from a completed request. | |
| 34 // Note that the response info must be available through | |
| 35 // |request->response_info()|. | |
| 36 void RequestCompleted(int child_id, int route_id, | |
| 37 const net::URLRequest* request); | |
| 38 | |
| 39 void RouteDeleted(int child_id, int route_id); | |
|
darin (slow to review)
2013/03/27 18:33:59
should there be an explicit RouteAdded? RouteDele
Randy Smith (Not in Mondays)
2013/04/03 19:20:34
Sorry to reflect this back, but I'd be inclined to
| |
| 40 | |
| 41 private: | |
| 42 typedef enum { ROUTE_INIT, ROUTE_ONLINE, ROUTE_OFFLINE } RouteOfflineState; | |
| 43 | |
| 44 // child_id, route_id -> state. | |
| 45 typedef std::map<std::pair<int, int>, RouteOfflineState> RouteMap; | |
| 46 | |
| 47 RouteMap offline_state_map_; | |
| 48 | |
| 49 DISALLOW_COPY_AND_ASSIGN(OfflineManager); | |
| 50 }; | |
| 51 | |
| 52 } // namespace content | |
| 53 | |
| 54 #endif // CONTENT_BROWSER_LOADER_OFFLINE_MANAGER | |
| OLD | NEW |