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/disk_cache | |
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/disk_cache')
-rw-r--r-- | net/disk_cache/backend_impl.cc | 3 | ||||
-rw-r--r-- | net/disk_cache/backend_impl.h | 6 | ||||
-rw-r--r-- | net/disk_cache/backend_unittest.cc | 2 | ||||
-rw-r--r-- | net/disk_cache/block_files.cc | 2 | ||||
-rw-r--r-- | net/disk_cache/block_files_unittest.cc | 2 | ||||
-rw-r--r-- | net/disk_cache/disk_cache.h | 10 | ||||
-rw-r--r-- | net/disk_cache/disk_cache_perftest.cc | 2 | ||||
-rw-r--r-- | net/disk_cache/disk_cache_test_util.cc | 3 | ||||
-rw-r--r-- | net/disk_cache/entry_impl.cc | 3 | ||||
-rw-r--r-- | net/disk_cache/entry_impl.h | 4 | ||||
-rw-r--r-- | net/disk_cache/entry_unittest.cc | 2 | ||||
-rw-r--r-- | net/disk_cache/mem_backend_impl.cc | 2 | ||||
-rw-r--r-- | net/disk_cache/mem_backend_impl.h | 5 | ||||
-rw-r--r-- | net/disk_cache/mem_entry_impl.cc | 2 | ||||
-rw-r--r-- | net/disk_cache/mem_entry_impl.h | 8 | ||||
-rw-r--r-- | net/disk_cache/rankings.cc | 3 | ||||
-rw-r--r-- | net/disk_cache/stress_cache.cc | 2 |
17 files changed, 44 insertions, 17 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index c0fa867..da11f98 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -17,6 +17,9 @@ #include "net/disk_cache/hash.h" #include "net/disk_cache/file.h" +using base::Time; +using base::TimeDelta; + namespace { const wchar_t* kIndexName = L"index"; diff --git a/net/disk_cache/backend_impl.h b/net/disk_cache/backend_impl.h index 6818d84..40b6f51 100644 --- a/net/disk_cache/backend_impl.h +++ b/net/disk_cache/backend_impl.h @@ -41,9 +41,9 @@ class BackendImpl : public Backend { virtual bool CreateEntry(const std::string& key, Entry** entry); virtual bool DoomEntry(const std::string& key); virtual bool DoomAllEntries(); - virtual bool DoomEntriesBetween(const Time initial_time, - const Time end_time); - virtual bool DoomEntriesSince(const Time initial_time); + virtual bool DoomEntriesBetween(const base::Time initial_time, + const base::Time end_time); + virtual bool DoomEntriesSince(const base::Time initial_time); virtual bool OpenNextEntry(void** iter, Entry** next_entry); virtual void EndEnumeration(void** iter); virtual void GetStats(StatsItems* stats); diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc index 0cfcaf5..701de4b 100644 --- a/net/disk_cache/backend_unittest.cc +++ b/net/disk_cache/backend_unittest.cc @@ -13,6 +13,8 @@ #include "net/disk_cache/mapped_file.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; + namespace { // Copies a set of cache files from the data folder to the test folder. diff --git a/net/disk_cache/block_files.cc b/net/disk_cache/block_files.cc index e14f33d..87f2dc2 100644 --- a/net/disk_cache/block_files.cc +++ b/net/disk_cache/block_files.cc @@ -10,6 +10,8 @@ #include "base/time.h" #include "net/disk_cache/file_lock.h" +using base::Time; + namespace { const wchar_t* kBlockName = L"data_"; diff --git a/net/disk_cache/block_files_unittest.cc b/net/disk_cache/block_files_unittest.cc index 211ba96..8e72820 100644 --- a/net/disk_cache/block_files_unittest.cc +++ b/net/disk_cache/block_files_unittest.cc @@ -9,6 +9,8 @@ #include "net/disk_cache/disk_cache_test_util.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; + TEST_F(DiskCacheTest, BlockFiles_Grow) { std::wstring path = GetCachePath(); ASSERT_TRUE(DeleteCache(path.c_str())); diff --git a/net/disk_cache/disk_cache.h b/net/disk_cache/disk_cache.h index 361ecc2..ab01086 100644 --- a/net/disk_cache/disk_cache.h +++ b/net/disk_cache/disk_cache.h @@ -67,11 +67,11 @@ class Backend { // Marks a range of entries for deletion. This supports unbounded deletes in // either direction by using null Time values for either argument. - virtual bool DoomEntriesBetween(const Time initial_time, - const Time end_time) = 0; + virtual bool DoomEntriesBetween(const base::Time initial_time, + const base::Time end_time) = 0; // Marks all entries accessed since initial_time for deletion. - virtual bool DoomEntriesSince(const Time initial_time) = 0; + virtual bool DoomEntriesSince(const base::Time initial_time) = 0; // Enumerate the cache. Initialize iter to NULL before calling this method // the first time. That will cause the enumeration to start at the head of @@ -110,10 +110,10 @@ class Entry { virtual std::string GetKey() const = 0; // Returns the time when this cache entry was last used. - virtual Time GetLastUsed() const = 0; + virtual base::Time GetLastUsed() const = 0; // Returns the time when this cache entry was last modified. - virtual Time GetLastModified() const = 0; + virtual base::Time GetLastModified() const = 0; // Returns the size of the cache data with the given index. virtual int32 GetDataSize(int index) const = 0; diff --git a/net/disk_cache/disk_cache_perftest.cc b/net/disk_cache/disk_cache_perftest.cc index 03998df..c160677 100644 --- a/net/disk_cache/disk_cache_perftest.cc +++ b/net/disk_cache/disk_cache_perftest.cc @@ -22,6 +22,8 @@ #include "net/disk_cache/hash.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; + extern int g_cache_tests_max_id; extern volatile int g_cache_tests_received; extern volatile bool g_cache_tests_error; diff --git a/net/disk_cache/disk_cache_test_util.cc b/net/disk_cache/disk_cache_test_util.cc index d82cbb4..3db5c6f 100644 --- a/net/disk_cache/disk_cache_test_util.cc +++ b/net/disk_cache/disk_cache_test_util.cc @@ -10,6 +10,9 @@ #include "net/disk_cache/cache_util.h" #include "net/disk_cache/file.h" +using base::Time; +using base::TimeDelta; + std::string GenerateKey(bool same_length) { char key[200]; CacheTestFillBuffer(key, sizeof(key), same_length); diff --git a/net/disk_cache/entry_impl.cc b/net/disk_cache/entry_impl.cc index 935c9ff..844ff40 100644 --- a/net/disk_cache/entry_impl.cc +++ b/net/disk_cache/entry_impl.cc @@ -11,6 +11,9 @@ #include "net/disk_cache/backend_impl.h" #include "net/disk_cache/cache_util.h" +using base::Time; +using base::TimeDelta; + namespace { // This is a simple Task to execute the callback (from the message loop instead diff --git a/net/disk_cache/entry_impl.h b/net/disk_cache/entry_impl.h index 56ebfc4..64fa75b 100644 --- a/net/disk_cache/entry_impl.h +++ b/net/disk_cache/entry_impl.h @@ -24,8 +24,8 @@ class EntryImpl : public Entry, public base::RefCounted<EntryImpl> { virtual void Doom(); virtual void Close(); virtual std::string GetKey() const; - virtual Time GetLastUsed() const; - virtual Time GetLastModified() const; + virtual base::Time GetLastUsed() const; + virtual base::Time GetLastModified() const; virtual int32 GetDataSize(int index) const; virtual int ReadData(int index, int offset, char* buf, int buf_len, net::CompletionCallback* completion_callback); diff --git a/net/disk_cache/entry_unittest.cc b/net/disk_cache/entry_unittest.cc index 7e0ba8a..9793649 100644 --- a/net/disk_cache/entry_unittest.cc +++ b/net/disk_cache/entry_unittest.cc @@ -11,6 +11,8 @@ #include "net/disk_cache/entry_impl.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; + extern int g_cache_tests_max_id; extern volatile int g_cache_tests_received; extern volatile bool g_cache_tests_error; diff --git a/net/disk_cache/mem_backend_impl.cc b/net/disk_cache/mem_backend_impl.cc index 4180a9d..a0cf3cc 100644 --- a/net/disk_cache/mem_backend_impl.cc +++ b/net/disk_cache/mem_backend_impl.cc @@ -8,6 +8,8 @@ #include "net/disk_cache/cache_util.h" #include "net/disk_cache/mem_entry_impl.h" +using base::Time; + namespace { const int kDefaultCacheSize = 10 * 1024 * 1024; diff --git a/net/disk_cache/mem_backend_impl.h b/net/disk_cache/mem_backend_impl.h index 7573c90..2c23a67 100644 --- a/net/disk_cache/mem_backend_impl.h +++ b/net/disk_cache/mem_backend_impl.h @@ -32,8 +32,9 @@ class MemBackendImpl : public Backend { virtual bool CreateEntry(const std::string& key, Entry** entry); virtual bool DoomEntry(const std::string& key); virtual bool DoomAllEntries(); - virtual bool DoomEntriesBetween(const Time initial_time, const Time end_time); - virtual bool DoomEntriesSince(const Time initial_time); + virtual bool DoomEntriesBetween(const base::Time initial_time, + const base::Time end_time); + virtual bool DoomEntriesSince(const base::Time initial_time); virtual bool OpenNextEntry(void** iter, Entry** next_entry); virtual void EndEnumeration(void** iter); virtual void GetStats( diff --git a/net/disk_cache/mem_entry_impl.cc b/net/disk_cache/mem_entry_impl.cc index 66e4bcb..2bbf4a5 100644 --- a/net/disk_cache/mem_entry_impl.cc +++ b/net/disk_cache/mem_entry_impl.cc @@ -7,6 +7,8 @@ #include "net/base/net_errors.h" #include "net/disk_cache/mem_backend_impl.h" +using base::Time; + namespace disk_cache { MemEntryImpl::MemEntryImpl(MemBackendImpl* backend) { diff --git a/net/disk_cache/mem_entry_impl.h b/net/disk_cache/mem_entry_impl.h index 17227bf..98c3e4a 100644 --- a/net/disk_cache/mem_entry_impl.h +++ b/net/disk_cache/mem_entry_impl.h @@ -21,8 +21,8 @@ class MemEntryImpl : public Entry { virtual void Doom(); virtual void Close(); virtual std::string GetKey() const; - virtual Time GetLastUsed() const; - virtual Time GetLastModified() const; + virtual base::Time GetLastUsed() const; + virtual base::Time GetLastModified() const; virtual int32 GetDataSize(int index) const; virtual int ReadData(int index, int offset, char* buf, int buf_len, net::CompletionCallback* completion_callback); @@ -72,8 +72,8 @@ class MemEntryImpl : public Entry { MemEntryImpl* next_; // Pointers for the LRU list. MemEntryImpl* prev_; - Time last_modified_; // LRU information. - Time last_used_; + base::Time last_modified_; // LRU information. + base::Time last_used_; MemBackendImpl* backend_; // Back pointer to the cache. bool doomed_; // True if this entry was removed from the cache. diff --git a/net/disk_cache/rankings.cc b/net/disk_cache/rankings.cc index ad5eef9..82e5c7b 100644 --- a/net/disk_cache/rankings.cc +++ b/net/disk_cache/rankings.cc @@ -9,6 +9,8 @@ #include "net/disk_cache/entry_impl.h" #include "net/disk_cache/errors.h" +using base::Time; + // This is used by crash_cache.exe to generate unit test files. disk_cache::RankCrashes g_rankings_crash = disk_cache::NO_CRASH; @@ -676,4 +678,3 @@ void Rankings::UpdateIterators(CacheRankingsBlock* node) { } } // namespace disk_cache - diff --git a/net/disk_cache/stress_cache.cc b/net/disk_cache/stress_cache.cc index 864309a..dde20ff 100644 --- a/net/disk_cache/stress_cache.cc +++ b/net/disk_cache/stress_cache.cc @@ -22,6 +22,8 @@ #include "net/disk_cache/disk_cache.h" #include "net/disk_cache/disk_cache_test_util.h" +using base::Time; + const int kError = -1; const int kExpectedCrash = 1000000; |