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

Side by Side Diff: net/http/http_cache.h

Issue 3814013: FBTF: Monster ctor patch after changing heuristics in clang plugin. (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: More add file fail Created 10 years, 2 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 | « net/ftp/ftp_network_session.cc ('k') | net/http/http_cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file declares a HttpTransactionFactory implementation that can be 5 // This file declares a HttpTransactionFactory implementation that can be
6 // layered on top of another HttpTransactionFactory to add HTTP caching. The 6 // layered on top of another HttpTransactionFactory to add HTTP caching. The
7 // caching logic follows RFC 2616 (any exceptions are called out in the code). 7 // caching logic follows RFC 2616 (any exceptions are called out in the code).
8 // 8 //
9 // The HttpCache takes a disk_cache::Backend as a parameter, and uses that for 9 // The HttpCache takes a disk_cache::Backend as a parameter, and uses that for
10 // the cache storage. 10 // the cache storage.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 CompletionCallback* callback) = 0; 89 CompletionCallback* callback) = 0;
90 }; 90 };
91 91
92 // A default backend factory for the common use cases. 92 // A default backend factory for the common use cases.
93 class DefaultBackend : public BackendFactory { 93 class DefaultBackend : public BackendFactory {
94 public: 94 public:
95 // |path| is the destination for any files used by the backend, and 95 // |path| is the destination for any files used by the backend, and
96 // |cache_thread| is the thread where disk operations should take place. If 96 // |cache_thread| is the thread where disk operations should take place. If
97 // |max_bytes| is zero, a default value will be calculated automatically. 97 // |max_bytes| is zero, a default value will be calculated automatically.
98 DefaultBackend(CacheType type, const FilePath& path, int max_bytes, 98 DefaultBackend(CacheType type, const FilePath& path, int max_bytes,
99 base::MessageLoopProxy* thread) 99 base::MessageLoopProxy* thread);
100 : type_(type), path_(path), max_bytes_(max_bytes), thread_(thread) {} 100 virtual ~DefaultBackend();
101 101
102 // Returns a factory for an in-memory cache. 102 // Returns a factory for an in-memory cache.
103 static BackendFactory* InMemory(int max_bytes) { 103 static BackendFactory* InMemory(int max_bytes);
104 return new DefaultBackend(MEMORY_CACHE, FilePath(), max_bytes, NULL);
105 }
106 104
107 // BackendFactory implementation. 105 // BackendFactory implementation.
108 virtual int CreateBackend(disk_cache::Backend** backend, 106 virtual int CreateBackend(disk_cache::Backend** backend,
109 CompletionCallback* callback); 107 CompletionCallback* callback);
110 108
111 private: 109 private:
112 CacheType type_; 110 CacheType type_;
113 const FilePath path_; 111 const FilePath path_;
114 int max_bytes_; 112 int max_bytes_;
115 scoped_refptr<base::MessageLoopProxy> thread_; 113 scoped_refptr<base::MessageLoopProxy> thread_;
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 369
372 typedef base::hash_map<std::string, int> PlaybackCacheMap; 370 typedef base::hash_map<std::string, int> PlaybackCacheMap;
373 scoped_ptr<PlaybackCacheMap> playback_cache_map_; 371 scoped_ptr<PlaybackCacheMap> playback_cache_map_;
374 372
375 DISALLOW_COPY_AND_ASSIGN(HttpCache); 373 DISALLOW_COPY_AND_ASSIGN(HttpCache);
376 }; 374 };
377 375
378 } // namespace net 376 } // namespace net
379 377
380 #endif // NET_HTTP_HTTP_CACHE_H_ 378 #endif // NET_HTTP_HTTP_CACHE_H_
OLDNEW
« no previous file with comments | « net/ftp/ftp_network_session.cc ('k') | net/http/http_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698