diff options
author | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-19 23:06:05 +0000 |
---|---|---|
committer | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-19 23:06:05 +0000 |
commit | 8a2a25fe7d7dc0dc777a1f7250363721f7e18582 (patch) | |
tree | 0a109a9d44f88550cbcbb653fbe8912ba5b2a2d9 /net/http | |
parent | 2b1d4f22e452351e6c8870f5e7c667cb64883121 (diff) | |
download | chromium_src-8a2a25fe7d7dc0dc777a1f7250363721f7e18582.zip chromium_src-8a2a25fe7d7dc0dc777a1f7250363721f7e18582.tar.gz chromium_src-8a2a25fe7d7dc0dc777a1f7250363721f7e18582.tar.bz2 |
add http_cache to mac build.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1068 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r-- | net/http/http_cache.cc | 10 | ||||
-rw-r--r-- | net/http/http_cache.h | 19 | ||||
-rw-r--r-- | net/http/http_response_headers.h | 14 |
3 files changed, 21 insertions, 22 deletions
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index a1bee69..336a0bd 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -169,8 +169,9 @@ std::string HttpCache::GenerateCacheKey(const HttpRequestInfo* request) { //----------------------------------------------------------------------------- -HttpCache::ActiveEntry::ActiveEntry(disk_cache::Entry *e) +HttpCache::ActiveEntry::ActiveEntry(disk_cache::Entry* e) : disk_entry(e), + writer(NULL), will_process_pending_queue(false), doomed(false) { } @@ -630,7 +631,7 @@ void HttpCache::Transaction::SetRequest(const HttpRequestInfo* request) { request_->extra_headers.end(), "\r\n"); while (it.GetNext()) { - for (size_t i = 0; i < arraysize(kSpecialHeaders); ++i) { + for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kSpecialHeaders); ++i) { if (HeaderMatches(it, kSpecialHeaders[i].search)) { effective_load_flags_ |= kSpecialHeaders[i].load_flag; break; @@ -731,7 +732,7 @@ bool HttpCache::Transaction::RequiresValidation() { // - make sure we have a matching request method // - watch out for cached responses that depend on authentication // In playback mode, nothing requires validation. - if (mode_ == PLAYBACK) + if (mode_ == net::HttpCache::PLAYBACK) return false; if (effective_load_flags_ & LOAD_VALIDATE_CACHE) @@ -1115,7 +1116,7 @@ bool HttpCache::WriteResponseInfo(disk_cache::Entry* disk_entry, response_info->vary_data.Persist(&pickle); const char* data = static_cast<const char*>(pickle.data()); - int len = pickle.size(); + int len = static_cast<int>(pickle.size()); return disk_entry->WriteData(kResponseInfoIndex, 0, data, len, NULL, true) == len; @@ -1194,7 +1195,6 @@ HttpCache::ActiveEntry* HttpCache::ActivateEntry( const std::string& key, disk_cache::Entry* disk_entry) { ActiveEntry* entry = new ActiveEntry(disk_entry); - entry->writer = NULL; active_entries_[key] = entry; return entry; } diff --git a/net/http/http_cache.h b/net/http/http_cache.h index 5fee2e2..19d15ea 100644 --- a/net/http/http_cache.h +++ b/net/http/http_cache.h @@ -36,15 +36,14 @@ // // See HttpTransactionFactory and HttpTransaction for more details. -#ifndef NET_HTTP_HTTP_CACHE_H__ -#define NET_HTTP_HTTP_CACHE_H__ +#ifndef NET_HTTP_HTTP_CACHE_H_ +#define NET_HTTP_HTTP_CACHE_H_ -#include <hash_map> -#include <hash_set> #include <list> #include <string> #include "base/basictypes.h" +#include "base/hash_tables.h" #include "base/task.h" #include "net/http/http_transaction_factory.h" @@ -125,7 +124,7 @@ class HttpCache : public HttpTransactionFactory { // Types -------------------------------------------------------------------- class Transaction; - friend Transaction; + friend class Transaction; typedef std::list<Transaction*> TransactionList; @@ -141,8 +140,8 @@ class HttpCache : public HttpTransactionFactory { ~ActiveEntry(); }; - typedef stdext::hash_map<std::string, ActiveEntry*> ActiveEntriesMap; - typedef stdext::hash_set<ActiveEntry*> ActiveEntriesSet; + typedef base::hash_map<std::string, ActiveEntry*> ActiveEntriesMap; + typedef std::set<ActiveEntry*> ActiveEntriesSet; // Methods ------------------------------------------------------------------ @@ -189,12 +188,12 @@ class HttpCache : public HttpTransactionFactory { bool in_memory_cache_; int cache_size_; - typedef stdext::hash_map<std::string, int> PlaybackCacheMap; + typedef base::hash_map<std::string, int> PlaybackCacheMap; scoped_ptr<PlaybackCacheMap> playback_cache_map_; - DISALLOW_EVIL_CONSTRUCTORS(HttpCache); + DISALLOW_COPY_AND_ASSIGN(HttpCache); }; } // namespace net -#endif // NET_HTTP_HTTP_CACHE_H__ +#endif // NET_HTTP_HTTP_CACHE_H_ diff --git a/net/http/http_response_headers.h b/net/http/http_response_headers.h index 91a5281..fcd069a 100644 --- a/net/http/http_response_headers.h +++ b/net/http/http_response_headers.h @@ -27,14 +27,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef NET_HTTP_RESPONSE_HEADERS_H__ -#define NET_HTTP_RESPONSE_HEADERS_H__ +#ifndef NET_HTTP_RESPONSE_HEADERS_H_ +#define NET_HTTP_RESPONSE_HEADERS_H_ -#include <hash_set> #include <string> #include <vector> #include "base/basictypes.h" +#include "base/hash_tables.h" #include "base/ref_counted.h" class Pickle; @@ -203,7 +203,7 @@ class HttpResponseHeaders : const std::string& raw_headers() const { return raw_headers_; } private: - friend RefCountedThreadSafe<HttpResponseHeaders>; + friend class base::RefCountedThreadSafe<HttpResponseHeaders>; HttpResponseHeaders() {} ~HttpResponseHeaders() {} @@ -253,7 +253,7 @@ class HttpResponseHeaders : std::string::const_iterator value_begin, std::string::const_iterator value_end); - typedef stdext::hash_set<std::string> HeaderSet; + typedef base::hash_set<std::string> HeaderSet; // Returns the values from any 'cache-control: no-cache="foo,bar"' headers as // well as other known-to-be-transient header names. The header names are @@ -287,9 +287,9 @@ class HttpResponseHeaders : // This is the parsed HTTP response code. int response_code_; - DISALLOW_EVIL_CONSTRUCTORS(HttpResponseHeaders); + DISALLOW_COPY_AND_ASSIGN(HttpResponseHeaders); }; } // namespace net -#endif // NET_HTTP_RESPONSE_HEADERS_H__ +#endif // NET_HTTP_RESPONSE_HEADERS_H_ |