diff options
author | dsh@google.com <dsh@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-27 20:43:33 +0000 |
---|---|---|
committer | dsh@google.com <dsh@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-27 20:43:33 +0000 |
commit | e1acf6f902e50222baf99bfb492ecc38a1604975 (patch) | |
tree | 503d45705b14be7e2f1ed86c71d6064abbf90fbe /net/base | |
parent | a2f5993e1ce940e8a8eec900abaeed02e2eee09b (diff) | |
download | chromium_src-e1acf6f902e50222baf99bfb492ecc38a1604975.zip chromium_src-e1acf6f902e50222baf99bfb492ecc38a1604975.tar.gz chromium_src-e1acf6f902e50222baf99bfb492ecc38a1604975.tar.bz2 |
Move Time, TimeDelta and TimeTicks into namespace base.
Review URL: http://codereview.chromium.org/7995
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4022 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r-- | net/base/client_socket_pool.cc | 2 | ||||
-rw-r--r-- | net/base/cookie_monster.cc | 3 | ||||
-rw-r--r-- | net/base/cookie_monster.h | 34 | ||||
-rw-r--r-- | net/base/cookie_monster_unittest.cc | 3 | ||||
-rw-r--r-- | net/base/net_util.cc | 2 | ||||
-rw-r--r-- | net/base/sdch_manager.cc | 2 | ||||
-rw-r--r-- | net/base/sdch_manager.h | 4 | ||||
-rw-r--r-- | net/base/ssl_config_service.cc | 3 | ||||
-rw-r--r-- | net/base/ssl_config_service.h | 10 | ||||
-rw-r--r-- | net/base/ssl_config_service_unittest.cc | 3 | ||||
-rw-r--r-- | net/base/x509_certificate.h | 10 | ||||
-rw-r--r-- | net/base/x509_certificate_mac.cc | 2 | ||||
-rw-r--r-- | net/base/x509_certificate_unittest.cc | 2 | ||||
-rw-r--r-- | net/base/x509_certificate_win.cc | 2 |
14 files changed, 53 insertions, 29 deletions
diff --git a/net/base/client_socket_pool.cc b/net/base/client_socket_pool.cc index 2fb6703..46afef6 100644 --- a/net/base/client_socket_pool.cc +++ b/net/base/client_socket_pool.cc @@ -9,6 +9,8 @@ #include "net/base/client_socket_handle.h" #include "net/base/net_errors.h" +using base::TimeDelta; + namespace { // The timeout value, in seconds, used to clean up disconnected idle sockets. diff --git a/net/base/cookie_monster.cc b/net/base/cookie_monster.cc index 20a4a00a..136f38e 100644 --- a/net/base/cookie_monster.cc +++ b/net/base/cookie_monster.cc @@ -63,6 +63,9 @@ #define COOKIE_DLOG(severity) DLOG_IF(INFO, 0) #endif +using base::Time; +using base::TimeDelta; + namespace net { // static diff --git a/net/base/cookie_monster.h b/net/base/cookie_monster.h index 83f5a2b..11491ff 100644 --- a/net/base/cookie_monster.h +++ b/net/base/cookie_monster.h @@ -71,7 +71,7 @@ class CookieMonster { ~CookieMonster(); // Parse the string with the cookie time (very forgivingly). - static Time ParseCookieTime(const std::string& time_string); + static base::Time ParseCookieTime(const std::string& time_string); // Set a single cookie. Expects a cookie line, like "a=1; domain=b.com". bool SetCookie(const GURL& url, const std::string& cookie_line); @@ -80,7 +80,7 @@ class CookieMonster { // internally). bool SetCookieWithCreationTime(const GURL& url, const std::string& cookie_line, - const Time& creation_time); + const base::Time& creation_time); // Set a vector of response cookie values for the same URL. void SetCookies(const GURL& url, const std::vector<std::string>& cookies); @@ -97,12 +97,12 @@ class CookieMonster { int DeleteAll(bool sync_to_store); // Delete all of the cookies that have a creation_date greater than or equal // to |delete_begin| and less than |delete_end| - int DeleteAllCreatedBetween(const Time& delete_begin, - const Time& delete_end, + int DeleteAllCreatedBetween(const base::Time& delete_begin, + const base::Time& delete_end, bool sync_to_store); // Delete all of the cookies that have a creation_date more recent than the // one passed into the function via |delete_after|. - int DeleteAllCreatedAfter(const Time& delete_begin, bool sync_to_store); + int DeleteAllCreatedAfter(const base::Time& delete_begin, bool sync_to_store); // Delete one specific cookie. bool DeleteCookie(const std::string& domain, @@ -139,7 +139,7 @@ class CookieMonster { void FindCookiesForKey(const std::string& key, const GURL& url, CookieOptions options, - const Time& current, + const base::Time& current, std::vector<CanonicalCookie*>* cookies); int DeleteEquivalentCookies(const std::string& key, @@ -152,8 +152,8 @@ class CookieMonster { void InternalDeleteCookie(CookieMap::iterator it, bool sync_to_store); // Enforce cookie maximum limits, purging expired and old cookies if needed - int GarbageCollect(const Time& current, const std::string& key); - int GarbageCollectRange(const Time& current, + int GarbageCollect(const base::Time& current, const std::string& key); + int GarbageCollectRange(const base::Time& current, const CookieMapItPair& itpair, size_t num_max, size_t num_purge); @@ -168,8 +168,8 @@ class CookieMonster { // The resolution of our time isn't enough, so we do something // ugly and increment when we've seen the same time twice. - Time CurrentTime(); - Time last_time_seen_; + base::Time CurrentTime(); + base::Time last_time_seen_; // Lock for thread-safety Lock lock_; @@ -237,8 +237,8 @@ class CookieMonster::CanonicalCookie { public: CanonicalCookie(const std::string& name, const std::string& value, const std::string& path, bool secure, - bool httponly, const Time& creation, - bool has_expires, const Time& expires) + bool httponly, const base::Time& creation, + bool has_expires, const base::Time& expires) : name_(name), value_(value), path_(path), @@ -263,14 +263,14 @@ class CookieMonster::CanonicalCookie { const std::string& Name() const { return name_; } const std::string& Value() const { return value_; } const std::string& Path() const { return path_; } - const Time& CreationDate() const { return creation_date_; } + const base::Time& CreationDate() const { return creation_date_; } bool DoesExpire() const { return has_expires_; } bool IsPersistent() const { return DoesExpire(); } - const Time& ExpiryDate() const { return expiry_date_; } + const base::Time& ExpiryDate() const { return expiry_date_; } bool IsSecure() const { return secure_; } bool IsHttpOnly() const { return httponly_; } - bool IsExpired(const Time& current) { + bool IsExpired(const base::Time& current) { return has_expires_ && current >= expiry_date_; } @@ -289,8 +289,8 @@ class CookieMonster::CanonicalCookie { std::string name_; std::string value_; std::string path_; - Time creation_date_; - Time expiry_date_; + base::Time creation_date_; + base::Time expiry_date_; bool has_expires_; bool secure_; bool httponly_; diff --git a/net/base/cookie_monster_unittest.cc b/net/base/cookie_monster_unittest.cc index dde2cb1..f8765dc 100644 --- a/net/base/cookie_monster_unittest.cc +++ b/net/base/cookie_monster_unittest.cc @@ -13,6 +13,9 @@ #include "net/base/cookie_monster.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; +using base::TimeDelta; + namespace { class ParsedCookieTest : public testing::Test { }; class CookieMonsterTest : public testing::Test { }; diff --git a/net/base/net_util.cc b/net/base/net_util.cc index 305cbcc..507b7b4 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -37,6 +37,8 @@ #include "net/base/base64.h" #include "unicode/datefmt.h" +using base::Time; + namespace { // what we prepend to get a file URL diff --git a/net/base/sdch_manager.cc b/net/base/sdch_manager.cc index 365c8de..08c9d1c2 100644 --- a/net/base/sdch_manager.cc +++ b/net/base/sdch_manager.cc @@ -12,6 +12,8 @@ #include "net/base/sdch_manager.h" #include "net/url_request/url_request_http_job.h" +using base::Time; +using base::TimeDelta; //------------------------------------------------------------------------------ // static diff --git a/net/base/sdch_manager.h b/net/base/sdch_manager.h index 3aa6884..69055f1 100644 --- a/net/base/sdch_manager.h +++ b/net/base/sdch_manager.h @@ -110,7 +110,7 @@ class SdchManager { Dictionary(const std::string& dictionary_text, size_t offset, const std::string& client_hash, const GURL& url, const std::string& domain, const std::string& path, - const Time& expiration, const std::set<int> ports); + const base::Time& expiration, const std::set<int> ports); const GURL& url() const { return url_; } const std::string& client_hash() const { return client_hash_; } @@ -152,7 +152,7 @@ class SdchManager { // of the dictionary. The following are the known headers. const std::string domain_; const std::string path_; - const Time expiration_; // Implied by max-age. + const base::Time expiration_; // Implied by max-age. const std::set<int> ports_; DISALLOW_COPY_AND_ASSIGN(Dictionary); diff --git a/net/base/ssl_config_service.cc b/net/base/ssl_config_service.cc index b7be1f0..7e94955 100644 --- a/net/base/ssl_config_service.cc +++ b/net/base/ssl_config_service.cc @@ -6,6 +6,9 @@ #include "base/registry.h" +using base::TimeDelta; +using base::TimeTicks; + namespace net { static const int kConfigUpdateInterval = 10; // seconds diff --git a/net/base/ssl_config_service.h b/net/base/ssl_config_service.h index d2010e04..b4e0622 100644 --- a/net/base/ssl_config_service.h +++ b/net/base/ssl_config_service.h @@ -34,7 +34,7 @@ struct SSLConfig { class SSLConfigService { public: SSLConfigService(); - explicit SSLConfigService(TimeTicks now); // Used for testing. + explicit SSLConfigService(base::TimeTicks now); // Used for testing. ~SSLConfigService() { } // Get the current SSL configuration settings. Can be called on any @@ -50,18 +50,18 @@ class SSLConfigService { // we don't need the absolutely current configuration settings. This // method is not thread-safe, so it must be called on the same thread. void GetSSLConfig(SSLConfig* config) { - GetSSLConfigAt(config, TimeTicks::Now()); + GetSSLConfigAt(config, base::TimeTicks::Now()); } // Used for testing. - void GetSSLConfigAt(SSLConfig* config, TimeTicks now); + void GetSSLConfigAt(SSLConfig* config, base::TimeTicks now); private: - void UpdateConfig(TimeTicks now); + void UpdateConfig(base::TimeTicks now); // We store the IE SSL config and the time that we fetched it. SSLConfig config_info_; - TimeTicks config_time_; + base::TimeTicks config_time_; DISALLOW_EVIL_CONSTRUCTORS(SSLConfigService); }; diff --git a/net/base/ssl_config_service_unittest.cc b/net/base/ssl_config_service_unittest.cc index ae1b378..7aeef52 100644 --- a/net/base/ssl_config_service_unittest.cc +++ b/net/base/ssl_config_service_unittest.cc @@ -5,6 +5,9 @@ #include "net/base/ssl_config_service.h" #include "testing/gtest/include/gtest/gtest.h" +using base::TimeDelta; +using base::TimeTicks; + namespace { class SSLConfigServiceTest : public testing::Test { diff --git a/net/base/x509_certificate.h b/net/base/x509_certificate.h index e383532..ff6ba31 100644 --- a/net/base/x509_certificate.h +++ b/net/base/x509_certificate.h @@ -126,7 +126,7 @@ class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> { // Creates a X509Certificate from the ground up. Used by tests that simulate // SSL connections. X509Certificate(std::string subject, std::string issuer, - Time start_date, Time expiration_date); + base::Time start_date, base::Time expiration_date); // Appends a representation of this object to the given pickle. void Persist(Pickle* pickle); @@ -144,8 +144,8 @@ class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> { // the |valid_expiry| date. // If we were unable to parse either date from the certificate (or if the cert // lacks either date), the date will be null (i.e., is_null() will be true). - const Time& valid_start() const { return valid_start_; } - const Time& valid_expiry() const { return valid_expiry_; } + const base::Time& valid_start() const { return valid_start_; } + const base::Time& valid_expiry() const { return valid_expiry_; } // The fingerprint of this certificate. const Fingerprint& fingerprint() const { return fingerprint_; } @@ -210,10 +210,10 @@ class X509Certificate : public base::RefCountedThreadSafe<X509Certificate> { Principal issuer_; // This certificate is not valid before |valid_start_| - Time valid_start_; + base::Time valid_start_; // This certificate is not valid after |valid_expiry_| - Time valid_expiry_; + base::Time valid_expiry_; // The fingerprint of this certificate. Fingerprint fingerprint_; diff --git a/net/base/x509_certificate_mac.cc b/net/base/x509_certificate_mac.cc index e60e19a..11191bd 100644 --- a/net/base/x509_certificate_mac.cc +++ b/net/base/x509_certificate_mac.cc @@ -13,6 +13,8 @@ #include "net/base/cert_status_flags.h" #include "net/base/ev_root_ca_metadata.h" +using base::Time; + namespace net { namespace { diff --git a/net/base/x509_certificate_unittest.cc b/net/base/x509_certificate_unittest.cc index 73a8337..499b914 100644 --- a/net/base/x509_certificate_unittest.cc +++ b/net/base/x509_certificate_unittest.cc @@ -14,6 +14,8 @@ // testing. #define ALLOW_EXTERNAL_ACCESS 0 +using base::Time; + namespace { class X509CertificateTest : public testing::Test { diff --git a/net/base/x509_certificate_win.cc b/net/base/x509_certificate_win.cc index 138f20d..4e7c4ba 100644 --- a/net/base/x509_certificate_win.cc +++ b/net/base/x509_certificate_win.cc @@ -15,6 +15,8 @@ #pragma comment(lib, "crypt32.lib") +using base::Time; + namespace net { namespace { |