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

Unified Diff: webkit/appcache/appcache_request_handler.h

Issue 192043: AppCacheHost cache selection algorithm (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « webkit/appcache/appcache_interceptor.cc ('k') | webkit/appcache/appcache_request_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/appcache/appcache_request_handler.h
===================================================================
--- webkit/appcache/appcache_request_handler.h (revision 0)
+++ webkit/appcache/appcache_request_handler.h (revision 0)
@@ -0,0 +1,53 @@
+// Copyright (c) 2009 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.
+
+#ifndef WEBKIT_APPCACHE_APPCACHE_REQUEST_HANDLER_H_
+#define WEBKIT_APPCACHE_APPCACHE_REQUEST_HANDLER_H_
+
+#include "net/url_request/url_request.h"
+#include "webkit/appcache/appcache_host.h"
+
+class URLRequest;
+class URLRequestJob;
+
+namespace appcache {
+
+// An instance is created for each URLRequest. The instance survives all
+// http transactions involved in the processing of its URLRequest, and is
+// given the opportunity to hijack the request along the way. Callers
+// should use AppCacheHost::CreateRequestHandler to manufacture instances
+// that can retrieve resources for a particular host.
+class AppCacheRequestHandler : public URLRequest::UserData {
+ public:
+ // Should be called on each request intercept opportunity.
+ URLRequestJob* MaybeLoadResource(URLRequest* request);
+ URLRequestJob* MaybeLoadFallbackForRedirect(URLRequest* request,
+ const GURL& location);
+ URLRequestJob* MaybeLoadFallbackForResponse(URLRequest* request);
+
+ void GetExtraResponseInfo(int64* cache_id, GURL* manifest_url);
+
+ private:
+ friend class AppCacheHost;
+
+ // Ctor for main resource loads.
+ explicit AppCacheRequestHandler(AppCacheHost* host);
+
+ // Ctor for subresource loads when the cache is loaded.
+ explicit AppCacheRequestHandler(AppCache* cache);
+
+ // Main vs subresource loads are very different.
+ // TODO(michaeln): maybe have two derived classes?
+ bool is_main_request_;
+ int64 cache_id_;
+ scoped_refptr<AppCache> cache_;
+ base::WeakPtr<AppCacheHost> host_;
+ scoped_refptr<URLRequestJob> job_;
+ AppCacheService* service_;
+};
+
+} // namespace appcache
+
+#endif // WEBKIT_APPCACHE_APPCACHE_REQUEST_HANDLER_H_
+
Property changes on: webkit\appcache\appcache_request_handler.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « webkit/appcache/appcache_interceptor.cc ('k') | webkit/appcache/appcache_request_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698