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

Unified Diff: content/browser/loader/offline_manager.h

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
« no previous file with comments | « no previous file | content/browser/loader/offline_manager.cc » ('j') | content/browser/loader/offline_manager.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/offline_manager.h
diff --git a/content/browser/loader/offline_manager.h b/content/browser/loader/offline_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..951e589f7996dbc7016e28bbb3d3ff4ac631030c
--- /dev/null
+++ b/content/browser/loader/offline_manager.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// 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
+// loading.
+
+#ifndef CONTENT_BROWSER_LOADER_OFFLINE_MANAGER
+#define CONTENT_BROWSER_LOADER_OFFLINE_MANAGER
+
+#include <map>
+
+#include "base/basictypes.h"
+
+struct ResourceHostMsg_Request;
+
+namespace net {
+class HttpResponseInfo;
+class URLRequest;
+}
+
+namespace content {
+
+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.
+ public:
+ OfflineManager();
+ ~OfflineManager();
+
+ // Return any additional load flags to be |'d for the current request.
+ 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.
+ const ResourceHostMsg_Request& request_data);
+
+ // Incorporate online/offline information from a completed request.
+ // Note that the response info must be available through
+ // |request->response_info()|.
+ void RequestCompleted(int child_id, int route_id,
+ const net::URLRequest* request);
+
+ 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
+
+private:
+ typedef enum { ROUTE_INIT, ROUTE_ONLINE, ROUTE_OFFLINE } RouteOfflineState;
+
+ // child_id, route_id -> state.
+ typedef std::map<std::pair<int, int>, RouteOfflineState> RouteMap;
+
+ RouteMap offline_state_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(OfflineManager);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_LOADER_OFFLINE_MANAGER
« no previous file with comments | « no previous file | content/browser/loader/offline_manager.cc » ('j') | content/browser/loader/offline_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698