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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/appcache/appcache_interceptor.cc ('k') | webkit/appcache/appcache_request_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2009 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 #ifndef WEBKIT_APPCACHE_APPCACHE_REQUEST_HANDLER_H_
6 #define WEBKIT_APPCACHE_APPCACHE_REQUEST_HANDLER_H_
7
8 #include "net/url_request/url_request.h"
9 #include "webkit/appcache/appcache_host.h"
10
11 class URLRequest;
12 class URLRequestJob;
13
14 namespace appcache {
15
16 // An instance is created for each URLRequest. The instance survives all
17 // http transactions involved in the processing of its URLRequest, and is
18 // given the opportunity to hijack the request along the way. Callers
19 // should use AppCacheHost::CreateRequestHandler to manufacture instances
20 // that can retrieve resources for a particular host.
21 class AppCacheRequestHandler : public URLRequest::UserData {
22 public:
23 // Should be called on each request intercept opportunity.
24 URLRequestJob* MaybeLoadResource(URLRequest* request);
25 URLRequestJob* MaybeLoadFallbackForRedirect(URLRequest* request,
26 const GURL& location);
27 URLRequestJob* MaybeLoadFallbackForResponse(URLRequest* request);
28
29 void GetExtraResponseInfo(int64* cache_id, GURL* manifest_url);
30
31 private:
32 friend class AppCacheHost;
33
34 // Ctor for main resource loads.
35 explicit AppCacheRequestHandler(AppCacheHost* host);
36
37 // Ctor for subresource loads when the cache is loaded.
38 explicit AppCacheRequestHandler(AppCache* cache);
39
40 // Main vs subresource loads are very different.
41 // TODO(michaeln): maybe have two derived classes?
42 bool is_main_request_;
43 int64 cache_id_;
44 scoped_refptr<AppCache> cache_;
45 base::WeakPtr<AppCacheHost> host_;
46 scoped_refptr<URLRequestJob> job_;
47 AppCacheService* service_;
48 };
49
50 } // namespace appcache
51
52 #endif // WEBKIT_APPCACHE_APPCACHE_REQUEST_HANDLER_H_
53
OLDNEW
« 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