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 | |
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')
-rw-r--r-- | net/base/ssl_info.h | 6 | ||||
-rw-r--r-- | net/base/x509_certificate.h | 17 | ||||
-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 | ||||
-rw-r--r-- | net/net.xcodeproj/project.pbxproj | 2 |
6 files changed, 38 insertions, 30 deletions
diff --git a/net/base/ssl_info.h b/net/base/ssl_info.h index 07655eb..1bd3771 100644 --- a/net/base/ssl_info.h +++ b/net/base/ssl_info.h @@ -27,8 +27,8 @@ // (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_BASE_SSL_INFO_H__ -#define NET_BASE_SSL_INFO_H__ +#ifndef NET_BASE_SSL_INFO_H_ +#define NET_BASE_SSL_INFO_H_ #include "net/base/cert_status_flags.h" #include "net/base/net_errors.h" @@ -99,4 +99,4 @@ class SSLInfo { } // namespace net -#endif // NET_BASE_SSL_INFO_H__ +#endif // NET_BASE_SSL_INFO_H_ diff --git a/net/base/x509_certificate.h b/net/base/x509_certificate.h index 3d0f779..729fdc2 100644 --- a/net/base/x509_certificate.h +++ b/net/base/x509_certificate.h @@ -30,9 +30,6 @@ #ifndef NET_BASE_X509_CERTIFICATE_H_ #define NET_BASE_X509_CERTIFICATE_H_ -#include <windows.h> -#include <wincrypt.h> - #include <set> #include <string> #include <vector> @@ -40,6 +37,11 @@ #include "base/ref_counted.h" #include "base/time.h" +#if defined(OS_WIN) +#include <windows.h> +#include <wincrypt.h> +#endif + class Pickle; namespace net { @@ -65,8 +67,13 @@ class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> { bool operator() (X509Certificate* lhs, X509Certificate* rhs) const; }; +#if defined(OS_WIN) typedef PCCERT_CONTEXT OSCertHandle; - +#else + // TODO(ericroman): not implemented + typedef void* OSCertHandle; +#endif + // Principal represent an X.509 principal. struct Principal { Principal() { } @@ -180,7 +187,7 @@ class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> { // in the underlying crypto library. explicit X509Certificate(OSCertHandle cert_handle); - friend RefCountedThreadSafe<X509Certificate>; + friend class base::RefCountedThreadSafe<X509Certificate>; ~X509Certificate(); // Common object initialization code. Called by the constructors only. 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_ diff --git a/net/net.xcodeproj/project.pbxproj b/net/net.xcodeproj/project.pbxproj index 9389da0..8449b30 100644 --- a/net/net.xcodeproj/project.pbxproj +++ b/net/net.xcodeproj/project.pbxproj @@ -25,6 +25,7 @@ 048268070E5B3B1000A30786 /* mime_util.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7BED32AA0E5A181C00A747DB /* mime_util.cc */; }; 048268080E5B3B3200A30786 /* http_chunked_decoder_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7BED33570E5A194700A747DB /* http_chunked_decoder_unittest.cc */; }; 048268090E5B3B4800A30786 /* mime_util_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7BED325E0E5A181C00A747DB /* mime_util_unittest.cc */; }; + 0482692A0E5B624D00A30786 /* http_cache.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7BED334C0E5A194700A747DB /* http_cache.cc */; }; 7B8502040E5A376900730B43 /* libgoogleurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B8501FE0E5A372500730B43 /* libgoogleurl.a */; }; 7B8502050E5A377100730B43 /* auth_cache_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7BED32790E5A181C00A747DB /* auth_cache_unittest.cc */; }; 7B8502120E5A37A800730B43 /* base64_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7BED32760E5A181C00A747DB /* base64_unittest.cc */; }; @@ -1170,6 +1171,7 @@ 7BA015510E5A1C0900044150 /* gzip_filter.cc in Sources */, 7BA016A30E5A1EE900044150 /* gzip_header.cc in Sources */, 7B8504280E5B2E2A00730B43 /* hash.cc in Sources */, + 0482692A0E5B624D00A30786 /* http_cache.cc in Sources */, 7B85042B0E5B2E2A00730B43 /* http_chunked_decoder.cc in Sources */, 7B85042F0E5B2E4900730B43 /* http_util.cc in Sources */, 7B8504320E5B2E4900730B43 /* mapped_file_posix.cc in Sources */, |