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 | |
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
291 files changed, 831 insertions, 393 deletions
diff --git a/base/condition_variable.h b/base/condition_variable.h index 9307d8c..bceef5e 100644 --- a/base/condition_variable.h +++ b/base/condition_variable.h @@ -80,7 +80,7 @@ class ConditionVariable { // Wait() releases the caller's critical section atomically as it starts to // sleep, and the reacquires it when it is signaled. void Wait(); - void TimedWait(const TimeDelta& max_time); + void TimedWait(const base::TimeDelta& max_time); // Broadcast() revives all waiting threads. void Broadcast(); diff --git a/base/condition_variable_posix.cc b/base/condition_variable_posix.cc index c6f5f07..7a7f5dd 100644 --- a/base/condition_variable_posix.cc +++ b/base/condition_variable_posix.cc @@ -11,6 +11,9 @@ #include "base/lock_impl.h" #include "base/logging.h" +using base::Time; +using base::TimeDelta; + ConditionVariable::ConditionVariable(Lock* user_lock) : user_mutex_(user_lock->lock_impl()->os_lock()) { int rv = pthread_cond_init(&condition_, NULL); diff --git a/base/condition_variable_unittest.cc b/base/condition_variable_unittest.cc index 219944e..ee5d1c5 100644 --- a/base/condition_variable_unittest.cc +++ b/base/condition_variable_unittest.cc @@ -16,6 +16,9 @@ #include "base/spin_wait.h" #include "testing/gtest/include/gtest/gtest.h" +using base::TimeDelta; +using base::TimeTicks; + namespace { //------------------------------------------------------------------------------ // Define our test class, with several common variables. diff --git a/base/condition_variable_win.cc b/base/condition_variable_win.cc index ba4baf7..5284133 100644 --- a/base/condition_variable_win.cc +++ b/base/condition_variable_win.cc @@ -9,6 +9,8 @@ #include "base/lock.h" #include "base/logging.h" +using base::TimeDelta; + ConditionVariable::ConditionVariable(Lock* user_lock) : user_lock_(*user_lock), run_state_(RUNNING), diff --git a/base/field_trial.cc b/base/field_trial.cc index 103e539..9fd9d8f 100644 --- a/base/field_trial.cc +++ b/base/field_trial.cc @@ -7,6 +7,8 @@ #include "base/logging.h" #include "base/rand_util.h" +using base::Time; + //------------------------------------------------------------------------------ // FieldTrialList methods and members. diff --git a/base/field_trial.h b/base/field_trial.h index a812d4d..99e213c 100644 --- a/base/field_trial.h +++ b/base/field_trial.h @@ -70,11 +70,11 @@ class FieldTrialList : NonThreadSafe { // of the application. In some experiments it may be useful to discount // data that is gathered before the application has reach sufficient // stability (example: most DLL have loaded, etc.) - static Time application_start_time() { + static base::Time application_start_time() { if (global_) return global_->application_start_time_; // For testing purposes only, or when we don't yet have a start time. - return Time::Now(); + return base::Time::Now(); } private: @@ -86,7 +86,7 @@ class FieldTrialList : NonThreadSafe { static FieldTrialList* global_; // The singleton of this class. static int constructor_count_; // Prevent having more than one. - Time application_start_time_; + base::Time application_start_time_; RegistrationList registered_; DISALLOW_COPY_AND_ASSIGN(FieldTrialList); diff --git a/base/histogram.cc b/base/histogram.cc index 19dcf83..384716d 100644 --- a/base/histogram.cc +++ b/base/histogram.cc @@ -16,6 +16,8 @@ #include "base/scoped_ptr.h" #include "base/string_util.h" +using base::TimeDelta; + typedef Histogram::Count Count; // static diff --git a/base/histogram.h b/base/histogram.h index a7c1b92..af5f1fd 100644 --- a/base/histogram.h +++ b/base/histogram.h @@ -44,8 +44,8 @@ // These macros all use 50 buckets. #define HISTOGRAM_TIMES(name, sample) do { \ - static Histogram counter((name), TimeDelta::FromMilliseconds(1), \ - TimeDelta::FromSeconds(10), 50); \ + static Histogram counter((name), base::TimeDelta::FromMilliseconds(1), \ + base::TimeDelta::FromSeconds(10), 50); \ counter.AddTime(sample); \ } while (0) @@ -103,16 +103,16 @@ static const int kUmaTargetedHistogramFlag = 0x1; #define UMA_HISTOGRAM_TIMES(name, sample) do { \ - static Histogram counter((name), TimeDelta::FromMilliseconds(1), \ - TimeDelta::FromSeconds(10), 50); \ + static Histogram counter((name), base::TimeDelta::FromMilliseconds(1), \ + base::TimeDelta::FromSeconds(10), 50); \ counter.SetFlags(kUmaTargetedHistogramFlag); \ counter.AddTime(sample); \ } while (0) // Use this macro when times can routinely be much longer than 10 seconds. #define UMA_HISTOGRAM_LONG_TIMES(name, sample) do { \ - static Histogram counter((name), TimeDelta::FromMilliseconds(1), \ - TimeDelta::FromHours(1), 50); \ + static Histogram counter((name), base::TimeDelta::FromMilliseconds(1), \ + base::TimeDelta::FromHours(1), 50); \ counter.SetFlags(kUmaTargetedHistogramFlag); \ counter.AddTime(sample); \ } while (0) @@ -191,8 +191,8 @@ class Histogram : public StatsRate { Histogram(const wchar_t* name, Sample minimum, Sample maximum, size_t bucket_count); - Histogram(const wchar_t* name, TimeDelta minimum, - TimeDelta maximum, size_t bucket_count); + Histogram(const wchar_t* name, base::TimeDelta minimum, + base::TimeDelta maximum, size_t bucket_count); virtual ~Histogram(); // Hooks to override stats counter methods. This ensures that we gather all @@ -330,8 +330,8 @@ class LinearHistogram : public Histogram { }; LinearHistogram(const wchar_t* name, Sample minimum, Sample maximum, size_t bucket_count); - LinearHistogram(const wchar_t* name, TimeDelta minimum, - TimeDelta maximum, size_t bucket_count); + LinearHistogram(const wchar_t* name, base::TimeDelta minimum, + base::TimeDelta maximum, size_t bucket_count); ~LinearHistogram() {} // Store a list of number/text values for use in rendering the histogram. diff --git a/base/histogram_unittest.cc b/base/histogram_unittest.cc index 092d0543..7085f97 100644 --- a/base/histogram_unittest.cc +++ b/base/histogram_unittest.cc @@ -10,6 +10,8 @@ #include "base/time.h" #include "testing/gtest/include/gtest/gtest.h" +using base::TimeDelta; + namespace { class HistogramTest : public testing::Test { diff --git a/base/idletimer_unittest.cc b/base/idletimer_unittest.cc index fe723b6..dda7468 100644 --- a/base/idletimer_unittest.cc +++ b/base/idletimer_unittest.cc @@ -6,6 +6,8 @@ #include "base/message_loop.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; +using base::TimeDelta; using base::IdleTimer; namespace { diff --git a/base/message_loop.cc b/base/message_loop.cc index cc87fe6..73cb7da 100644 --- a/base/message_loop.cc +++ b/base/message_loop.cc @@ -23,6 +23,9 @@ #include "base/message_pump_glib.h" #endif +using base::Time; +using base::TimeDelta; + // A lazily created thread local storage for quick access to a thread's message // loop, if one exists. This should be safe and free of static constructors. static base::LazyInstance<base::ThreadLocalPointer<MessageLoop> > lazy_tls_ptr( diff --git a/base/message_loop.h b/base/message_loop.h index 4ca6fae..2d38853 100644 --- a/base/message_loop.h +++ b/base/message_loop.h @@ -256,10 +256,10 @@ class MessageLoop : public base::MessagePump::Delegate { // This structure is copied around by value. struct PendingTask { - Task* task; // The task to run. - Time delayed_run_time; // The time when the task should be run. - int sequence_num; // Used to facilitate sorting by run time. - bool nestable; // True if OK to dispatch from a nested loop. + Task* task; // The task to run. + base::Time delayed_run_time; // The time when the task should be run. + int sequence_num; // Used to facilitate sorting by run time. + bool nestable; // True if OK to dispatch from a nested loop. PendingTask(Task* task, bool nestable) : task(task), sequence_num(0), nestable(nestable) { @@ -334,7 +334,7 @@ class MessageLoop : public base::MessagePump::Delegate { // base::MessagePump::Delegate methods: virtual bool DoWork(); - virtual bool DoDelayedWork(Time* next_delayed_work_time); + virtual bool DoDelayedWork(base::Time* next_delayed_work_time); virtual bool DoIdleWork(); // Start recording histogram info about events and action IF it was enabled diff --git a/base/message_loop_unittest.cc b/base/message_loop_unittest.cc index b742d76..83be2b1 100644 --- a/base/message_loop_unittest.cc +++ b/base/message_loop_unittest.cc @@ -15,6 +15,8 @@ #endif using base::Thread; +using base::Time; +using base::TimeDelta; // TODO(darin): Platform-specific MessageLoop tests should be grouped together // to avoid chopping this file up with so many #ifdefs. diff --git a/base/message_pump.h b/base/message_pump.h index da4d214..1a7770e 100644 --- a/base/message_pump.h +++ b/base/message_pump.h @@ -7,10 +7,10 @@ #include "base/ref_counted.h" -class Time; - namespace base { +class Time; + class MessagePump : public RefCountedThreadSafe<MessagePump> { public: // Please see the comments above the Run method for an illustration of how @@ -120,4 +120,3 @@ class MessagePump : public RefCountedThreadSafe<MessagePump> { } // namespace base #endif // BASE_MESSAGE_PUMP_H_ - diff --git a/base/message_pump_default.cc b/base/message_pump_default.cc index d1ecd12..d69fc03 100644 --- a/base/message_pump_default.cc +++ b/base/message_pump_default.cc @@ -75,4 +75,3 @@ void MessagePumpDefault::ScheduleDelayedWork(const Time& delayed_work_time) { } } // namespace base - diff --git a/base/message_pump_default.h b/base/message_pump_default.h index f565518..aa0dab9 100644 --- a/base/message_pump_default.h +++ b/base/message_pump_default.h @@ -38,4 +38,3 @@ class MessagePumpDefault : public MessagePump { } // namespace base #endif // BASE_MESSAGE_PUMP_DEFAULT_H_ - diff --git a/base/message_pump_libevent.cc b/base/message_pump_libevent.cc index 12cb6d1..0dd533e 100644 --- a/base/message_pump_libevent.cc +++ b/base/message_pump_libevent.cc @@ -179,4 +179,3 @@ void MessagePumpLibevent::ScheduleDelayedWork(const Time& delayed_work_time) { } } // namespace base - diff --git a/base/message_pump_libevent.h b/base/message_pump_libevent.h index 7534e50..9934f31 100644 --- a/base/message_pump_libevent.h +++ b/base/message_pump_libevent.h @@ -86,4 +86,3 @@ class MessagePumpLibevent : public MessagePump { } // namespace base #endif // BASE_MESSAGE_PUMP_LIBEVENT_H_ - diff --git a/base/message_pump_win.cc b/base/message_pump_win.cc index 4eb0995..542fcf1 100644 --- a/base/message_pump_win.cc +++ b/base/message_pump_win.cc @@ -9,6 +9,8 @@ #include "base/histogram.h" #include "base/win_util.h" +using base::Time; + namespace { class HandlerData : public base::MessagePumpForIO::Watcher { diff --git a/base/message_pump_win.h b/base/message_pump_win.h index 50a5223..eb4253f 100644 --- a/base/message_pump_win.h +++ b/base/message_pump_win.h @@ -249,4 +249,3 @@ class MessagePumpForIO : public MessagePumpWin { } // namespace base #endif // BASE_MESSAGE_PUMP_WIN_H_ - diff --git a/base/observer_list_unittest.cc b/base/observer_list_unittest.cc index 529e8a9..8f69256 100644 --- a/base/observer_list_unittest.cc +++ b/base/observer_list_unittest.cc @@ -9,6 +9,8 @@ #include "base/ref_counted.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; + namespace { class ObserverListTest : public testing::Test { diff --git a/base/perftimer.h b/base/perftimer.h index 86314e9..9558697 100644 --- a/base/perftimer.h +++ b/base/perftimer.h @@ -31,16 +31,16 @@ void LogPerfResult(const char* test_name, double value, const char* units); class PerfTimer { public: PerfTimer() { - begin_ = TimeTicks::Now(); + begin_ = base::TimeTicks::Now(); } // Returns the time elapsed since object construction - TimeDelta Elapsed() const { - return TimeTicks::Now() - begin_; + base::TimeDelta Elapsed() const { + return base::TimeTicks::Now() - begin_; } private: - TimeTicks begin_; + base::TimeTicks begin_; }; // ---------------------------------------------------------------------- diff --git a/base/pr_time_unittest.cc b/base/pr_time_unittest.cc index 38c3140..3b096a2 100644 --- a/base/pr_time_unittest.cc +++ b/base/pr_time_unittest.cc @@ -9,6 +9,8 @@ #include "base/time.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; + namespace { // time_t representation of 15th Oct 2007 12:45:00 PDT diff --git a/base/spin_wait.h b/base/spin_wait.h index 86818af..36ae083 100644 --- a/base/spin_wait.h +++ b/base/spin_wait.h @@ -31,14 +31,15 @@ // that the test passes, even if load varies, and external events vary. #define SPIN_FOR_1_SECOND_OR_UNTIL_TRUE(expression) \ - SPIN_FOR_TIMEDELTA_OR_UNTIL_TRUE(TimeDelta::FromSeconds(1), (expression)) + SPIN_FOR_TIMEDELTA_OR_UNTIL_TRUE(base::TimeDelta::FromSeconds(1), \ + (expression)) #define SPIN_FOR_TIMEDELTA_OR_UNTIL_TRUE(delta, expression) do { \ - Time start = Time::Now(); \ - const TimeDelta kTimeout = delta; \ + base::Time start = base::Time::Now(); \ + const base::TimeDelta kTimeout = delta; \ while(!(expression)) { \ - if (kTimeout < Time::Now() - start) { \ - EXPECT_LE((Time::Now() - start).InMilliseconds(), \ + if (kTimeout < base::Time::Now() - start) { \ + EXPECT_LE((base::Time::Now() - start).InMilliseconds(), \ kTimeout.InMilliseconds()) << "Timed out"; \ break; \ } \ @@ -48,4 +49,3 @@ while(0) #endif // BASE_SPIN_WAIT_H__ - diff --git a/base/stats_counters.h b/base/stats_counters.h index eaff1b4..5dc7b89c 100644 --- a/base/stats_counters.h +++ b/base/stats_counters.h @@ -187,15 +187,15 @@ class StatsCounterTimer : protected StatsCounter { void Start() { if (!Enabled()) return; - start_time_ = TimeTicks::Now(); - stop_time_ = TimeTicks(); + start_time_ = base::TimeTicks::Now(); + stop_time_ = base::TimeTicks(); } // Stop the timer and record the results. void Stop() { if (!Enabled() || !Running()) return; - stop_time_ = TimeTicks::Now(); + stop_time_ = base::TimeTicks::Now(); Record(); } @@ -205,12 +205,12 @@ class StatsCounterTimer : protected StatsCounter { } // Accept a TimeDelta to increment. - virtual void AddTime(TimeDelta time) { + virtual void AddTime(base::TimeDelta time) { Add(static_cast<int>(time.InMilliseconds())); } // TODO(jar) temporary hack include method till base and chrome use new name. - void IncrementTimer(TimeDelta time) { + void IncrementTimer(base::TimeDelta time) { AddTime(time); } @@ -220,8 +220,8 @@ class StatsCounterTimer : protected StatsCounter { AddTime(stop_time_ - start_time_); } - TimeTicks start_time_; - TimeTicks stop_time_; + base::TimeTicks start_time_; + base::TimeTicks stop_time_; }; // A StatsRate is a timer that keeps a count of the number of intervals added so diff --git a/base/stats_table_unittest.cc b/base/stats_table_unittest.cc index 7d5f015..c6e53e9 100644 --- a/base/stats_table_unittest.cc +++ b/base/stats_table_unittest.cc @@ -14,6 +14,8 @@ #include <windows.h> #endif +using base::TimeTicks; + namespace { class StatsTableTest : public MultiProcessTest { }; diff --git a/base/time.cc b/base/time.cc index 38f732c..83b5c09 100644 --- a/base/time.cc +++ b/base/time.cc @@ -8,6 +8,8 @@ #include "base/logging.h" +namespace base { + // TimeDelta ------------------------------------------------------------------ // static @@ -120,3 +122,4 @@ bool Time::FromString(const wchar_t* time_string, Time* parsed_time) { return true; } +} // namespace base diff --git a/base/time.h b/base/time.h index 4141116..cb0eeb8 100644 --- a/base/time.h +++ b/base/time.h @@ -33,6 +33,8 @@ #include <windows.h> #endif +namespace base { + class Time; class TimeTicks; @@ -438,4 +440,6 @@ inline TimeTicks TimeDelta::operator+(TimeTicks t) const { return TimeTicks(t.ticks_ + delta_); } +} // namespace base + #endif // BASE_TIME_H_ diff --git a/base/time_format.cc b/base/time_format.cc index 230c24e..0cd4eba 100644 --- a/base/time_format.cc +++ b/base/time_format.cc @@ -9,6 +9,8 @@ #include "base/time.h" #include "unicode/datefmt.h" +using base::Time; + namespace { std::wstring TimeFormat(const DateFormat* formatter, diff --git a/base/time_format.h b/base/time_format.h index af44897..b51c768 100644 --- a/base/time_format.h +++ b/base/time_format.h @@ -10,10 +10,10 @@ #include <string> -class Time; - namespace base { +class Time; + // Returns the time of day, e.g., "3:07 PM". std::wstring TimeFormatTimeOfDay(const Time& time); @@ -38,4 +38,3 @@ std::wstring TimeFormatFriendlyDate(const Time& time); } // namespace base #endif // BASE_TIME_FORMAT_H_ - diff --git a/base/time_posix.cc b/base/time_posix.cc index 18dc240..901b65c 100644 --- a/base/time_posix.cc +++ b/base/time_posix.cc @@ -13,6 +13,8 @@ #include "base/basictypes.h" #include "base/logging.h" +namespace base { + // The Time routines in this file use standard POSIX routines, or almost- // standard routines in the case of timegm. We need to use a Mach-specific // function for TimeTicks::Now() on Mac OS X. @@ -140,3 +142,5 @@ TimeTicks TimeTicks::Now() { TimeTicks TimeTicks::HighResNow() { return Now(); } + +} // namespace base diff --git a/base/time_unittest.cc b/base/time_unittest.cc index db0990f4..ebe69eb 100644 --- a/base/time_unittest.cc +++ b/base/time_unittest.cc @@ -9,6 +9,10 @@ #include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; +using base::TimeDelta; +using base::TimeTicks; + // Test conversions to/from time_t and exploding/unexploding. TEST(Time, TimeT) { // C library time and exploded time. diff --git a/base/time_unittest_win.cc b/base/time_unittest_win.cc index 1c3ea08..d0f606d4 100644 --- a/base/time_unittest_win.cc +++ b/base/time_unittest_win.cc @@ -9,6 +9,10 @@ #include "base/time.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; +using base::TimeDelta; +using base::TimeTicks; + namespace { class MockTimeTicks : public TimeTicks { diff --git a/base/time_win.cc b/base/time_win.cc index e7d7ae8..bc9d0c7 100644 --- a/base/time_win.cc +++ b/base/time_win.cc @@ -47,6 +47,10 @@ #include "base/singleton.h" #include "base/system_monitor.h" +using base::Time; +using base::TimeDelta; +using base::TimeTicks; + namespace { // From MSDN, FILETIME "Contains a 64-bit value representing the number of diff --git a/base/timer_unittest.cc b/base/timer_unittest.cc index a9d13e2..face9c8 100644 --- a/base/timer_unittest.cc +++ b/base/timer_unittest.cc @@ -7,6 +7,8 @@ #include "base/timer.h" #include "testing/gtest/include/gtest/gtest.h" +using base::TimeDelta; + namespace { class OneShotTimerTester { diff --git a/base/trace_event.cc b/base/trace_event.cc index 972f17c..fa47184 100644 --- a/base/trace_event.cc +++ b/base/trace_event.cc @@ -150,4 +150,3 @@ void TraceLog::Log(const std::string& msg) { } } // namespace base - diff --git a/base/tracked.cc b/base/tracked.cc index b47a4e4..5e519b1 100644 --- a/base/tracked.cc +++ b/base/tracked.cc @@ -7,6 +7,8 @@ #include "base/string_util.h" #include "base/tracked_objects.h" +using base::Time; + namespace tracked_objects { //------------------------------------------------------------------------------ diff --git a/base/tracked.h b/base/tracked.h index f976175..002b858 100644 --- a/base/tracked.h +++ b/base/tracked.h @@ -116,7 +116,7 @@ class Tracked { // The time this object was constructed. If its life consisted of a long // waiting period, and then it became active, then this value is generally // reset before the object begins it active life. - Time tracked_birth_time_; + base::Time tracked_birth_time_; #endif // TRACK_ALL_TASK_OBJECTS diff --git a/base/tracked_objects.cc b/base/tracked_objects.cc index c9e8eb0..4102075 100644 --- a/base/tracked_objects.cc +++ b/base/tracked_objects.cc @@ -8,6 +8,8 @@ #include "base/string_util.h" +using base::TimeDelta; + namespace tracked_objects { // A TLS slot to the TrackRegistry for the current thread. diff --git a/base/tracked_objects.h b/base/tracked_objects.h index 2e6f046..638ea24 100644 --- a/base/tracked_objects.h +++ b/base/tracked_objects.h @@ -80,11 +80,11 @@ class DeathData { // a corrosponding death. explicit DeathData(int count) : count_(count), square_duration_(0) {} - void RecordDeath(const TimeDelta& duration); + void RecordDeath(const base::TimeDelta& duration); // Metrics accessors. int count() const { return count_; } - TimeDelta life_duration() const { return life_duration_; } + base::TimeDelta life_duration() const { return life_duration_; } int64 square_duration() const { return square_duration_; } int AverageMsDuration() const; double StandardDeviation() const; @@ -99,7 +99,7 @@ class DeathData { private: int count_; // Number of destructions. - TimeDelta life_duration_; // Sum of all lifetime durations. + base::TimeDelta life_duration_; // Sum of all lifetime durations. int64 square_duration_; // Sum of squares in milliseconds. }; @@ -128,7 +128,7 @@ class Snapshot { const std::string DeathThreadName() const; int count() const { return death_data_.count(); } - TimeDelta life_duration() const { return death_data_.life_duration(); } + base::TimeDelta life_duration() const { return death_data_.life_duration(); } int64 square_duration() const { return death_data_.square_duration(); } int AverageMsDuration() const { return death_data_.AverageMsDuration(); } @@ -339,7 +339,7 @@ class ThreadData { Births* FindLifetime(const Location& location); // Find a place to record a death on this thread. - void TallyADeath(const Births& lifetimes, const TimeDelta& duration); + void TallyADeath(const Births& lifetimes, const base::TimeDelta& duration); // (Thread safe) Get start of list of instances. static ThreadData* first(); diff --git a/base/waitable_event.h b/base/waitable_event.h index 3aa42d4..b723653 100644 --- a/base/waitable_event.h +++ b/base/waitable_event.h @@ -14,10 +14,10 @@ typedef void* HANDLE; #include "base/lock.h" #endif -class TimeDelta; - namespace base { +class TimeDelta; + // A WaitableEvent can be a useful thread synchronization tool when you want to // allow one thread to wait for another thread to finish some work. // @@ -80,4 +80,3 @@ class WaitableEvent { } // namespace base #endif // BASE_WAITABLE_EVENT_H_ - diff --git a/base/waitable_event_generic.cc b/base/waitable_event_generic.cc index 6afbf18..61eeeb8 100644 --- a/base/waitable_event_generic.cc +++ b/base/waitable_event_generic.cc @@ -69,4 +69,3 @@ bool WaitableEvent::TimedWait(const TimeDelta& max_time) { } } // namespace base - diff --git a/base/waitable_event_unittest.cc b/base/waitable_event_unittest.cc index 9dc9335..e7bab49 100644 --- a/base/waitable_event_unittest.cc +++ b/base/waitable_event_unittest.cc @@ -6,6 +6,7 @@ #include "base/waitable_event.h" #include "testing/gtest/include/gtest/gtest.h" +using base::TimeDelta; using base::WaitableEvent; namespace { diff --git a/base/waitable_event_win.cc b/base/waitable_event_win.cc index 8c1efe6..257f145 100644 --- a/base/waitable_event_win.cc +++ b/base/waitable_event_win.cc @@ -63,4 +63,3 @@ bool WaitableEvent::TimedWait(const TimeDelta& max_time) { } } // namespace base - diff --git a/base/watchdog.cc b/base/watchdog.cc index 06ab871..b1db70b 100644 --- a/base/watchdog.cc +++ b/base/watchdog.cc @@ -7,6 +7,9 @@ #include "base/platform_thread.h" #include "base/string_util.h" +using base::TimeDelta; +using base::TimeTicks; + //------------------------------------------------------------------------------ // Public API methods. @@ -145,4 +148,3 @@ Lock Watchdog::static_lock_; // Lock for access of static data... TimeTicks Watchdog::last_debugged_alarm_time_ = TimeTicks(); // static TimeDelta Watchdog::last_debugged_alarm_delay_; - diff --git a/base/watchdog.h b/base/watchdog.h index 0b77749..c7e967f 100644 --- a/base/watchdog.h +++ b/base/watchdog.h @@ -28,15 +28,15 @@ class Watchdog { public: // TODO(JAR)change default arg to required arg after all users have migrated. // Constructor specifies how long the Watchdog will wait before alarming. - Watchdog(const TimeDelta& duration, + Watchdog(const base::TimeDelta& duration, const std::wstring& thread_watched_name, bool enabled = true); virtual ~Watchdog(); // Start timing, and alarm when time expires (unless we're disarm()ed.) void Arm(); // Arm starting now. - void ArmSomeTimeDeltaAgo(const TimeDelta& time_delta); - void ArmAtStartTime(const TimeTicks start_time); + void ArmSomeTimeDeltaAgo(const base::TimeDelta& time_delta); + void ArmAtStartTime(const base::TimeTicks start_time); // Reset time, and do not set off the alarm. void Disarm(); @@ -60,12 +60,12 @@ class Watchdog { Lock lock_; // Mutex for state_. ConditionVariable condition_variable_; State state_; - const TimeDelta duration_; // How long after start_time_ do we alarm? + const base::TimeDelta duration_; // How long after start_time_ do we alarm? const std::wstring thread_watched_name_; HANDLE handle_; // Handle for watchdog thread. DWORD thread_id_; // Also for watchdog thread. - TimeTicks start_time_; // Start of epoch, and alarm after duration_. + base::TimeTicks start_time_; // Start of epoch, and alarm after duration_. // When the debugger breaks (when we alarm), all the other alarms that are // armed will expire (also alarm). To diminish this effect, we track any @@ -75,9 +75,9 @@ class Watchdog { // on alarms from callers that specify old times. static Lock static_lock_; // Lock for access of static data... // When did we last alarm and get stuck (for a while) in a debugger? - static TimeTicks last_debugged_alarm_time_; + static base::TimeTicks last_debugged_alarm_time_; // How long did we sit on a break in the debugger? - static TimeDelta last_debugged_alarm_delay_; + static base::TimeDelta last_debugged_alarm_delay_; DISALLOW_EVIL_CONSTRUCTORS(Watchdog); diff --git a/base/watchdog_unittest.cc b/base/watchdog_unittest.cc index c74b941..c4a664f 100644 --- a/base/watchdog_unittest.cc +++ b/base/watchdog_unittest.cc @@ -10,6 +10,8 @@ #include "base/time.h" #include "testing/gtest/include/gtest/gtest.h" +using base::TimeDelta; + namespace { //------------------------------------------------------------------------------ diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc index 9001b11..603b0a9 100644 --- a/chrome/browser/autocomplete/autocomplete.cc +++ b/chrome/browser/autocomplete/autocomplete.cc @@ -26,6 +26,7 @@ #include "generated_resources.h" +using base::TimeDelta; // AutocompleteInput ---------------------------------------------------------- diff --git a/chrome/browser/autocomplete/history_contents_provider.cc b/chrome/browser/autocomplete/history_contents_provider.cc index c1ef435c..9c50bd3 100644 --- a/chrome/browser/autocomplete/history_contents_provider.cc +++ b/chrome/browser/autocomplete/history_contents_provider.cc @@ -10,6 +10,8 @@ #include "chrome/browser/profile.h" #include "net/base/net_util.h" +using base::TimeTicks; + namespace { // Number of days to search for full text results. The longer this is, the more diff --git a/chrome/browser/autocomplete/history_contents_provider_unittest.cc b/chrome/browser/autocomplete/history_contents_provider_unittest.cc index 9777c71..0ab3d76 100644 --- a/chrome/browser/autocomplete/history_contents_provider_unittest.cc +++ b/chrome/browser/autocomplete/history_contents_provider_unittest.cc @@ -11,6 +11,9 @@ #include "chrome/test/testing_profile.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; +using base::TimeDelta; + namespace { struct TestEntry { diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc index 9a25e90..cdbc82d 100644 --- a/chrome/browser/autocomplete/history_url_provider.cc +++ b/chrome/browser/autocomplete/history_url_provider.cc @@ -23,6 +23,10 @@ #include "googleurl/src/url_util.h" #include "net/base/net_util.h" +using base::Time; +using base::TimeDelta; +using base::TimeTicks; + HistoryURLProviderParams::HistoryURLProviderParams( const AutocompleteInput& input, bool trim_http, diff --git a/chrome/browser/autocomplete/history_url_provider_unittest.cc b/chrome/browser/autocomplete/history_url_provider_unittest.cc index 0f5fc5d..610191f 100644 --- a/chrome/browser/autocomplete/history_url_provider_unittest.cc +++ b/chrome/browser/autocomplete/history_url_provider_unittest.cc @@ -11,6 +11,9 @@ #include "chrome/test/testing_profile.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; +using base::TimeDelta; + struct TestURLInfo { std::wstring url; std::wstring title; diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc index c631ec2..b7b260e 100644 --- a/chrome/browser/autocomplete/search_provider.cc +++ b/chrome/browser/autocomplete/search_provider.cc @@ -19,6 +19,9 @@ #include "generated_resources.h" +using base::Time; +using base::TimeDelta; + const int SearchProvider::kQueryDelayMs = 200; void SearchProvider::Start(const AutocompleteInput& input, diff --git a/chrome/browser/autocomplete/search_provider.h b/chrome/browser/autocomplete/search_provider.h index 9e7fde1..e6030dc 100644 --- a/chrome/browser/autocomplete/search_provider.h +++ b/chrome/browser/autocomplete/search_provider.h @@ -116,7 +116,7 @@ class SearchProvider : public AutocompleteProvider, // algorithms for the different types of matches. int CalculateRelevanceForWhatYouTyped() const; // |time| is the time at which this query was last seen. - int CalculateRelevanceForHistory(const Time& time) const; + int CalculateRelevanceForHistory(const base::Time& time) const; // |suggestion_value| is which suggestion this is in the list returned from // the server; the best suggestion is suggestion number 0. int CalculateRelevanceForSuggestion(size_t suggestion_value) const; diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index f3d21a7..d567a53 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -34,6 +34,8 @@ #include "net/base/cookie_monster.h" #include "net/url_request/url_request_filter.h" +using base::Time; + class InitialLoadObserver : public NotificationObserver { public: InitialLoadObserver(size_t tab_count, AutomationProvider* automation) diff --git a/chrome/browser/automation/automation_tab_tracker.h b/chrome/browser/automation/automation_tab_tracker.h index bb9ac24..9e0c63c 100644 --- a/chrome/browser/automation/automation_tab_tracker.h +++ b/chrome/browser/automation/automation_tab_tracker.h @@ -52,11 +52,11 @@ public: switch (type) { case NOTIFY_NAV_ENTRY_COMMITTED: last_navigation_times_[Source<NavigationController>(source).ptr()] = - Time::Now(); + base::Time::Now(); return; case NOTIFY_EXTERNAL_TAB_CLOSED: case NOTIFY_TAB_CLOSING: - std::map<NavigationController*, Time>::iterator iter = + std::map<NavigationController*, base::Time>::iterator iter = last_navigation_times_.find( Source<NavigationController>(source).ptr()); if (iter != last_navigation_times_.end()) @@ -66,22 +66,22 @@ public: AutomationResourceTracker::Observe(type, source, details); } - Time GetLastNavigationTime(int handle) { + base::Time GetLastNavigationTime(int handle) { if (ContainsHandle(handle)) { NavigationController* controller = GetResource(handle); if (controller) { - std::map<NavigationController*, Time>::const_iterator iter = + std::map<NavigationController*, base::Time>::const_iterator iter = last_navigation_times_.find(controller); if (iter != last_navigation_times_.end()) return iter->second; } } - return Time(); + return base::Time(); } private: // Last time a navigation occurred. - std::map<NavigationController*, Time> last_navigation_times_; + std::map<NavigationController*, base::Time> last_navigation_times_; DISALLOW_COPY_AND_ASSIGN(AutomationTabTracker); }; diff --git a/chrome/browser/base_history_model.h b/chrome/browser/base_history_model.h index 51a0aca..21f3dd3 100644 --- a/chrome/browser/base_history_model.h +++ b/chrome/browser/base_history_model.h @@ -49,7 +49,7 @@ class BaseHistoryModel { virtual int GetItemCount() = 0; // Returns the time of the visit with the given index. - virtual Time GetVisitTime(int index) = 0; + virtual base::Time GetVisitTime(int index) = 0; // Returns the title at the specified index. virtual const std::wstring& GetTitle(int index) = 0; diff --git a/chrome/browser/bookmarks/bookmark_codec.cc b/chrome/browser/bookmarks/bookmark_codec.cc index d37f830..1bea43e 100644 --- a/chrome/browser/bookmarks/bookmark_codec.cc +++ b/chrome/browser/bookmarks/bookmark_codec.cc @@ -12,6 +12,8 @@ #include "generated_resources.h" +using base::Time; + // Key names. static const wchar_t* kRootsKey = L"roots"; static const wchar_t* kRootFolderNameKey = L"bookmark_bar"; @@ -193,4 +195,3 @@ bool BookmarkCodec::DecodeNode(BookmarkModel* model, Time::FromInternalValue(StringToInt64(date_added_string)); return true; } - diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc index 14430a3..ceb1ca9 100644 --- a/chrome/browser/bookmarks/bookmark_model.cc +++ b/chrome/browser/bookmarks/bookmark_model.cc @@ -13,6 +13,8 @@ #include "generated_resources.h" +using base::Time; + namespace { // Functions used for sorting. diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h index 2f3f32d..1262a9e 100644 --- a/chrome/browser/bookmarks/bookmark_model.h +++ b/chrome/browser/bookmarks/bookmark_model.h @@ -69,11 +69,11 @@ class BookmarkNode : public views::TreeNode<BookmarkNode> { } // Returns the time the bookmark/group was added. - Time date_added() const { return date_added_; } + base::Time date_added() const { return date_added_; } // Returns the last time the group was modified. This is only maintained // for folders (including the bookmark and other folder). - Time date_group_modified() const { return date_group_modified_; } + base::Time date_group_modified() const { return date_group_modified_; } // Convenience for testing if this nodes represents a group. A group is // a node whose type is not URL. @@ -114,10 +114,10 @@ class BookmarkNode : public views::TreeNode<BookmarkNode> { history::StarredEntry::Type type_; // Date we were created. - Time date_added_; + base::Time date_added_; // Time last modified. Only used for groups. - Time date_group_modified_; + base::Time date_group_modified_; DISALLOW_COPY_AND_ASSIGN(BookmarkNode); }; @@ -292,7 +292,7 @@ class BookmarkModel : public NotificationObserver, public BookmarkService { int index, const std::wstring& title, const GURL& url, - const Time& creation_time); + const base::Time& creation_time); // This is the convenience that makes sure the url is starred or not starred. // If is_starred is false, all bookmarks for URL are removed. If is_starred is @@ -373,7 +373,7 @@ class BookmarkModel : public NotificationObserver, public BookmarkService { bool IsValidIndex(BookmarkNode* parent, int index, bool allow_end); // Sets the date modified time of the specified node. - void SetDateGroupModified(BookmarkNode* parent, const Time time); + void SetDateGroupModified(BookmarkNode* parent, const base::Time time); // Creates the bookmark bar/other nodes. These call into // CreateRootNodeFromStarredEntry. diff --git a/chrome/browser/bookmarks/bookmark_model_unittest.cc b/chrome/browser/bookmarks/bookmark_model_unittest.cc index 9edde81..2136347 100644 --- a/chrome/browser/bookmarks/bookmark_model_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_model_unittest.cc @@ -12,6 +12,9 @@ #include "chrome/views/tree_node_model.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; +using base::TimeDelta; + class BookmarkModelTest : public testing::Test, public BookmarkModelObserver { public: struct ObserverDetails { diff --git a/chrome/browser/bookmarks/bookmark_table_model_unittest.cc b/chrome/browser/bookmarks/bookmark_table_model_unittest.cc index ed2b215..04055ee 100644 --- a/chrome/browser/bookmarks/bookmark_table_model_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_table_model_unittest.cc @@ -10,6 +10,9 @@ #include "generated_resources.h" +using base::Time; +using base::TimeDelta; + // Base class for bookmark model tests. // Initial state of the bookmark model is as follows: // bb diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index a876d60..1ac1fb7 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -56,6 +56,8 @@ #include "chromium_strings.h" #include "generated_resources.h" +using base::TimeDelta; + static BrowserList g_browserlist; // How long we wait before updating the browser chrome while loading a page. diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc index 029d5fa..ef38181 100644 --- a/chrome/browser/browser_shutdown.cc +++ b/chrome/browser/browser_shutdown.cc @@ -24,6 +24,9 @@ #include "chrome/browser/plugin_service.h" #include "net/dns_global.h" +using base::Time; +using base::TimeDelta; + namespace browser_shutdown { Time shutdown_started_; diff --git a/chrome/browser/browsing_data_remover.cc b/chrome/browser/browsing_data_remover.cc index c38424a..b1823a7 100644 --- a/chrome/browser/browsing_data_remover.cc +++ b/chrome/browser/browsing_data_remover.cc @@ -20,6 +20,8 @@ #include "net/url_request/url_request_context.h" #include "webkit/glue/password_form.h" +using base::Time; + // Done so that we can use invokeLater on BrowsingDataRemovers and not have // BrowsingDataRemover implement RefCounted. void RunnableMethodTraits<BrowsingDataRemover>::RetainCallee( @@ -200,4 +202,3 @@ void BrowsingDataRemover::ClearCacheOnIOThread(Time delete_begin, ui_loop->PostTask(FROM_HERE, NewRunnableMethod( this, &BrowsingDataRemover::ClearedCache)); } - diff --git a/chrome/browser/browsing_data_remover.h b/chrome/browser/browsing_data_remover.h index 2e2b2a3..81819f0 100644 --- a/chrome/browser/browsing_data_remover.h +++ b/chrome/browser/browsing_data_remover.h @@ -36,7 +36,8 @@ class BrowsingDataRemover : public NotificationObserver { // Creates a BrowsingDataRemover to remove browser data from the specified // profile in the specified time range. Use Remove to initiate the removal. - BrowsingDataRemover(Profile* profile, Time delete_begin, Time delete_end); + BrowsingDataRemover(Profile* profile, base::Time delete_begin, + base::Time delete_end); ~BrowsingDataRemover(); // Removes the specified items related to browsing. @@ -64,8 +65,8 @@ class BrowsingDataRemover : public NotificationObserver { void ClearedCache(); // Invoked on the IO thread to delete from the cache. - void ClearCacheOnIOThread(Time delete_begin, - Time delete_end, + void ClearCacheOnIOThread(base::Time delete_begin, + base::Time delete_end, MessageLoop* ui_loop); // Returns true if we're all done. @@ -78,10 +79,10 @@ class BrowsingDataRemover : public NotificationObserver { Profile* profile_; // Start time to delete from. - const Time delete_begin_; + const base::Time delete_begin_; // End time to delete to. - const Time delete_end_; + const base::Time delete_end_; // True if Remove has been invoked. bool removing_; @@ -104,4 +105,3 @@ class BrowsingDataRemover : public NotificationObserver { }; #endif // CHROME_BROWSER_BROWSING_DATA_REMOVER_H__ - diff --git a/chrome/browser/cache_manager_host.cc b/chrome/browser/cache_manager_host.cc index be6faf3..c68cbaa8 100644 --- a/chrome/browser/cache_manager_host.cc +++ b/chrome/browser/cache_manager_host.cc @@ -15,6 +15,9 @@ #include "chrome/common/pref_service.h" #include "chrome/common/notification_service.h" +using base::Time; +using base::TimeDelta; + static const unsigned int kReviseAllocationDelayMS = 200 /* milliseconds */; // The default size limit of the in-memory cache is 8 MB diff --git a/chrome/browser/cache_manager_host.h b/chrome/browser/cache_manager_host.h index bff754e..a67c345 100644 --- a/chrome/browser/cache_manager_host.h +++ b/chrome/browser/cache_manager_host.h @@ -68,12 +68,12 @@ class CacheManagerHost { protected: // The amount of idle time before we consider a tab to be "inactive" - static const TimeDelta kRendererInactiveThreshold; + static const base::TimeDelta kRendererInactiveThreshold; // Keep track of some renderer information. struct RendererInfo : CacheManager::UsageStats { // The access time for this renderer. - Time access; + base::Time access; }; typedef std::map<int, RendererInfo> StatsMap; diff --git a/chrome/browser/cache_manager_host_unittest.cc b/chrome/browser/cache_manager_host_unittest.cc index e90d3c0..5dc9684 100644 --- a/chrome/browser/cache_manager_host_unittest.cc +++ b/chrome/browser/cache_manager_host_unittest.cc @@ -9,6 +9,8 @@ #include "testing/gtest/include/gtest/gtest.h" #include "webkit/glue/cache_manager.h" +using base::Time; + class CacheManagerHostTest : public testing::Test { protected: typedef CacheManagerHost::StatsMap StatsMap; diff --git a/chrome/browser/chrome_plugin_host.cc b/chrome/browser/chrome_plugin_host.cc index f96a8da..1c7af93 100644 --- a/chrome/browser/chrome_plugin_host.cc +++ b/chrome/browser/chrome_plugin_host.cc @@ -40,6 +40,8 @@ #include "net/base/base64.h" #include "skia/include/SkBitmap.h" +using base::TimeDelta; + // This class manages the interception of network requests. It queries the // plugin on every request, and creates an intercept job if the plugin can // intercept the request. @@ -755,4 +757,3 @@ void CPHandleCommand(int command, CPCommandInterface* data, NewRunnableFunction(PluginCommandHandler::HandleCommand, command, data, context_as_int32)); } - diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc index 3e36ab4..441d8ea 100644 --- a/chrome/browser/dom_ui/new_tab_ui.cc +++ b/chrome/browser/dom_ui/new_tab_ui.cc @@ -27,6 +27,10 @@ #include "chromium_strings.h" #include "generated_resources.h" +using base::Time; +using base::TimeDelta; +using base::TimeTicks; + // The URL scheme used for the new tab. static const char kNewTabUIScheme[] = "chrome-internal"; @@ -823,4 +827,3 @@ void NewTabUIContents::RequestOpenURL(const GURL& url, } } } - diff --git a/chrome/browser/download/download_file.cc b/chrome/browser/download/download_file.cc index 6b0fba4..f921661 100644 --- a/chrome/browser/download/download_file.cc +++ b/chrome/browser/download/download_file.cc @@ -26,6 +26,8 @@ #include "net/base/net_util.h" #include "net/url_request/url_request_context.h" +using base::TimeDelta; + // Throttle updates to the UI thread so that a fast moving download doesn't // cause it to become unresponsive (ins milliseconds). static const int kUpdatePeriodMs = 500; diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc index db93b35..5fa37a8 100644 --- a/chrome/browser/download/download_item_model.cc +++ b/chrome/browser/download/download_item_model.cc @@ -11,6 +11,8 @@ #include "generated_resources.h" +using base::TimeDelta; + DownloadItemModel::DownloadItemModel(DownloadItem* download) : download_(download) { } diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc index f88bb80..23af781 100644 --- a/chrome/browser/download/download_manager.cc +++ b/chrome/browser/download/download_manager.cc @@ -41,6 +41,9 @@ #include "generated_resources.h" +using base::Time; +using base::TimeDelta; + // Periodically update our observers. class DownloadItemUpdateTask : public Task { public: @@ -1323,4 +1326,3 @@ void DownloadManager::OnSearchComplete(HistoryService::Handle handle, requestor->SetDownloads(searched_downloads); } - diff --git a/chrome/browser/download/download_manager.h b/chrome/browser/download/download_manager.h index cbae765..38cc044 100644 --- a/chrome/browser/download/download_manager.h +++ b/chrome/browser/download/download_manager.h @@ -102,7 +102,7 @@ class DownloadItem { int path_uniquifier, const std::wstring& url, const std::wstring& original_name, - const Time start_time, + const base::Time start_time, int64 download_size, int render_process_id, int request_id, @@ -149,7 +149,7 @@ class DownloadItem { // |*remaining| with the amount of time remaining if successful. Fails and // returns false if we do not have the number of bytes or the speed so can // not estimate. - bool TimeRemaining(TimeDelta* remaining) const; + bool TimeRemaining(base::TimeDelta* remaining) const; // Simple speed estimate in bytes/s int64 CurrentSpeed() const; @@ -178,7 +178,7 @@ class DownloadItem { void set_total_bytes(int64 total_bytes) { total_bytes_ = total_bytes; } int64 received_bytes() const { return received_bytes_; } int32 id() const { return id_; } - Time start_time() const { return start_time_; } + base::Time start_time() const { return start_time_; } void set_db_handle(int64 handle) { db_handle_ = handle; } int64 db_handle() const { return db_handle_; } DownloadManager* manager() const { return manager_; } @@ -237,7 +237,7 @@ class DownloadItem { ObserverList<Observer> observers_; // Time the download was started - Time start_time_; + base::Time start_time_; // Our persistent store handle int64 db_handle_; @@ -329,12 +329,13 @@ class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>, // Remove downloads after remove_begin (inclusive) and before remove_end // (exclusive). You may pass in null Time values to do an unbounded delete // in either direction. - int RemoveDownloadsBetween(const Time remove_begin, const Time remove_end); + int RemoveDownloadsBetween(const base::Time remove_begin, + const base::Time remove_end); // Remove downloads will delete all downloads that have a timestamp that is // the same or more recent than |remove_begin|. The number of downloads // deleted is returned back to the caller. - int RemoveDownloads(const Time remove_begin); + int RemoveDownloads(const base::Time remove_begin); // Download the object at the URL. Used in cases such as "Save Link As..." void DownloadUrl(const GURL& url, @@ -418,8 +419,8 @@ class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>, // Update the history service for a particular download. void UpdateHistoryForDownload(DownloadItem* download); void RemoveDownloadFromHistory(DownloadItem* download); - void RemoveDownloadsFromHistoryBetween(const Time remove_begin, - const Time remove_before); + void RemoveDownloadsFromHistoryBetween(const base::Time remove_begin, + const base::Time remove_before); // Inform the notification service of download starts and stops. void NotifyAboutDownloadStart(); diff --git a/chrome/browser/download/save_package.cc b/chrome/browser/download/save_package.cc index e0dcc0b..b8bfc12 100644 --- a/chrome/browser/download/save_package.cc +++ b/chrome/browser/download/save_package.cc @@ -37,6 +37,8 @@ #include "generated_resources.h" +using base::Time; + // Default name which will be used when we can not get proper name from // resource URL. static const wchar_t kDefaultSaveName[] = L"saved_resource"; @@ -1060,4 +1062,3 @@ bool SavePackage::GetSafePureFileName(const std::wstring& dir_path, return false; } } - diff --git a/chrome/browser/download/save_package.h b/chrome/browser/download/save_package.h index 101007b..d7b76e9 100644 --- a/chrome/browser/download/save_package.h +++ b/chrome/browser/download/save_package.h @@ -29,10 +29,10 @@ class Profile; class WebContents; class URLRequestContext; class WebContents; -class Time; namespace base { class Thread; +class Time; } // The SavePackage object manages the process of saving a page as only-html or diff --git a/chrome/browser/history/download_database.cc b/chrome/browser/history/download_database.cc index e604e5d..0be6c10 100644 --- a/chrome/browser/history/download_database.cc +++ b/chrome/browser/history/download_database.cc @@ -12,6 +12,8 @@ #include "chrome/common/sqlite_utils.h" #include "chrome/common/sqlite_compiled_statement.h" +using base::Time; + // Download schema: // // id SQLite-generated primary key. @@ -175,4 +177,3 @@ void DownloadDatabase::SearchDownloads(std::vector<int64>* results, } } // namespace history - diff --git a/chrome/browser/history/download_database.h b/chrome/browser/history/download_database.h index d733546..fcf72f0 100644 --- a/chrome/browser/history/download_database.h +++ b/chrome/browser/history/download_database.h @@ -40,7 +40,7 @@ class DownloadDatabase { // (inclusive) and before |remove_end|. You may use null Time values // to do an unbounded delete in either direction. This function ignores // all downloads that are in progress or are waiting to be cancelled. - void RemoveDownloadsBetween(Time remove_begin, Time remove_end); + void RemoveDownloadsBetween(base::Time remove_begin, base::Time remove_end); // Search for downloads matching the search text. void SearchDownloads(std::vector<int64>* results, diff --git a/chrome/browser/history/download_types.h b/chrome/browser/history/download_types.h index 7a8258d..61a6d83 100644 --- a/chrome/browser/history/download_types.h +++ b/chrome/browser/history/download_types.h @@ -20,7 +20,7 @@ struct DownloadCreateInfo { DownloadCreateInfo(const std::wstring& path, const std::wstring& url, - Time start_time, + base::Time start_time, int64 received_bytes, int64 total_bytes, int32 state, @@ -50,7 +50,7 @@ struct DownloadCreateInfo { // A number that should be added to the suggested path to make it unique. // 0 means no number should be appended. Not actually stored in the db. int path_uniquifier; - Time start_time; + base::Time start_time; int64 received_bytes; int64 total_bytes; int32 state; diff --git a/chrome/browser/history/expire_history_backend.cc b/chrome/browser/history/expire_history_backend.cc index fcd8f67..0944b87 100644 --- a/chrome/browser/history/expire_history_backend.cc +++ b/chrome/browser/history/expire_history_backend.cc @@ -16,6 +16,9 @@ #include "chrome/browser/history/thumbnail_database.h" #include "chrome/common/notification_types.h" +using base::Time; +using base::TimeDelta; + namespace history { namespace { diff --git a/chrome/browser/history/expire_history_backend.h b/chrome/browser/history/expire_history_backend.h index d795f88..55c72c3 100644 --- a/chrome/browser/history/expire_history_backend.h +++ b/chrome/browser/history/expire_history_backend.h @@ -59,25 +59,25 @@ class ExpireHistoryBackend { // Begins periodic expiration of history older than the given threshold. This // will continue until the object is deleted. - void StartArchivingOldStuff(TimeDelta expiration_threshold); + void StartArchivingOldStuff(base::TimeDelta expiration_threshold); // Deletes everything associated with a URL. void DeleteURL(const GURL& url); // Removes all visits in the given time range, updating the URLs accordingly. - void ExpireHistoryBetween(Time begin_time, Time end_time); + void ExpireHistoryBetween(base::Time begin_time, base::Time end_time); // Archives all visits before and including the given time, updating the URLs // accordingly. This function is intended for migrating old databases // (which encompased all time) to the tiered structure and testing, and // probably isn't useful for anything else. - void ArchiveHistoryBefore(Time end_time); + void ArchiveHistoryBefore(base::Time end_time); // Returns the current time that we are archiving stuff to. This will return // the threshold in absolute time rather than a delta, so the caller should // not save it. - Time GetCurrentArchiveTime() const { - return Time::Now() - expiration_threshold_; + base::Time GetCurrentArchiveTime() const { + return base::Time::Now() - expiration_threshold_; } private: @@ -90,7 +90,7 @@ class ExpireHistoryBackend { struct DeleteDependencies { // The time range affected. These can be is_null() to be unbounded in one // or both directions. - Time begin_time, end_time; + base::Time begin_time, end_time; // ----- Filled by DeleteVisitRelatedInfo or manually if a function doesn't // call that function. ----- @@ -208,7 +208,7 @@ class ExpireHistoryBackend { // Schedules a call to DoArchiveIteration at the given time in the // future. - void ScheduleArchive(TimeDelta delay); + void ScheduleArchive(base::TimeDelta delay); // Calls ArchiveSomeOldHistory to expire some amount of old history, and // schedules another call to happen in the future. @@ -218,7 +218,7 @@ class ExpireHistoryBackend { // than |time_threshold|. The return value indicates if we think there might // be more history to expire with the current time threshold (it does not // indicate success or failure). - bool ArchiveSomeOldHistory(Time time_threshold, int max_visits); + bool ArchiveSomeOldHistory(base::Time time_threshold, int max_visits); // Tries to detect possible bad history or inconsistencies in the database // and deletes items. For example, URLs with no visits. @@ -243,7 +243,7 @@ class ExpireHistoryBackend { // The threshold for "old" history where we will automatically expire it to // the archived database. - TimeDelta expiration_threshold_; + base::TimeDelta expiration_threshold_; // The BookmarkService; may be null. This is owned by the Profile. // diff --git a/chrome/browser/history/expire_history_backend_unittest.cc b/chrome/browser/history/expire_history_backend_unittest.cc index e067894..fab52e5 100644 --- a/chrome/browser/history/expire_history_backend_unittest.cc +++ b/chrome/browser/history/expire_history_backend_unittest.cc @@ -20,6 +20,10 @@ #include "testing/gtest/include/gtest/gtest.h" #include "SkBitmap.h" +using base::Time; +using base::TimeDelta; +using base::TimeTicks; + // The test must be in the history namespace for the gtest forward declarations // to work. It also eliminates a bunch of ugly "history::". namespace history { diff --git a/chrome/browser/history/history.cc b/chrome/browser/history/history.cc index 92bea22..53afbd5 100644 --- a/chrome/browser/history/history.cc +++ b/chrome/browser/history/history.cc @@ -47,6 +47,7 @@ #include "chromium_strings.h" #include "generated_resources.h" +using base::Time; using history::HistoryBackend; // Sends messages from the backend to us on the main thread. This must be a diff --git a/chrome/browser/history/history.h b/chrome/browser/history/history.h index 2aee029..dcd5518 100644 --- a/chrome/browser/history/history.h +++ b/chrome/browser/history/history.h @@ -163,7 +163,7 @@ class HistoryService : public CancelableRequestProvider, // For adding pages to history with a specific time. This is for testing // purposes. Call the previous one to use the current time. void AddPage(const GURL& url, - Time time, + base::Time time, const void* id_scope, int32 page_id, const GURL& referrer, @@ -280,7 +280,7 @@ class HistoryService : public CancelableRequestProvider, typedef Callback4<Handle, bool, // Were we able to determine the # of visits? int, // Number of visits. - Time>::Type // Time of first visit. Only first bool is + base::Time>::Type // Time of first visit. Only first bool is // true and int is > 0. GetVisitCountToHostCallback; @@ -387,7 +387,7 @@ class HistoryService : public CancelableRequestProvider, // if they are no longer referenced. |callback| runs when the expiration is // complete. You may use null Time values to do an unbounded delete in // either direction. - void ExpireHistoryBetween(Time begin_time, Time end_time, + void ExpireHistoryBetween(base::Time begin_time, base::Time end_time, CancelableRequestConsumerBase* consumer, ExpireHistoryCallback* callback); @@ -434,7 +434,7 @@ class HistoryService : public CancelableRequestProvider, // progress or in the process of being cancelled. This is a 'fire and forget' // operation. You can pass is_null times to get unbounded time in either or // both directions. - void RemoveDownloadsBetween(Time remove_begin, Time remove_end); + void RemoveDownloadsBetween(base::Time remove_begin, base::Time remove_end); // Implemented by the caller of 'SearchDownloads' below, and is called when // the history system has retrieved the search results. @@ -464,7 +464,7 @@ class HistoryService : public CancelableRequestProvider, // to the segment ID. The URL and all the other information is set to the page // representing the segment. Handle QuerySegmentUsageSince(CancelableRequestConsumerBase* consumer, - const Time from_time, + const base::Time from_time, SegmentQueryCallback* callback); // Set the presentation index for the segment identified by |segment_id|. @@ -533,7 +533,7 @@ class HistoryService : public CancelableRequestProvider, const std::wstring& title, int visit_count, int typed_count, - Time last_visit, + base::Time last_visit, bool hidden); // The same as AddPageWithDetails() but takes a vector. diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index f8e6449..afaee0a 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -23,6 +23,10 @@ #include "googleurl/src/gurl.h" #include "net/base/registry_controlled_domain.h" +using base::Time; +using base::TimeDelta; +using base::TimeTicks; + /* The HistoryBackend consists of a number of components: HistoryDatabase (stores past 3 months of history) diff --git a/chrome/browser/history/history_backend.h b/chrome/browser/history/history_backend.h index e646570..b03a781 100644 --- a/chrome/browser/history/history_backend.h +++ b/chrome/browser/history/history_backend.h @@ -197,16 +197,16 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, void CreateDownload(scoped_refptr<DownloadCreateRequest> request, const DownloadCreateInfo& info); void RemoveDownload(int64 db_handle); - void RemoveDownloadsBetween(const Time remove_begin, - const Time remove_end); - void RemoveDownloads(const Time remove_end); + void RemoveDownloadsBetween(const base::Time remove_begin, + const base::Time remove_end); + void RemoveDownloads(const base::Time remove_end); void SearchDownloads(scoped_refptr<DownloadSearchRequest>, const std::wstring& search_text); // Segment usage ------------------------------------------------------------- void QuerySegmentUsage(scoped_refptr<QuerySegmentUsageRequest> request, - const Time from_time); + const base::Time from_time); void DeleteOldSegmentData(); void SetSegmentPresentationIndex(SegmentID segment_id, int index); @@ -234,8 +234,8 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, // Calls ExpireHistoryBackend::ExpireHistoryBetween and commits the change. void ExpireHistoryBetween(scoped_refptr<ExpireHistoryRequest> request, - Time begin_time, - Time end_time); + base::Time begin_time, + base::Time end_time); // Bookmarks ----------------------------------------------------------------- @@ -282,7 +282,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, // This does not schedule database commits, it is intended to be used as a // subroutine for AddPage only. It also assumes the database is valid. std::pair<URLID, VisitID> AddPageVisit(const GURL& url, - Time time, + base::Time time, VisitID referring_visit, PageTransition::Type transition); @@ -345,7 +345,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, VisitID from_visit, VisitID visit_id, PageTransition::Type transition_type, - const Time ts); + const base::Time ts); // Favicons ------------------------------------------------------------------ @@ -454,13 +454,13 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, // of the timer), so we can try to ensure they're unique when they're added // to the database by using the last_recorded_time_ (q.v.). We still can't // enforce or guarantee uniqueness, since the user might set his clock back. - Time last_requested_time_; + base::Time last_requested_time_; // Timestamp of the last page addition, as it was recorded in the database. // If two or more requests come in at the same time, we increment that time // by 1 us between them so it's more likely to be unique in the database. // This keeps track of that higher-resolution timestamp. - Time last_recorded_time_; + base::Time last_recorded_time_; // When non-NULL, this is the task that should be invoked on MessageLoop* backend_destroy_message_loop_; diff --git a/chrome/browser/history/history_backend_unittest.cc b/chrome/browser/history/history_backend_unittest.cc index 3bbb716..a762df4 100644 --- a/chrome/browser/history/history_backend_unittest.cc +++ b/chrome/browser/history/history_backend_unittest.cc @@ -14,6 +14,8 @@ #include "chrome/tools/profiles/thumbnail-inl.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; + // This file only tests functionality where it is most convenient to call the // backend directly. Most of the history backend functions are tested by the // history unit test. Because of the elaborate callbacks involved, this is no @@ -385,4 +387,3 @@ TEST_F(HistoryBackendTest, GetPageThumbnailAfterRedirects) { } } // namespace history - diff --git a/chrome/browser/history/history_marshaling.h b/chrome/browser/history/history_marshaling.h index fa02095..6ec7d3a 100644 --- a/chrome/browser/history/history_marshaling.h +++ b/chrome/browser/history/history_marshaling.h @@ -21,7 +21,7 @@ namespace history { class HistoryAddPageArgs : public base::RefCounted<HistoryAddPageArgs> { public: HistoryAddPageArgs(const GURL& arg_url, - Time arg_time, + base::Time arg_time, const void* arg_id_scope, int32 arg_page_id, const GURL& arg_referrer, @@ -37,7 +37,7 @@ class HistoryAddPageArgs : public base::RefCounted<HistoryAddPageArgs> { } GURL url; - Time time; + base::Time time; const void* id_scope; int32 page_id; diff --git a/chrome/browser/history/history_querying_unittest.cc b/chrome/browser/history/history_querying_unittest.cc index 625bc5b..cb6bfc5 100644 --- a/chrome/browser/history/history_querying_unittest.cc +++ b/chrome/browser/history/history_querying_unittest.cc @@ -8,6 +8,9 @@ #include "chrome/browser/history/history.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; +using base::TimeDelta; + // Tests the history service for querying functionality. namespace history { diff --git a/chrome/browser/history/history_types.cc b/chrome/browser/history/history_types.cc index 44abb65..5d9a2f7 100644 --- a/chrome/browser/history/history_types.cc +++ b/chrome/browser/history/history_types.cc @@ -6,6 +6,8 @@ #include "chrome/browser/history/history_types.h" +using base::Time; + namespace history { // URLRow ---------------------------------------------------------------------- diff --git a/chrome/browser/history/history_types.h b/chrome/browser/history/history_types.h index 5ad53205..cc64a45 100644 --- a/chrome/browser/history/history_types.h +++ b/chrome/browser/history/history_types.h @@ -97,10 +97,10 @@ class URLRow { typed_count_ = typed_count; } - Time last_visit() const { + base::Time last_visit() const { return last_visit_; } - void set_last_visit(Time last_visit) { + void set_last_visit(base::Time last_visit) { last_visit_ = last_visit; } @@ -151,7 +151,7 @@ class URLRow { // The date of the last visit of this URL, which saves us from having to // loop up in the visit table for things like autocomplete and expiration. - Time last_visit_; + base::Time last_visit_; // Indicates this entry should now be shown in typical UI or queries, this // is usually for subframes. @@ -173,7 +173,7 @@ class VisitRow { public: VisitRow(); VisitRow(URLID arg_url_id, - Time arg_visit_time, + base::Time arg_visit_time, VisitID arg_referring_visit, PageTransition::Type arg_transition, SegmentID arg_segment_id); @@ -184,7 +184,7 @@ class VisitRow { // Row ID into the URL table of the URL that this page is. URLID url_id; - Time visit_time; + base::Time visit_time; // Indicates another visit that was the referring page for this one. // 0 indicates no referrer. @@ -236,7 +236,7 @@ struct ImportedFavIconUsage { // associated with a VisitRow. struct PageVisit { URLID page_id; - Time visit_time; + base::Time visit_time; }; // StarredEntry --------------------------------------------------------------- @@ -278,7 +278,7 @@ struct StarredEntry { std::wstring title; // When this was added. - Time date_added; + base::Time date_added; // Group ID of the star group this entry is in. If 0, this entry is not // in a star group. @@ -305,7 +305,7 @@ struct StarredEntry { // Time the entry was last modified. This is only used for groups and // indicates the last time a URL was added as a child to the group. - Time date_group_modified; + base::Time date_group_modified; }; // URLResult ------------------------------------------------------------------- @@ -313,7 +313,7 @@ struct StarredEntry { class URLResult : public URLRow { public: URLResult() {} - URLResult(const GURL& url, Time visit_time) + URLResult(const GURL& url, base::Time visit_time) : URLRow(url), visit_time_(visit_time) { } @@ -324,8 +324,8 @@ class URLResult : public URLRow { title_match_positions_ = title_matches; } - Time visit_time() const { return visit_time_; } - void set_visit_time(Time visit_time) { visit_time_ = visit_time; } + base::Time visit_time() const { return visit_time_; } + void set_visit_time(base::Time visit_time) { visit_time_ = visit_time; } const Snippet& snippet() const { return snippet_; } @@ -342,7 +342,7 @@ class URLResult : public URLRow { friend class HistoryBackend; // The time that this result corresponds to. - Time visit_time_; + base::Time visit_time_; // These values are typically set by HistoryBackend. Snippet snippet_; @@ -373,8 +373,8 @@ class QueryResults { // // TODO(brettw): bug 1203054: This field is not currently set properly! Do // not use until the bug is fixed. - Time first_time_searched() const { return first_time_searched_; } - void set_first_time_searched(Time t) { first_time_searched_ = t; } + base::Time first_time_searched() const { return first_time_searched_; } + void set_first_time_searched(base::Time t) { first_time_searched_ = t; } // Note: If you need end_time_searched, it can be added. size_t size() const { return results_.size(); } @@ -429,7 +429,7 @@ class QueryResults { // (this is inclusive). This is used when inserting or deleting. void AdjustResultMap(size_t begin, size_t end, ptrdiff_t delta); - Time first_time_searched_; + base::Time first_time_searched_; // The ordered list of results. The pointers inside this are owned by this // QueryResults object. @@ -460,13 +460,13 @@ struct QueryOptions { // will be searched. However, if you set one, you must set the other. // // The beginning is inclusive and the ending is exclusive. - Time begin_time; - Time end_time; + base::Time begin_time; + base::Time end_time; // Sets the query time to the last |days_ago| days to the present time. void SetRecentDayRange(int days_ago) { - end_time = Time::Now(); - begin_time = end_time - TimeDelta::FromDays(days_ago); + end_time = base::Time::Now(); + begin_time = end_time - base::TimeDelta::FromDays(days_ago); } // When set, only one visit for each URL will be returned, which will be the @@ -489,7 +489,7 @@ struct QueryOptions { // gives the time and search term of the keyword visit. struct KeywordSearchTermVisit { // The time of the visit. - Time time; + base::Time time; // The search term that was used. std::wstring term; diff --git a/chrome/browser/history/history_types_unittest.cc b/chrome/browser/history/history_types_unittest.cc index 7365e53..2bc0382 100644 --- a/chrome/browser/history/history_types_unittest.cc +++ b/chrome/browser/history/history_types_unittest.cc @@ -5,6 +5,8 @@ #include "chrome/browser/history/history_types.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; + namespace history { namespace { diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc index 6e00e1b..11b58b0 100644 --- a/chrome/browser/history/history_unittest.cc +++ b/chrome/browser/history/history_unittest.cc @@ -43,6 +43,9 @@ #include "chrome/tools/profiles/thumbnail-inl.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; +using base::TimeDelta; + class HistoryTest; // Specialize RunnableMethodTraits for HistoryTest so we can create callbacks. diff --git a/chrome/browser/history/starred_url_database.cc b/chrome/browser/history/starred_url_database.cc index 67baced..9514b04 100644 --- a/chrome/browser/history/starred_url_database.cc +++ b/chrome/browser/history/starred_url_database.cc @@ -17,6 +17,8 @@ #include "chrome/common/sqlite_utils.h" #include "chrome/common/stl_util-inl.h" +using base::Time; + // The following table is used to store star (aka bookmark) information. This // class derives from URLDatabase, which has its own schema. // @@ -626,4 +628,3 @@ bool StarredURLDatabase::MigrateBookmarksToFileImpl(const std::wstring& path) { } } // namespace history - diff --git a/chrome/browser/history/starred_url_database.h b/chrome/browser/history/starred_url_database.h index 87bcef4..2d09adcd 100644 --- a/chrome/browser/history/starred_url_database.h +++ b/chrome/browser/history/starred_url_database.h @@ -73,7 +73,7 @@ class StarredURLDatabase : public URLDatabase { const std::wstring& title, UIStarID parent_group_id, int visual_order, - Time date_modified); + base::Time date_modified); // Adjusts the visual order of all children of parent_group_id with a // visual_order >= start_visual_order by delta. For example, @@ -91,7 +91,7 @@ class StarredURLDatabase : public URLDatabase { UIStarID group_id, UIStarID parent_group_id, const std::wstring& title, - const Time& date_added, + const base::Time& date_added, int visual_order, StarredEntry::Type type); diff --git a/chrome/browser/history/text_database.cc b/chrome/browser/history/text_database.cc index 46fd8c0..ef1d706 100644 --- a/chrome/browser/history/text_database.cc +++ b/chrome/browser/history/text_database.cc @@ -32,6 +32,8 @@ // an FTS table that is indexed like a normal table, and the index over it is // free since sqlite always indexes the internal rowid. +using base::Time; + namespace history { namespace { diff --git a/chrome/browser/history/text_database.h b/chrome/browser/history/text_database.h index bba9a8f..5c76086 100644 --- a/chrome/browser/history/text_database.h +++ b/chrome/browser/history/text_database.h @@ -36,7 +36,7 @@ class TextDatabase { std::wstring title; // Time the page that was returned was visited. - Time time; + base::Time time; // Identifies any found matches in the title of the document. These are not // included in the snippet. @@ -98,13 +98,13 @@ class TextDatabase { // Adds the given data to the page. Returns true on success. The data should // already be converted to UTF-8. - bool AddPageData(Time time, + bool AddPageData(base::Time time, const std::string& url, const std::string& title, const std::string& contents); // Deletes the indexed data exactly matching the given URL/time pair. - void DeletePageData(Time time, const std::string& url); + void DeletePageData(base::Time time, const std::string& url); // Optimizes the tree inside the database. This will, in addition to making // access faster, remove any deleted data from the database (normally it is @@ -133,7 +133,7 @@ class TextDatabase { const QueryOptions& options, std::vector<Match>* results, URLSet* unique_urls, - Time* first_time_searched); + base::Time* first_time_searched); // Converts the given database identifier to a filename. This does not include // the path, just the file and extension. diff --git a/chrome/browser/history/text_database_manager.cc b/chrome/browser/history/text_database_manager.cc index e96aa5b..21a7436 100644 --- a/chrome/browser/history/text_database_manager.cc +++ b/chrome/browser/history/text_database_manager.cc @@ -12,6 +12,10 @@ #include "base/string_util.h" #include "chrome/common/mru_cache.h" +using base::Time; +using base::TimeDelta; +using base::TimeTicks; + namespace history { namespace { diff --git a/chrome/browser/history/text_database_manager.h b/chrome/browser/history/text_database_manager.h index 3788ee3..fc5bdae 100644 --- a/chrome/browser/history/text_database_manager.h +++ b/chrome/browser/history/text_database_manager.h @@ -95,7 +95,7 @@ class TextDatabaseManager { // get updated to refer to the full text indexed information. The visit time // should be the time corresponding to that visit in the database. void AddPageURL(const GURL& url, URLID url_id, VisitID visit_id, - Time visit_time); + base::Time visit_time); void AddPageTitle(const GURL& url, const std::wstring& title); void AddPageContents(const GURL& url, const std::wstring& body); @@ -106,14 +106,14 @@ class TextDatabaseManager { bool AddPageData(const GURL& url, URLID url_id, VisitID visit_id, - Time visit_time, + base::Time visit_time, const std::wstring& title, const std::wstring& body); // Deletes the instance of indexed data identified by the given time and URL. // Any changes will be tracked in the optional change set for use when calling // OptimizeChangedDatabases later. change_set can be NULL. - void DeletePageData(Time time, const GURL& url, + void DeletePageData(base::Time time, const GURL& url, ChangeSet* change_set); // The text database manager keeps a list of changes that are made to the @@ -124,7 +124,7 @@ class TextDatabaseManager { // // Either or both times my be is_null to be unbounded in that direction. When // non-null, the range is [begin, end). - void DeleteFromUncommitted(Time begin, Time end); + void DeleteFromUncommitted(base::Time begin, base::Time end); // Same as DeleteFromUncommitted but for a single URL. void DeleteURLFromUncommitted(const GURL& url); @@ -149,7 +149,7 @@ class TextDatabaseManager { void GetTextMatches(const std::wstring& query, const QueryOptions& options, std::vector<TextDatabase::Match>* results, - Time* first_time_searched); + base::Time* first_time_searched); private: // These tests call ExpireRecentChangesForTime to force expiration. @@ -161,12 +161,12 @@ class TextDatabaseManager { // visit, title, and body all come in at different times. class PageInfo { public: - PageInfo(URLID url_id, VisitID visit_id, Time visit_time); + PageInfo(URLID url_id, VisitID visit_id, base::Time visit_time); // Getters. URLID url_id() const { return url_id_; } VisitID visit_id() const { return visit_id_; } - Time visit_time() const { return visit_time_; } + base::Time visit_time() const { return visit_time_; } const std::wstring& title() const { return title_; } const std::wstring& body() const { return body_; } @@ -183,7 +183,7 @@ class TextDatabaseManager { // Returns true if this entry was added too long ago and we should give up // waiting for more data. The current time is passed in as an argument so we // can check many without re-querying the timer. - bool Expired(TimeTicks now) const; + bool Expired(base::TimeTicks now) const; private: URLID url_id_; @@ -191,11 +191,11 @@ class TextDatabaseManager { // Time of the visit of the URL. This will be the value stored in the URL // and visit tables for the entry. - Time visit_time_; + base::Time visit_time_; // When this page entry was created. We have a cap on the maximum time that // an entry will be in the queue before being flushed to the database. - TimeTicks added_time_; + base::TimeTicks added_time_; // Will be the string " " when they are set to distinguish set and unset. std::wstring title_; @@ -203,8 +203,8 @@ class TextDatabaseManager { }; // Converts the given time to a database identifier or vice-versa. - static TextDatabase::DBIdent TimeToID(Time time); - static Time IDToTime(TextDatabase::DBIdent id); + static TextDatabase::DBIdent TimeToID(base::Time time); + static base::Time IDToTime(TextDatabase::DBIdent id); // Returns a text database for the given identifier or time. This file will // be created if it doesn't exist and |for_writing| is set. On error, @@ -217,7 +217,7 @@ class TextDatabaseManager { // The pointer will be tracked in the cache. The caller should not store it // or delete it since it will get automatically deleted as necessary. TextDatabase* GetDB(TextDatabase::DBIdent id, bool for_writing); - TextDatabase* GetDBForTime(Time time, bool for_writing); + TextDatabase* GetDBForTime(base::Time time, bool for_writing); // Populates the present_databases_ list based on which files are on disk. // When the list is already initialized, this will do nothing, so you can @@ -234,7 +234,7 @@ class TextDatabaseManager { // Given "now," this will expire old things from the recent_changes_ list. // This is used as the backend for FlushOldChanges and is called directly // by the unit tests with fake times. - void FlushOldChangesForTime(TimeTicks now); + void FlushOldChangesForTime(base::TimeTicks now); // Directory holding our index files. const std::wstring dir_; diff --git a/chrome/browser/history/text_database_manager_unittest.cc b/chrome/browser/history/text_database_manager_unittest.cc index 8b7c6b9..fd9a46d 100644 --- a/chrome/browser/history/text_database_manager_unittest.cc +++ b/chrome/browser/history/text_database_manager_unittest.cc @@ -7,6 +7,10 @@ #include "chrome/browser/history/text_database_manager.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; +using base::TimeDelta; +using base::TimeTicks; + namespace history { namespace { diff --git a/chrome/browser/history/text_database_unittest.cc b/chrome/browser/history/text_database_unittest.cc index 511f114..550a347 100644 --- a/chrome/browser/history/text_database_unittest.cc +++ b/chrome/browser/history/text_database_unittest.cc @@ -10,6 +10,8 @@ #include "chrome/browser/history/text_database.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; + namespace history { namespace { diff --git a/chrome/browser/history/thumbnail_database.cc b/chrome/browser/history/thumbnail_database.cc index 05126b8..7cef980 100644 --- a/chrome/browser/history/thumbnail_database.cc +++ b/chrome/browser/history/thumbnail_database.cc @@ -13,6 +13,8 @@ #include "chrome/common/thumbnail_score.h" #include "skia/include/SkBitmap.h" +using base::Time; + namespace history { // Version number of the database. diff --git a/chrome/browser/history/thumbnail_database.h b/chrome/browser/history/thumbnail_database.h index f98d8e9..a72c0ef 100644 --- a/chrome/browser/history/thumbnail_database.h +++ b/chrome/browser/history/thumbnail_database.h @@ -15,7 +15,7 @@ struct sqlite3; struct ThumbnailScore; -class Time; +class base::Time; namespace history { @@ -80,10 +80,10 @@ class ThumbnailDatabase { // should be refreshed. bool SetFavIcon(FavIconID icon_id, const std::vector<unsigned char>& icon_data, - Time time); + base::Time time); // Sets the time the favicon was last updated. - bool SetFavIconLastUpdateTime(FavIconID icon_id, const Time& time); + bool SetFavIconLastUpdateTime(FavIconID icon_id, const base::Time& time); // Returns the id of the entry in the favicon database with the specified url. // Returns 0 if no entry exists for the specified url. @@ -92,7 +92,7 @@ class ThumbnailDatabase { // Gets the png encoded favicon and last updated time for the specified // favicon id. bool GetFavIcon(FavIconID icon_id, - Time* last_updated, + base::Time* last_updated, std::vector<unsigned char>* png_icon_data, GURL* icon_url); diff --git a/chrome/browser/history/thumbnail_database_unittest.cc b/chrome/browser/history/thumbnail_database_unittest.cc index 34b5042..318d385 100644 --- a/chrome/browser/history/thumbnail_database_unittest.cc +++ b/chrome/browser/history/thumbnail_database_unittest.cc @@ -15,6 +15,9 @@ #include "testing/gtest/include/gtest/gtest.h" #include "SkBitmap.h" +using base::Time; +using base::TimeDelta; + namespace history { namespace { diff --git a/chrome/browser/history/url_database.cc b/chrome/browser/history/url_database.cc index aeb9ed2..83b038b 100644 --- a/chrome/browser/history/url_database.cc +++ b/chrome/browser/history/url_database.cc @@ -12,6 +12,8 @@ #include "chrome/common/sqlite_utils.h" #include "googleurl/src/gurl.h" +using base::Time; + namespace history { const char URLDatabase::kURLRowFields[] = HISTORY_URL_ROW_FIELDS; diff --git a/chrome/browser/history/url_database_unittest.cc b/chrome/browser/history/url_database_unittest.cc index b365d03..c58029d 100644 --- a/chrome/browser/history/url_database_unittest.cc +++ b/chrome/browser/history/url_database_unittest.cc @@ -10,6 +10,9 @@ #include "chrome/common/sqlite_utils.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; +using base::TimeDelta; + namespace history { namespace { diff --git a/chrome/browser/history/visit_database.cc b/chrome/browser/history/visit_database.cc index 6ab526b..fbba4d4 100644 --- a/chrome/browser/history/visit_database.cc +++ b/chrome/browser/history/visit_database.cc @@ -12,6 +12,8 @@ #include "chrome/browser/history/url_database.h" #include "chrome/common/page_transition_types.h" +using base::Time; + // Rows, in order, of the visit table. #define HISTORY_VISIT_ROW_FIELDS \ " id,url,visit_time,from_visit,transition,segment_id,is_indexed " @@ -365,4 +367,3 @@ bool VisitDatabase::GetVisitCountToHost(const GURL& url, } } // namespace history - diff --git a/chrome/browser/history/visit_database.h b/chrome/browser/history/visit_database.h index 0e82233..137fdc0 100644 --- a/chrome/browser/history/visit_database.h +++ b/chrome/browser/history/visit_database.h @@ -61,8 +61,8 @@ class VisitDatabase { // is used for history expiration.) // // The results will be in increasing order of date. - void GetAllVisitsInRange(Time begin_time, Time end_time, int max_results, - VisitVector* visits); + void GetAllVisitsInRange(base::Time begin_time, base::Time end_time, + int max_results, VisitVector* visits); // Fills all visits in the given time range into the given vector that should // be user-visible, which excludes things like redirects and subframes. The @@ -75,7 +75,7 @@ class VisitDatabase { // // When |most_recent_visit_only| is set, only one visit for each URL will be // returned, and it will be the most recent one in the time range. - void GetVisibleVisitsInRange(Time begin_time, Time end_time, + void GetVisibleVisitsInRange(base::Time begin_time, base::Time end_time, bool most_recent_visit_only, int max_count, VisitVector* visits); @@ -116,7 +116,8 @@ class VisitDatabase { // schemes are ignored and false is returned). // count is set to the number of visits, first_visit is set to the first time // the host was visited. Returns true on success. - bool GetVisitCountToHost(const GURL& url, int* count, Time* first_visit); + bool GetVisitCountToHost(const GURL& url, int* count, + base::Time* first_visit); protected: // Returns the database and statement cache for the functions in this @@ -144,4 +145,3 @@ class VisitDatabase { } // history #endif // CHROME_BROWSER_HISTORY_VISIT_DATABASE_H__ - diff --git a/chrome/browser/history/visit_database_unittest.cc b/chrome/browser/history/visit_database_unittest.cc index 857c006..1992f0b 100644 --- a/chrome/browser/history/visit_database_unittest.cc +++ b/chrome/browser/history/visit_database_unittest.cc @@ -11,6 +11,9 @@ #include "chrome/common/sqlite_utils.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; +using base::TimeDelta; + namespace history { namespace { diff --git a/chrome/browser/history/visitsegment_database.cc b/chrome/browser/history/visitsegment_database.cc index 8754018..0da96a1 100644 --- a/chrome/browser/history/visitsegment_database.cc +++ b/chrome/browser/history/visitsegment_database.cc @@ -10,6 +10,8 @@ #include "chrome/common/sqlite_compiled_statement.h" #include "chrome/common/sqlite_utils.h" +using base::Time; + // The following tables are used to store url segment information. // // segments @@ -386,4 +388,3 @@ bool VisitSegmentDatabase::DeleteSegmentForURL(URLID url_id) { } } // namespace history - diff --git a/chrome/browser/history/visitsegment_database.h b/chrome/browser/history/visitsegment_database.h index 8165f88..6a4081c 100644 --- a/chrome/browser/history/visitsegment_database.h +++ b/chrome/browser/history/visitsegment_database.h @@ -45,17 +45,17 @@ class VisitSegmentDatabase { // Increase the segment visit count by the provided amount. Return true on // success. - bool IncreaseSegmentVisitCount(SegmentID segment_id, const Time& ts, + bool IncreaseSegmentVisitCount(SegmentID segment_id, const base::Time& ts, int amount); // Compute the segment usage since |from_time| using the provided aggregator. // A PageUsageData is added in |result| for the nine highest-scored segments. - void QuerySegmentUsage(const Time& from_time, + void QuerySegmentUsage(const base::Time& from_time, std::vector<PageUsageData*>* result); // Delete all the segment usage data which is older than the provided time // stamp. - void DeleteSegmentData(const Time& older_than); + void DeleteSegmentData(const base::Time& older_than); // Change the presentation id for the segment identified by |segment_id| void SetSegmentPresentationIndex(SegmentID segment_id, int index); diff --git a/chrome/browser/history_model.cc b/chrome/browser/history_model.cc index 5af38d6..49102a7 100644 --- a/chrome/browser/history_model.cc +++ b/chrome/browser/history_model.cc @@ -7,6 +7,8 @@ #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/profile.h" +using base::Time; + // The max number of results to retrieve when browsing user's history. static const int kMaxBrowseResults = 800; diff --git a/chrome/browser/history_model.h b/chrome/browser/history_model.h index 07e69a3..654c910 100644 --- a/chrome/browser/history_model.h +++ b/chrome/browser/history_model.h @@ -22,7 +22,7 @@ class HistoryModel : public BaseHistoryModel, // BaseHistoryModel methods (see BaseHistoryModel for description). virtual int GetItemCount(); - virtual Time GetVisitTime(int index); + virtual base::Time GetVisitTime(int index); virtual const std::wstring& GetTitle(int index); virtual const GURL& GetURL(int index); virtual history::URLID GetURLID(int index); @@ -83,7 +83,7 @@ class HistoryModel : public BaseHistoryModel, int search_depth_; // The time that the current query was started. - Time search_start_; + base::Time search_start_; DISALLOW_EVIL_CONSTRUCTORS(HistoryModel); }; diff --git a/chrome/browser/history_view.cc b/chrome/browser/history_view.cc index 035e5e1..266aa00 100644 --- a/chrome/browser/history_view.cc +++ b/chrome/browser/history_view.cc @@ -27,6 +27,9 @@ #include "generated_resources.h" +using base::Time; +using base::TimeDelta; + // The extra-wide space between groups of entries for each new day. static const int kDayHeadingHeight = 50; @@ -1309,4 +1312,3 @@ gfx::Rect HistoryView::CalculateDeleteControlBounds(int base_y) { delete_width, kBrowseResultsHeight); } - diff --git a/chrome/browser/ie7_password.h b/chrome/browser/ie7_password.h index 2da547d..c90b8e2 100644 --- a/chrome/browser/ie7_password.h +++ b/chrome/browser/ie7_password.h @@ -22,7 +22,7 @@ struct IE7PasswordInfo { std::vector<unsigned char> encrypted_data; // When the login was imported. - Time date_created; + base::Time date_created; }; namespace ie7_password { diff --git a/chrome/browser/importer/firefox2_importer.cc b/chrome/browser/importer/firefox2_importer.cc index 59f1778..0594001 100644 --- a/chrome/browser/importer/firefox2_importer.cc +++ b/chrome/browser/importer/firefox2_importer.cc @@ -18,6 +18,8 @@ #include "generated_resources.h" #include "net/base/data_url.h" +using base::Time; + // Firefox2Importer. Firefox2Importer::Firefox2Importer() { @@ -512,4 +514,3 @@ void Firefox2Importer::DataURLToFaviconUsage( favicons->push_back(usage); } - diff --git a/chrome/browser/importer/firefox2_importer.h b/chrome/browser/importer/firefox2_importer.h index 2c44993..4c55eb0 100644 --- a/chrome/browser/importer/firefox2_importer.h +++ b/chrome/browser/importer/firefox2_importer.h @@ -75,7 +75,7 @@ class Firefox2Importer : public Importer { GURL* url, GURL* favicon, std::wstring* shortcut, - Time* add_date, + base::Time* add_date, std::wstring* post_data); // Fetches the given attribute value from the |tag|. Returns true if diff --git a/chrome/browser/importer/firefox3_importer.cc b/chrome/browser/importer/firefox3_importer.cc index 3279130..07f9683 100644 --- a/chrome/browser/importer/firefox3_importer.cc +++ b/chrome/browser/importer/firefox3_importer.cc @@ -15,6 +15,8 @@ #include "chrome/common/time_format.h" #include "generated_resources.h" +using base::Time; + // Wraps the function sqlite3_close() in a class that is // used in scoped_ptr_malloc. @@ -499,4 +501,3 @@ void Firefox3Importer::LoadFavicons( s.reset(); } } - diff --git a/chrome/browser/importer/firefox3_importer.h b/chrome/browser/importer/firefox3_importer.h index d4cc0bc..0accadf 100644 --- a/chrome/browser/importer/firefox3_importer.h +++ b/chrome/browser/importer/firefox3_importer.h @@ -48,7 +48,7 @@ class Firefox3Importer : public Importer { std::wstring title; int type; std::string keyword; - Time date_added; + base::Time date_added; int64 favicon; }; typedef std::vector<BookmarkItem*> BookmarkList; diff --git a/chrome/browser/importer/firefox_importer_unittest.cc b/chrome/browser/importer/firefox_importer_unittest.cc index d47b133..742a806 100644 --- a/chrome/browser/importer/firefox_importer_unittest.cc +++ b/chrome/browser/importer/firefox_importer_unittest.cc @@ -11,6 +11,8 @@ #include "chrome/browser/importer/firefox_profile_lock.h" #include "chrome/common/chrome_paths.h" +using base::Time; + TEST(FirefoxImporterTest, Firefox2NSS3Decryptor) { std::wstring nss_path; ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &nss_path)); diff --git a/chrome/browser/importer/ie_importer.cc b/chrome/browser/importer/ie_importer.cc index c4505ff..19f60a1 100644 --- a/chrome/browser/importer/ie_importer.cc +++ b/chrome/browser/importer/ie_importer.cc @@ -25,6 +25,8 @@ #include "generated_resources.h" +using base::Time; + namespace { // Gets the creation time of the given file or directory. diff --git a/chrome/browser/importer/importer.h b/chrome/browser/importer/importer.h index 37be870..494cf1c 100644 --- a/chrome/browser/importer/importer.h +++ b/chrome/browser/importer/importer.h @@ -73,7 +73,7 @@ class ProfileWriter : public base::RefCounted<ProfileWriter> { GURL url; std::vector<std::wstring> path; std::wstring title; - Time creation_time; + base::Time creation_time; BookmarkEntry() : in_toolbar(false) {} }; diff --git a/chrome/browser/importer/mork_reader.cc b/chrome/browser/importer/mork_reader.cc index 3ae4b6c..4a9c1b2 100644 --- a/chrome/browser/importer/mork_reader.cc +++ b/chrome/browser/importer/mork_reader.cc @@ -49,6 +49,8 @@ #include "chrome/browser/history/history_types.h" #include "chrome/browser/importer/firefox_importer_utils.h" +using base::Time; + namespace { // Convert a hex character (0-9, A-F) to its corresponding byte value. diff --git a/chrome/browser/ipc_status_view.cc b/chrome/browser/ipc_status_view.cc index 953f6b7..4e0e2a5 100644 --- a/chrome/browser/ipc_status_view.cc +++ b/chrome/browser/ipc_status_view.cc @@ -18,6 +18,8 @@ #ifdef IPC_MESSAGE_LOG_ENABLED +using base::Time; + namespace { const wchar_t kTitleMsg[] = L"IPC Messages"; diff --git a/chrome/browser/jankometer.cc b/chrome/browser/jankometer.cc index 495b849..d67f51c 100644 --- a/chrome/browser/jankometer.cc +++ b/chrome/browser/jankometer.cc @@ -18,6 +18,9 @@ #include "chrome/browser/browser_process.h" #include "chrome/common/chrome_switches.h" +using base::TimeDelta; +using base::TimeTicks; + namespace { // The maximum threshold of delay of the message before considering it a delay. diff --git a/chrome/browser/load_notification_details.h b/chrome/browser/load_notification_details.h index bb87436..6524399 100644 --- a/chrome/browser/load_notification_details.h +++ b/chrome/browser/load_notification_details.h @@ -19,7 +19,7 @@ class LoadNotificationDetails { public: LoadNotificationDetails(const GURL& url, PageTransition::Type origin, - TimeDelta load_time, + base::TimeDelta load_time, NavigationController* controller, int session_index) : url_(url), @@ -32,13 +32,13 @@ class LoadNotificationDetails { const GURL& url() const { return url_; } PageTransition::Type origin() const { return origin_; } - TimeDelta load_time() const { return load_time_; } + base::TimeDelta load_time() const { return load_time_; } int session_index() const { return session_index_; } NavigationController* controller() const { return controller_; } private: GURL url_; // the URL loaded - TimeDelta load_time_; // length of time the page load took + base::TimeDelta load_time_; // length of time the page load took int session_index_; // index of the load within the tab session PageTransition::Type origin_; // type of action that caused the load NavigationController* controller_; // tells us which tab the load was in diff --git a/chrome/browser/metrics_log.cc b/chrome/browser/metrics_log.cc index a68ca2c5..908db3e 100644 --- a/chrome/browser/metrics_log.cc +++ b/chrome/browser/metrics_log.cc @@ -20,6 +20,9 @@ #define OPEN_ELEMENT_FOR_SCOPE(name) ScopedElement scoped_element(this, name) +using base::Time; +using base::TimeDelta; + // libxml take xmlChar*, which is unsigned char* inline const unsigned char* UnsignedChar(const char* input) { return reinterpret_cast<const unsigned char*>(input); @@ -642,4 +645,3 @@ void MetricsLog::RecordHistogramDelta(const Histogram& histogram, } } } - diff --git a/chrome/browser/metrics_log.h b/chrome/browser/metrics_log.h index 657c8d7..1be1d9f 100644 --- a/chrome/browser/metrics_log.h +++ b/chrome/browser/metrics_log.h @@ -57,7 +57,7 @@ class MetricsLog { const GURL& url, PageTransition::Type origin, int session_index, - TimeDelta load_time); + base::TimeDelta load_time); // Records the current operating environment. Takes the list of installed // plugins as a parameter because that can't be obtained synchronously @@ -162,8 +162,8 @@ class MetricsLog { void WriteProfileMetrics(const std::wstring& key, const DictionaryValue& profile_metrics); - Time start_time_; - Time end_time_; + base::Time start_time_; + base::Time end_time_; std::string client_id_; std::string session_id_; diff --git a/chrome/browser/metrics_log_unittest.cc b/chrome/browser/metrics_log_unittest.cc index 489ebda..65bcdab 100644 --- a/chrome/browser/metrics_log_unittest.cc +++ b/chrome/browser/metrics_log_unittest.cc @@ -10,6 +10,8 @@ #include "googleurl/src/gurl.h" #include "testing/gtest/include/gtest/gtest.h" +using base::TimeDelta; + namespace { class MetricsLogTest : public testing::Test { }; diff --git a/chrome/browser/metrics_service.cc b/chrome/browser/metrics_service.cc index cefe611..dd9ca9b 100644 --- a/chrome/browser/metrics_service.cc +++ b/chrome/browser/metrics_service.cc @@ -183,6 +183,9 @@ #include "net/base/load_flags.h" #include "third_party/bzip2/bzlib.h" +using base::Time; +using base::TimeDelta; + // Check to see that we're being called on only one thread. static bool IsSingleThreaded(); diff --git a/chrome/browser/metrics_service.h b/chrome/browser/metrics_service.h index 5eec5e7..fe8ce9b 100644 --- a/chrome/browser/metrics_service.h +++ b/chrome/browser/metrics_service.h @@ -439,7 +439,7 @@ class MetricsService : public NotificationObserver, // outbound network link). This is usually also the duration for which we // build up a log, but if other unsent-logs from previous sessions exist, we // quickly transmit those unsent logs while we continue to build a log. - TimeDelta interlog_duration_; + base::TimeDelta interlog_duration_; // The maximum number of events which get transmitted in a log. This defaults // to a constant and otherwise is provided by the UMA server in the server diff --git a/chrome/browser/navigation_controller_unittest.cc b/chrome/browser/navigation_controller_unittest.cc index d5d2654..5be123e 100644 --- a/chrome/browser/navigation_controller_unittest.cc +++ b/chrome/browser/navigation_controller_unittest.cc @@ -24,6 +24,8 @@ #include "net/base/net_util.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; + namespace { // NavigationControllerTest ---------------------------------------------------- diff --git a/chrome/browser/net/dns_global.cc b/chrome/browser/net/dns_global.cc index a38819e..52bddb2a 100644 --- a/chrome/browser/net/dns_global.cc +++ b/chrome/browser/net/dns_global.cc @@ -21,6 +21,8 @@ #include "googleurl/src/gurl.h" #include "net/base/dns_resolution_observer.h" +using base::TimeDelta; + namespace chrome_browser_net { static void DiscardAllPrefetchState(); diff --git a/chrome/browser/net/dns_host_info.cc b/chrome/browser/net/dns_host_info.cc index 39dce74..777f72d 100644 --- a/chrome/browser/net/dns_host_info.cc +++ b/chrome/browser/net/dns_host_info.cc @@ -15,6 +15,10 @@ #include "base/logging.h" #include "base/string_util.h" +using base::Time; +using base::TimeDelta; +using base::TimeTicks; + namespace chrome_browser_net { static bool detailed_logging_enabled = false; diff --git a/chrome/browser/net/dns_host_info.h b/chrome/browser/net/dns_host_info.h index ee446e1..2f2a51c 100644 --- a/chrome/browser/net/dns_host_info.h +++ b/chrome/browser/net/dns_host_info.h @@ -44,14 +44,14 @@ class DnsHostInfo { STARTED, // Resolution has begun. FINISHED, // Resolution has completed. FINISHED_UNRESOLVED}; // No resolution found. - static const TimeDelta kMaxNonNetworkDnsLookupDuration; + static const base::TimeDelta kMaxNonNetworkDnsLookupDuration; // The number of OS cache entries we can guarantee(?) before cache eviction // might likely take place. static const int kMaxGuaranteedCacheSize = 50; typedef std::vector<DnsHostInfo> DnsInfoTable; - static const TimeDelta kNullDuration; + static const base::TimeDelta kNullDuration; // DnsHostInfo are usually made by the default constructor during // initializing of the DnsMaster's map (of info for Hostnames). @@ -71,7 +71,7 @@ class DnsHostInfo { // on how recently we've done DNS prefetching for hostname. bool NeedsDnsUpdate(const std::string& hostname); - static void set_cache_expiration(TimeDelta time); + static void set_cache_expiration(base::TimeDelta time); // The prefetching lifecycle. void SetQueuedState(); @@ -102,9 +102,9 @@ class DnsHostInfo { return (hostname == hostname_); } - TimeDelta resolve_duration() const { return resolve_duration_;} - TimeDelta queue_duration() const { return queue_duration_;} - TimeDelta benefits_remaining() const { return benefits_remaining_; } + base::TimeDelta resolve_duration() const { return resolve_duration_;} + base::TimeDelta queue_duration() const { return queue_duration_;} + base::TimeDelta benefits_remaining() const { return benefits_remaining_; } DnsBenefit AcruePrefetchBenefits(DnsHostInfo* later_host_info); @@ -117,22 +117,26 @@ class DnsHostInfo { private: // The next declaration is non-const to facilitate testing. - static TimeDelta kCacheExpirationDuration; + static base::TimeDelta kCacheExpirationDuration; DnsProcessingState state_; std::string hostname_; // Hostname for this info. - TimeTicks time_; // When was last state changed (usually lookup completed). - TimeDelta resolve_duration_; // Time needed for DNS to resolve. - TimeDelta queue_duration_; // Time spent in queue. - TimeDelta benefits_remaining_; // Unused potential benefits of a prefetch. + // When was last state changed (usually lookup completed). + base::TimeTicks time_; + // Time needed for DNS to resolve. + base::TimeDelta resolve_duration_; + // Time spent in queue. + base::TimeDelta queue_duration_; + // Unused potential benefits of a prefetch. + base::TimeDelta benefits_remaining_; int sequence_number_; // Used to calculate potential of cache eviction. static int sequence_counter; // Used to allocate sequence_number_'s. - TimeDelta GetDuration() { - TimeTicks old_time = time_; - time_ = TimeTicks::Now(); + base::TimeDelta GetDuration() { + base::TimeTicks old_time = time_; + time_ = base::TimeTicks::Now(); return time_ - old_time; } @@ -147,4 +151,3 @@ class DnsHostInfo { } // namespace chrome_browser_net #endif // CHROME_BROWSER_NET_DNS_HOST_INFO_H_ - diff --git a/chrome/browser/net/dns_host_info_unittest.cc b/chrome/browser/net/dns_host_info_unittest.cc index 3ab5db7..bc04336 100644 --- a/chrome/browser/net/dns_host_info_unittest.cc +++ b/chrome/browser/net/dns_host_info_unittest.cc @@ -11,6 +11,8 @@ #include "chrome/browser/net/dns_host_info.h" #include "testing/gtest/include/gtest/gtest.h" +using base::TimeDelta; + namespace { class DnsHostInfoTest : public testing::Test { diff --git a/chrome/browser/net/dns_master.cc b/chrome/browser/net/dns_master.cc index 2030cd4..0ea83ec 100644 --- a/chrome/browser/net/dns_master.cc +++ b/chrome/browser/net/dns_master.cc @@ -14,6 +14,8 @@ #include "base/win_util.h" #include "chrome/browser/net/dns_slave.h" +using base::TimeDelta; + namespace chrome_browser_net { //------------------------------------------------------------------------------ diff --git a/chrome/browser/net/dns_master.h b/chrome/browser/net/dns_master.h index d74773585..1da6b4f 100644 --- a/chrome/browser/net/dns_master.h +++ b/chrome/browser/net/dns_master.h @@ -39,7 +39,7 @@ class DnsMaster { // The number of slave processes that will do DNS prefetching static const int kSlaveCountMax = 8; - explicit DnsMaster(TimeDelta shutdown_wait_time); + explicit DnsMaster(base::TimeDelta shutdown_wait_time); ~DnsMaster() { if (!shutdown_) @@ -82,14 +82,14 @@ class DnsMaster { // Accessor methods, used mostly for testing. // Both functions return DnsHostInfo::kNullDuration if name was not yet // processed enough. - TimeDelta GetResolutionDuration(const std::string hostname) { + base::TimeDelta GetResolutionDuration(const std::string hostname) { AutoLock auto_lock(lock_); if (results_.find(hostname) == results_.end()) return DnsHostInfo::kNullDuration; return results_[hostname].resolve_duration(); } - TimeDelta GetQueueDuration(const std::string hostname) { + base::TimeDelta GetQueueDuration(const std::string hostname) { AutoLock auto_lock(lock_); if (results_.find(hostname) == results_.end()) return DnsHostInfo::kNullDuration; @@ -157,7 +157,7 @@ class DnsMaster { // The following is the maximum time the ShutdownSlaves method // will wait for all the slave processes to terminate. - const TimeDelta kShutdownWaitTime_; + const base::TimeDelta kShutdownWaitTime_; // A list of successful events resulting from pre-fetching. DnsHostInfo::DnsInfoTable cache_hits_; diff --git a/chrome/browser/net/dns_master_unittest.cc b/chrome/browser/net/dns_master_unittest.cc index 1f95742..c843b36 100644 --- a/chrome/browser/net/dns_master_unittest.cc +++ b/chrome/browser/net/dns_master_unittest.cc @@ -21,6 +21,9 @@ #include "testing/gtest/include/gtest/gtest.h" +using base::Time; +using base::TimeDelta; + namespace { class DnsMasterTest : public testing::Test { diff --git a/chrome/browser/password_form_manager.cc b/chrome/browser/password_form_manager.cc index fa1375e9..099906d 100644 --- a/chrome/browser/password_form_manager.cc +++ b/chrome/browser/password_form_manager.cc @@ -12,6 +12,8 @@ #include "chrome/browser/profile.h" #include "webkit/glue/password_form_dom_manager.h" +using base::Time; + PasswordFormManager::PasswordFormManager(Profile* profile, PasswordManager* password_manager, const PasswordForm& observed_form, diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc index b1e2bdc..a2d07fd 100644 --- a/chrome/browser/printing/print_job.cc +++ b/chrome/browser/printing/print_job.cc @@ -13,6 +13,8 @@ #pragma warning(disable:4355) // 'this' : used in base member initializer list #endif +using base::TimeDelta; + namespace printing { PrintJob::PrintJob(PrintedPagesSource* source) diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc index 1157d64..8df4862 100644 --- a/chrome/browser/printing/print_view_manager.cc +++ b/chrome/browser/printing/print_view_manager.cc @@ -17,6 +17,8 @@ #include "generated_resources.h" +using base::TimeDelta; + namespace printing { PrintViewManager::PrintViewManager(WebContents& owner) diff --git a/chrome/browser/printing/printed_document.cc b/chrome/browser/printing/printed_document.cc index b6a5d8a..4bb9de6 100644 --- a/chrome/browser/printing/printed_document.cc +++ b/chrome/browser/printing/printed_document.cc @@ -21,6 +21,8 @@ #include "chrome/common/notification_service.h" #include "chrome/common/win_util.h" +using base::Time; + namespace printing { PrintedDocument::PrintedDocument(const PrintSettings& settings, diff --git a/chrome/browser/printing/printing_layout_uitest.cc b/chrome/browser/printing/printing_layout_uitest.cc index 7299860..fb0bf6b5 100644 --- a/chrome/browser/printing/printing_layout_uitest.cc +++ b/chrome/browser/printing/printing_layout_uitest.cc @@ -19,6 +19,9 @@ #include "chrome/browser/printing/printing_test.h" #include "net/url_request/url_request_unittest.h" +using base::Time; +using base::TimeDelta; + namespace { const wchar_t* const kGenerateSwitch = L"print-layout-generate"; diff --git a/chrome/browser/printing/win_printing_context.cc b/chrome/browser/printing/win_printing_context.cc index badbaf2..e865b3c 100644 --- a/chrome/browser/printing/win_printing_context.cc +++ b/chrome/browser/printing/win_printing_context.cc @@ -12,6 +12,8 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/printing/print_job_manager.h" +using base::Time; + namespace { // Retrieves the content of a GetPrinter call. diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index ad84daf..6023a2c 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -40,6 +40,9 @@ #include "net/url_request/url_request_context.h" #include "webkit/glue/webkit_glue.h" +using base::Time; +using base::TimeDelta; + // Delay, in milliseconds, before we explicitly create the SessionService. static const int kCreateSessionServiceDelayMS = 500; diff --git a/chrome/browser/profile.h b/chrome/browser/profile.h index 2edc40c..27e5fcf 100644 --- a/chrome/browser/profile.h +++ b/chrome/browser/profile.h @@ -187,7 +187,7 @@ class Profile { // was created, rather it is the time the user started chrome and logged into // this profile. For the single profile case, this corresponds to the time // the user started chrome. - virtual Time GetStartTime() const = 0; + virtual base::Time GetStartTime() const = 0; // Returns the TabRestoreService. This returns NULL when off the record. virtual TabRestoreService* GetTabRestoreService() = 0; @@ -253,7 +253,7 @@ class ProfileImpl : public Profile { virtual bool DidLastSessionExitCleanly(); virtual BookmarkModel* GetBookmarkModel(); virtual bool IsSameProfile(Profile* profile); - virtual Time GetStartTime() const; + virtual base::Time GetStartTime() const; virtual TabRestoreService* GetTabRestoreService(); virtual void ResetTabRestoreService(); virtual void InitializeSpellChecker(); @@ -308,7 +308,7 @@ class ProfileImpl : public Profile { scoped_ptr<OffTheRecordProfileImpl> off_the_record_profile_; // See GetStartTime for details. - Time start_time_; + base::Time start_time_; scoped_ptr<TabRestoreService> tab_restore_service_; diff --git a/chrome/browser/render_view_host.cc b/chrome/browser/render_view_host.cc index 2c9c876..3474aa3 100644 --- a/chrome/browser/render_view_host.cc +++ b/chrome/browser/render_view_host.cc @@ -27,6 +27,8 @@ #include "net/base/net_util.h" #include "skia/include/SkBitmap.h" +using base::TimeDelta; + namespace { void FilterURL(RendererSecurityPolicy* policy, int renderer_id, GURL* url) { diff --git a/chrome/browser/render_widget_helper.cc b/chrome/browser/render_widget_helper.cc index 3f91834..d6e2bd7 100644 --- a/chrome/browser/render_widget_helper.cc +++ b/chrome/browser/render_widget_helper.cc @@ -9,6 +9,9 @@ #include "chrome/browser/render_process_host.h" #include "chrome/browser/resource_dispatcher_host.h" +using base::TimeDelta; +using base::TimeTicks; + // A Task used with InvokeLater that we hold a pointer to in pending_paints_. // Instances are deleted by MessageLoop after it calls their Run method. class RenderWidgetHelper::PaintMsgProxy : public Task { @@ -228,4 +231,3 @@ void RenderWidgetHelper::OnSimulateReceivedMessage( if (host) host->OnMessageReceived(message); } - diff --git a/chrome/browser/render_widget_helper.h b/chrome/browser/render_widget_helper.h index 96de62a..7b6295f 100644 --- a/chrome/browser/render_widget_helper.h +++ b/chrome/browser/render_widget_helper.h @@ -15,9 +15,12 @@ namespace IPC { class Message; } +namespace base { +class TimeDelta; +} + class MessageLoop; class ResourceDispatcherHost; -class TimeDelta; // Instantiated per RenderProcessHost to provide various optimizations on // behalf of a RenderWidgetHost. This class bridges between the IO thread @@ -97,7 +100,7 @@ class RenderWidgetHelper : // Called on the UI thread to wait for the next PaintRect message for the // specified render widget. Returns true if successful, and the msg out- // param will contain a copy of the received PaintRect message. - bool WaitForPaintMsg(int render_widget_id, const TimeDelta& max_delay, + bool WaitForPaintMsg(int render_widget_id, const base::TimeDelta& max_delay, IPC::Message* msg); diff --git a/chrome/browser/render_widget_host.cc b/chrome/browser/render_widget_host.cc index 2966b6c..281d6aa46 100644 --- a/chrome/browser/render_widget_host.cc +++ b/chrome/browser/render_widget_host.cc @@ -16,6 +16,10 @@ #include "webkit/glue/webcursor.h" #include "webkit/glue/webinputevent.h" +using base::Time; +using base::TimeDelta; +using base::TimeTicks; + // How long to (synchronously) wait for the renderer to respond with a // PaintRect message, when our backing-store is invalid, before giving up and // returning a null or incorrectly sized backing-store from GetBackingStore. @@ -834,5 +838,3 @@ void RenderWidgetHost::RendererExited() { void RenderWidgetHost::SystemThemeChanged() { Send(new ViewMsg_ThemeChanged(routing_id_)); } - - diff --git a/chrome/browser/render_widget_host.h b/chrome/browser/render_widget_host.h index a581604..4b1ffcc1 100644 --- a/chrome/browser/render_widget_host.h +++ b/chrome/browser/render_widget_host.h @@ -194,7 +194,7 @@ class RenderWidgetHost : public IPC::Channel::Listener { // Starts a hang monitor timeout. If there's already a hang monitor timeout // the new one will only fire if it has a shorter delay than the time // left on the existing timeouts. - void StartHangMonitorTimeout(TimeDelta delay); + void StartHangMonitorTimeout(base::TimeDelta delay); // Called when we receive a notification indicating that the renderer // process has gone. @@ -282,7 +282,7 @@ class RenderWidgetHost : public IPC::Channel::Listener { RenderWidgetHostView* view_; // The time when an input event was sent to the RenderWidget. - TimeTicks input_event_start_time_; + base::TimeTicks input_event_start_time_; // Indicates whether a page is loading or not. bool is_loading_; @@ -300,7 +300,7 @@ class RenderWidgetHost : public IPC::Channel::Listener { // The following value indicates a time in the future when we would consider // the renderer hung if it does not generate an appropriate response message. - Time time_when_considered_hung_; + base::Time time_when_considered_hung_; // This timer runs to check if time_when_considered_hung_ has past. base::OneShotTimer<RenderWidgetHost> hung_renderer_timer_; @@ -319,7 +319,7 @@ class RenderWidgetHost : public IPC::Channel::Listener { // Used for UMA histogram logging to measure the time for a repaint view // operation to finish. - TimeTicks repaint_start_time_; + base::TimeTicks repaint_start_time_; DISALLOW_EVIL_CONSTRUCTORS(RenderWidgetHost); }; diff --git a/chrome/browser/render_widget_host_view_win.cc b/chrome/browser/render_widget_host_view_win.cc index 6d60b5d..05eb2a2 100644 --- a/chrome/browser/render_widget_host_view_win.cc +++ b/chrome/browser/render_widget_host_view_win.cc @@ -26,6 +26,9 @@ #include "chrome/views/container_win.h" #include "webkit/glue/webcursor.h" +using base::TimeDelta; +using base::TimeTicks; + namespace { // Tooltips will wrap after this width. Yes, wrap. Imagine that! diff --git a/chrome/browser/render_widget_host_view_win.h b/chrome/browser/render_widget_host_view_win.h index c47ca74..348e21c 100644 --- a/chrome/browser/render_widget_host_view_win.h +++ b/chrome/browser/render_widget_host_view_win.h @@ -257,7 +257,7 @@ class RenderWidgetHostViewWin : // The time at which this view started displaying white pixels as a result of // not having anything to paint (empty backing store from renderer). This // value returns true for is_null() if we are not recording whiteout times. - TimeTicks whiteout_start_time_; + base::TimeTicks whiteout_start_time_; // Whether the renderer is made accessible. // TODO(jcampan): http://b/issue?id=1432077 This is a temporary work-around diff --git a/chrome/browser/resource_dispatcher_host.cc b/chrome/browser/resource_dispatcher_host.cc index 85a0fb8..edc9aca 100644 --- a/chrome/browser/resource_dispatcher_host.cc +++ b/chrome/browser/resource_dispatcher_host.cc @@ -50,6 +50,10 @@ # define RESOURCE_LOG(stuff) #endif +using base::Time; +using base::TimeDelta; +using base::TimeTicks; + // ---------------------------------------------------------------------------- // The interval for calls to ResourceDispatcherHost::UpdateLoadStates diff --git a/chrome/browser/resource_dispatcher_host.h b/chrome/browser/resource_dispatcher_host.h index d77454c..3207965 100644 --- a/chrome/browser/resource_dispatcher_host.h +++ b/chrome/browser/resource_dispatcher_host.h @@ -178,7 +178,7 @@ class ResourceDispatcherHost : public URLRequest::Delegate { uint64 last_upload_position; - TimeTicks last_upload_ticks; + base::TimeTicks last_upload_ticks; bool waiting_for_upload_progress_ack; diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc index f531538..fb3c967 100644 --- a/chrome/browser/safe_browsing/protocol_manager.cc +++ b/chrome/browser/safe_browsing/protocol_manager.cc @@ -21,6 +21,8 @@ #include "net/base/base64.h" #include "net/base/load_flags.h" +using base::Time; +using base::TimeDelta; // Maximum time, in seconds, from start up before we must issue an update query. static const int kSbTimerStartIntervalSec = 5 * 60; diff --git a/chrome/browser/safe_browsing/protocol_manager.h b/chrome/browser/safe_browsing/protocol_manager.h index 4cb75c0..ae89319 100644 --- a/chrome/browser/safe_browsing/protocol_manager.h +++ b/chrome/browser/safe_browsing/protocol_manager.h @@ -74,7 +74,7 @@ class SafeBrowsingProtocolManager : public URLFetcher::Delegate { void OnChunkInserted(); // The last time we received an update. - Time last_update() const { return last_update_; } + base::Time last_update() const { return last_update_; } private: // Internal API for fetching information from the SafeBrowsing servers. The @@ -196,10 +196,10 @@ class SafeBrowsingProtocolManager : public URLFetcher::Delegate { std::string wrapped_key_; // The last time we successfully received an update. - Time last_update_; + base::Time last_update_; // While in GetHash backoff, we can't make another GetHash until this time. - Time next_gethash_time_; + base::Time next_gethash_time_; // Current product version sent in each request. std::string version_; diff --git a/chrome/browser/safe_browsing/protocol_manager_unittest.cc b/chrome/browser/safe_browsing/protocol_manager_unittest.cc index 3a81c91..25af2b3 100644 --- a/chrome/browser/safe_browsing/protocol_manager_unittest.cc +++ b/chrome/browser/safe_browsing/protocol_manager_unittest.cc @@ -8,6 +8,9 @@ #include "testing/gtest/include/gtest/gtest.h" #include "chrome/browser/safe_browsing/protocol_manager.h" +using base::Time; +using base::TimeDelta; + class SafeBrowsingProtocolManagerTest : public testing::Test { }; diff --git a/chrome/browser/safe_browsing/safe_browsing_database.cc b/chrome/browser/safe_browsing/safe_browsing_database.cc index 2f43f6b..92961c3 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database.cc @@ -13,6 +13,8 @@ #include "chrome/common/chrome_switches.h" #include "googleurl/src/gurl.h" +using base::Time; + // Filename suffix for the bloom filter. static const wchar_t kBloomFilterFile[] = L" Filter"; @@ -98,4 +100,3 @@ void SafeBrowsingDatabase::WriteBloomFilter() { SB_DLOG(INFO) << "SafeBrowsingDatabase wrote bloom filter in " << (Time::Now() - before).InMilliseconds() << " ms"; } - diff --git a/chrome/browser/safe_browsing/safe_browsing_database.h b/chrome/browser/safe_browsing/safe_browsing_database.h index 94b9b76..f4c692a 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database.h +++ b/chrome/browser/safe_browsing/safe_browsing_database.h @@ -52,7 +52,7 @@ class SafeBrowsingDatabase { std::string* matching_list, std::vector<SBPrefix>* prefix_hits, std::vector<SBFullHashResult>* full_hits, - Time last_update) = 0; + base::Time last_update) = 0; // Processes add/sub commands. Database will free the chunks when it's done. virtual void InsertChunks(const std::string& list_name, diff --git a/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc b/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc index 9b15082..d04826d 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database_bloom.cc @@ -17,6 +17,9 @@ #include "chrome/common/sqlite_utils.h" #include "googleurl/src/gurl.h" +using base::Time; +using base::TimeDelta; + // Database version. If this is different than what's stored on disk, the // database is reset. static const int kDatabaseVersion = 6; diff --git a/chrome/browser/safe_browsing/safe_browsing_database_bloom.h b/chrome/browser/safe_browsing/safe_browsing_database_bloom.h index f639943..8f5fbe1 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_bloom.h +++ b/chrome/browser/safe_browsing/safe_browsing_database_bloom.h @@ -44,7 +44,7 @@ class SafeBrowsingDatabaseBloom : public SafeBrowsingDatabase { std::string* matching_list, std::vector<SBPrefix>* prefix_hits, std::vector<SBFullHashResult>* full_hits, - Time last_update); + base::Time last_update); // Processes add/sub commands. Database will free the chunks when it's done. virtual void InsertChunks(const std::string& list_name, @@ -147,7 +147,7 @@ class SafeBrowsingDatabaseBloom : public SafeBrowsingDatabase { // Looks up any cached full hashes we may have. void GetCachedFullHashes(const std::vector<SBPrefix>* prefix_hits, std::vector<SBFullHashResult>* full_hits, - Time last_update); + base::Time last_update); // Remove cached entries that have prefixes contained in the entry. void ClearCachedHashes(const SBEntry* entry); @@ -238,7 +238,7 @@ class SafeBrowsingDatabaseBloom : public SafeBrowsingDatabase { SBFullHash full_hash; int list_id; int add_chunk_id; - Time received; + base::Time received; } HashCacheEntry; typedef std::list<HashCacheEntry> HashList; diff --git a/chrome/browser/safe_browsing/safe_browsing_database_impl.cc b/chrome/browser/safe_browsing/safe_browsing_database_impl.cc index 5d1c758..db25ec7 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_impl.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database_impl.cc @@ -17,6 +17,9 @@ #include "chrome/common/sqlite_utils.h" #include "googleurl/src/gurl.h" +using base::Time; +using base::TimeDelta; + // Database version. If this is different than what's stored on disk, the // database is reset. static const int kDatabaseVersion = 4; diff --git a/chrome/browser/safe_browsing/safe_browsing_database_impl.h b/chrome/browser/safe_browsing/safe_browsing_database_impl.h index 67f44ea..4c46b75 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_impl.h +++ b/chrome/browser/safe_browsing/safe_browsing_database_impl.h @@ -46,7 +46,7 @@ class SafeBrowsingDatabaseImpl : public SafeBrowsingDatabase { std::string* matching_list, std::vector<SBPrefix>* prefix_hits, std::vector<SBFullHashResult>* full_hits, - Time last_update); + base::Time last_update); // Processes add/sub commands. Database will free the chunks when it's done. virtual void InsertChunks(const std::string& list_name, @@ -185,7 +185,7 @@ class SafeBrowsingDatabaseImpl : public SafeBrowsingDatabase { // Looks up any cached full hashes we may have. void GetCachedFullHashes(const std::vector<SBPrefix>* prefix_hits, std::vector<SBFullHashResult>* full_hits, - Time last_update); + base::Time last_update); // Remove cached entries that have prefixes contained in the entry. void ClearCachedHashes(const SBEntry* entry); @@ -225,7 +225,7 @@ class SafeBrowsingDatabaseImpl : public SafeBrowsingDatabase { // These are temp variables used when rebuilding the bloom filter. bool bloom_filter_building_; std::vector<int> bloom_filter_temp_hostkeys_; - Time bloom_filter_rebuild_time_; + base::Time bloom_filter_rebuild_time_; // Used to store throttled work for commands that write to the database. std::queue<std::deque<SBChunk>*> pending_chunks_; @@ -264,7 +264,7 @@ class SafeBrowsingDatabaseImpl : public SafeBrowsingDatabase { SBFullHash full_hash; int list_id; int add_chunk_id; - Time received; + base::Time received; } HashCacheEntry; typedef std::list<HashCacheEntry> HashList; diff --git a/chrome/browser/safe_browsing/safe_browsing_database_impl_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_database_impl_unittest.cc index 3afcedc..614fa1b 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_impl_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database_impl_unittest.cc @@ -18,6 +18,9 @@ #include "googleurl/src/gurl.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; +using base::TimeDelta; + namespace { SBPrefix Sha256Prefix(const std::string& str) { SBPrefix hash; diff --git a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc index 2c37c14..43249a5 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc @@ -17,6 +17,8 @@ #include "googleurl/src/gurl.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; + static const wchar_t kSafeBrowsingTestDatabase[] = L"SafeBrowsingTestDatabase"; namespace { diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc index 9f6419c..1382a5f 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service.cc @@ -23,6 +23,9 @@ #include "chrome/common/pref_service.h" #include "net/base/registry_controlled_domain.h" +using base::Time; +using base::TimeDelta; + SafeBrowsingService::SafeBrowsingService() : io_loop_(NULL), database_(NULL), diff --git a/chrome/browser/safe_browsing/safe_browsing_service.h b/chrome/browser/safe_browsing/safe_browsing_service.h index dd2c818..8a87726 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.h +++ b/chrome/browser/safe_browsing/safe_browsing_service.h @@ -119,8 +119,8 @@ class SafeBrowsingService GURL url; Client* client; bool need_get_hash; - Time start; // Time that check was sent to SB service. - TimeDelta db_time; // How long DB look-up took. + base::Time start; // Time that check was sent to SB service. + base::TimeDelta db_time; // How long DB look-up took. UrlCheckResult result; std::vector<SBPrefix> prefix_hits; std::vector<SBFullHashResult> full_hits; @@ -165,7 +165,7 @@ class SafeBrowsingService // delta starting from when we would have started reading data from the // network, and ending when the SafeBrowsing check completes indicating that // the current page is 'safe'. - static void LogPauseDelay(TimeDelta time); + static void LogPauseDelay(base::TimeDelta time); // We defer SafeBrowsing work for a short duration when the computer comes // out of a suspend state to avoid thrashing the disk. @@ -178,7 +178,7 @@ class SafeBrowsingService SafeBrowsingDatabase* GetDatabase(); // Called on the database thread to check a url. - void CheckDatabase(SafeBrowsingCheck* info, Time last_update); + void CheckDatabase(SafeBrowsingCheck* info, base::Time last_update); // Called on the IO thread with the check result. void OnCheckDone(SafeBrowsingCheck* info); @@ -287,7 +287,7 @@ class SafeBrowsingService typedef struct { Client* client; GURL url; - Time start; + base::Time start; } QueuedCheck; std::deque<QueuedCheck> queued_checks_; diff --git a/chrome/browser/session_backend.cc b/chrome/browser/session_backend.cc index fd9086a..0f1f863 100644 --- a/chrome/browser/session_backend.cc +++ b/chrome/browser/session_backend.cc @@ -11,6 +11,8 @@ #include "base/pickle.h" #include "chrome/common/scoped_vector.h" +using base::TimeTicks; + // File version number. static const int32 kFileCurrentVersion = 1; @@ -375,4 +377,3 @@ std::wstring SessionBackend::GetCurrentSessionPath() { file_util::AppendToPath(&path, kCurrentSessionFileName); return path; } - diff --git a/chrome/browser/session_service.cc b/chrome/browser/session_service.cc index 6b44952..25e0174 100644 --- a/chrome/browser/session_service.cc +++ b/chrome/browser/session_service.cc @@ -24,6 +24,8 @@ #include "chrome/common/scoped_vector.h" #include "chrome/common/win_util.h" +using base::Time; + // Identifier for commands written to file. static const SessionCommand::id_type kCommandSetTabWindow = 0; // kCommandSetWindowBounds is no longer used (it's superseded by diff --git a/chrome/browser/session_service_test_helper.cc b/chrome/browser/session_service_test_helper.cc index 49cedd8..384e30c 100644 --- a/chrome/browser/session_service_test_helper.cc +++ b/chrome/browser/session_service_test_helper.cc @@ -9,6 +9,8 @@ #include "chrome/common/scoped_vector.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; + void SessionServiceTestHelper::RestoreSessionFromCommands( const std::vector<SessionCommand*>& commands, std::vector<SessionWindow*>* valid_windows) { diff --git a/chrome/browser/spellchecker.cc b/chrome/browser/spellchecker.cc index e6cfc75..df0c900 100644 --- a/chrome/browser/spellchecker.cc +++ b/chrome/browser/spellchecker.cc @@ -30,6 +30,8 @@ #include "generated_resources.h" +using base::TimeTicks; + static const int kMaxSuggestions = 5; // Max number of dictionary suggestions. // This is a helper class which acts as a proxy for invoking a task from the diff --git a/chrome/browser/tab_restore_service.cc b/chrome/browser/tab_restore_service.cc index 9b3bd4a..324273b 100644 --- a/chrome/browser/tab_restore_service.cc +++ b/chrome/browser/tab_restore_service.cc @@ -8,6 +8,8 @@ #include "chrome/browser/navigation_controller.h" #include "chrome/browser/navigation_entry.h" +using base::Time; + // HistoricalTab -------------------------------------------------------------- // ID of the next HistoricalTab. @@ -179,4 +181,3 @@ void TabRestoreService::PopulateTabFromSessionTab( void TabRestoreService::NotifyTabsChanged() { FOR_EACH_OBSERVER(Observer, observer_list_, TabRestoreServiceChanged(this)); } - diff --git a/chrome/browser/tab_restore_service.h b/chrome/browser/tab_restore_service.h index a83a9d9..66157f4 100644 --- a/chrome/browser/tab_restore_service.h +++ b/chrome/browser/tab_restore_service.h @@ -48,7 +48,7 @@ class TabRestoreService { HistoricalTab(); // Time the tab was closed. - Time close_time; + base::Time close_time; // If true, this is a historical session and not a closed tab. bool from_last_session; diff --git a/chrome/browser/template_url.h b/chrome/browser/template_url.h index bbb752e..7be7d0b 100644 --- a/chrome/browser/template_url.h +++ b/chrome/browser/template_url.h @@ -255,7 +255,7 @@ class TemplateURL { show_in_default_list_(false), safe_for_autoreplace_(false), id_(0), - date_created_(Time::Now()), + date_created_(base::Time::Now()), usage_count_(0), prepopulate_id_(0) {} ~TemplateURL() {} @@ -368,8 +368,8 @@ class TemplateURL { // // NOTE: this may be 0, which indicates the keyword was created before we // started tracking creation time. - void set_date_created(Time time) { date_created_ = time; } - Time date_created() const { return date_created_; } + void set_date_created(base::Time time) { date_created_ = time; } + base::Time date_created() const { return date_created_; } // Number of times this keyword has been explicitly used to load a URL. We // don't increment this for uses as the "default search engine" since that's @@ -425,7 +425,7 @@ class TemplateURL { // List of supported input encodings. std::vector<std::string> input_encodings_; IDType id_; - Time date_created_; + base::Time date_created_; int usage_count_; int prepopulate_id_; diff --git a/chrome/browser/template_url_model.cc b/chrome/browser/template_url_model.cc index ca0cedf..587f982 100644 --- a/chrome/browser/template_url_model.cc +++ b/chrome/browser/template_url_model.cc @@ -26,6 +26,8 @@ #include "unicode/rbbi.h" #include "unicode/uchar.h" +using base::Time; + // String in the URL that is replaced by the search term. static const wchar_t kSearchTermParameter[] = L"{searchTerms}"; @@ -973,4 +975,3 @@ void TemplateURLModel::GoogleBaseURLChanged() { OnTemplateURLModelChanged()); } } - diff --git a/chrome/browser/template_url_model.h b/chrome/browser/template_url_model.h index 8fd65a7..6b9569b 100644 --- a/chrome/browser/template_url_model.h +++ b/chrome/browser/template_url_model.h @@ -123,7 +123,7 @@ class TemplateURLModel : public WebDataServiceConsumer, // Removes all auto-generated keywords that were created in the specified // range. - void RemoveAutoGeneratedBetween(Time created_after, Time created_before); + void RemoveAutoGeneratedBetween(base::Time created_after, base::Time created_before); // Replaces existing_turl with new_turl. new_turl is given the same ID as // existing_turl. If existing_turl was the default, new_turl is made the @@ -134,7 +134,7 @@ class TemplateURLModel : public WebDataServiceConsumer, // Removes all auto-generated keywords that were created on or after the // date passed in. - void RemoveAutoGeneratedSince(Time created_after); + void RemoveAutoGeneratedSince(base::Time created_after); // Returns the set of URLs describing the keywords. The elements are owned // by TemplateURLModel and should not be deleted. diff --git a/chrome/browser/template_url_model_unittest.cc b/chrome/browser/template_url_model_unittest.cc index b81e892..3c17ff2 100644 --- a/chrome/browser/template_url_model_unittest.cc +++ b/chrome/browser/template_url_model_unittest.cc @@ -15,6 +15,9 @@ #include "googleurl/src/gurl.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; +using base::TimeDelta; + // A Task used to coordinate when the database has finished processing // requests. See note in BlockTillServiceProcessesRequests for details. // @@ -630,4 +633,3 @@ TEST_F(TemplateURLModelTest, ChangeGoogleBaseValue) { EXPECT_EQ(L"http://foo.com/?q=x", t_url->url()->ReplaceSearchTerms(*t_url, L"x", TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, std::wstring())); } - diff --git a/chrome/browser/template_url_prepopulate_data.cc b/chrome/browser/template_url_prepopulate_data.cc index fd9f739..8ddf818 100644 --- a/chrome/browser/template_url_prepopulate_data.cc +++ b/chrome/browser/template_url_prepopulate_data.cc @@ -11,6 +11,8 @@ #include "chrome/common/pref_service.h" #undef IN // On Windows, windef.h defines this, which screws up "India" cases. +using base::Time; + namespace { // NOTE: See comments in GetDataVersion() below! You should probably not change diff --git a/chrome/browser/url_fetcher_protect.cc b/chrome/browser/url_fetcher_protect.cc index 297a9bb..b19be608 100644 --- a/chrome/browser/url_fetcher_protect.cc +++ b/chrome/browser/url_fetcher_protect.cc @@ -6,6 +6,8 @@ // URLFetcherProtectEntry ---------------------------------------------------- +using base::TimeDelta; +using base::TimeTicks; // Default parameters. Time is in milliseconds. // static @@ -169,4 +171,3 @@ URLFetcherProtectEntry* URLFetcherProtectManager::Register( services_[id] = entry; return entry; } - diff --git a/chrome/browser/url_fetcher_protect.h b/chrome/browser/url_fetcher_protect.h index 6e4080d..794418b 100644 --- a/chrome/browser/url_fetcher_protect.h +++ b/chrome/browser/url_fetcher_protect.h @@ -64,13 +64,13 @@ class URLFetcherProtectEntry { private: // When a request comes, calculate the release time for it. // Returns the backoff time before sending. - TimeDelta AntiOverload(); + base::TimeDelta AntiOverload(); // Resets backoff when service is ok. // Returns the backoff time before sending. - TimeDelta ResetBackoff(); + base::TimeDelta ResetBackoff(); // Calculates new backoff when encountering a failure. // Returns the backoff time before sending. - TimeDelta IncreaseBackoff(); + base::TimeDelta IncreaseBackoff(); // Default parameters. Time is in milliseconds. static const int kDefaultSlidingWindowPeriod; @@ -101,14 +101,14 @@ class URLFetcherProtectEntry { // current exponential backoff period int timeout_period_; // time that protection is scheduled to end - TimeTicks release_time_; + base::TimeTicks release_time_; // Sets up a lock to ensure thread safe. Lock lock_; // A list of the recent send events. We ues them to decide whether // there are too many requests sent in sliding window. - std::queue<TimeTicks> send_log_; + std::queue<base::TimeTicks> send_log_; DISALLOW_COPY_AND_ASSIGN(URLFetcherProtectEntry); }; diff --git a/chrome/browser/url_fetcher_unittest.cc b/chrome/browser/url_fetcher_unittest.cc index 2ae69aa..e8f7417 100644 --- a/chrome/browser/url_fetcher_unittest.cc +++ b/chrome/browser/url_fetcher_unittest.cc @@ -9,6 +9,9 @@ #include "net/url_request/url_request_unittest.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; +using base::TimeDelta; + namespace { const wchar_t kDocRoot[] = L"chrome/test/data"; diff --git a/chrome/browser/views/bookmark_editor_view.cc b/chrome/browser/views/bookmark_editor_view.cc index 0aefa26..8eb7979 100644 --- a/chrome/browser/views/bookmark_editor_view.cc +++ b/chrome/browser/views/bookmark_editor_view.cc @@ -23,6 +23,7 @@ #include "chromium_strings.h" #include "generated_resources.h" +using base::Time; using views::ColumnSet; using views::GridLayout; using views::Label; diff --git a/chrome/browser/views/bookmark_editor_view_unittest.cc b/chrome/browser/views/bookmark_editor_view_unittest.cc index 767d501..0a5ed68 100644 --- a/chrome/browser/views/bookmark_editor_view_unittest.cc +++ b/chrome/browser/views/bookmark_editor_view_unittest.cc @@ -11,6 +11,9 @@ #include "chrome/test/testing_profile.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; +using base::TimeDelta; + // Base class for bookmark editor tests. Creates a BookmarkModel and populates // it with test data. class BookmarkEditorViewTest : public testing::Test { diff --git a/chrome/browser/views/clear_browsing_data.cc b/chrome/browser/views/clear_browsing_data.cc index c4c88f4..4a948f8 100644 --- a/chrome/browser/views/clear_browsing_data.cc +++ b/chrome/browser/views/clear_browsing_data.cc @@ -21,6 +21,9 @@ #include "generated_resources.h" +using base::Time; +using base::TimeDelta; + // The combo box is vertically aligned to the 'time-period' label, which makes // the combo box look a little too close to the check box above it when we use // standard layout to separate them. We therefore add a little extra margin to @@ -420,4 +423,3 @@ void ClearBrowsingDataView::OnBrowsingDataRemoverDone() { remover_ = NULL; window()->Close(); } - diff --git a/chrome/browser/views/constrained_window_impl.cc b/chrome/browser/views/constrained_window_impl.cc index d74ac05..bdd6d0f 100644 --- a/chrome/browser/views/constrained_window_impl.cc +++ b/chrome/browser/views/constrained_window_impl.cc @@ -38,6 +38,8 @@ #include "chromium_strings.h" #include "generated_resources.h" +using base::TimeDelta; + namespace views { class ClientView; } diff --git a/chrome/browser/views/download_item_view.cc b/chrome/browser/views/download_item_view.cc index e42b7e6..bc81238 100644 --- a/chrome/browser/views/download_item_view.cc +++ b/chrome/browser/views/download_item_view.cc @@ -22,6 +22,8 @@ #include "generated_resources.h" +using base::TimeDelta; + // TODO(paulg): These may need to be adjusted when download progress // animation is added, and also possibly to take into account // different screen resolutions. diff --git a/chrome/browser/views/download_tab_view.cc b/chrome/browser/views/download_tab_view.cc index 15b43b6..38ca746 100644 --- a/chrome/browser/views/download_tab_view.cc +++ b/chrome/browser/views/download_tab_view.cc @@ -28,6 +28,9 @@ #include "googleurl/src/gurl.h" #include "generated_resources.h" +using base::Time; +using base::TimeDelta; + // Approximate spacing, in pixels, taken from initial UI mock up screens static const int kVerticalPadding = 5; static const int kHorizontalLinkPadding = 15; @@ -1303,4 +1306,3 @@ void DownloadTabUI::Observe(NotificationType type, break; } } - diff --git a/chrome/browser/views/external_protocol_dialog.h b/chrome/browser/views/external_protocol_dialog.h index 2247765..db23116 100644 --- a/chrome/browser/views/external_protocol_dialog.h +++ b/chrome/browser/views/external_protocol_dialog.h @@ -66,4 +66,3 @@ class ExternalProtocolDialog : public views::DialogDelegate { }; #endif // CHROME_BROWSER_EXTERNAL_PROTOCOL_DIALOG_H__ - diff --git a/chrome/browser/views/page_info_window.cc b/chrome/browser/views/page_info_window.cc index dce5640..d724132 100644 --- a/chrome/browser/views/page_info_window.cc +++ b/chrome/browser/views/page_info_window.cc @@ -33,6 +33,8 @@ #include "skia/include/SkColor.h" #include "generated_resources.h" +using base::Time; + const int kVerticalPadding = 10; const int kHorizontalPadding = 10; diff --git a/chrome/browser/views/shelf_item_dialog.cc b/chrome/browser/views/shelf_item_dialog.cc index bb3a056..5ea98a3 100644 --- a/chrome/browser/views/shelf_item_dialog.cc +++ b/chrome/browser/views/shelf_item_dialog.cc @@ -26,6 +26,8 @@ #include "generated_resources.h" #include "net/base/net_util.h" +using base::Time; +using base::TimeDelta; using views::ColumnSet; using views::GridLayout; diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc index 72f7d28..a1e1e41 100644 --- a/chrome/browser/views/tabs/tab_strip.cc +++ b/chrome/browser/views/tabs/tab_strip.cc @@ -32,6 +32,7 @@ #undef min #undef max +using base::TimeDelta; using views::DropTargetEvent; static const int kDefaultAnimationDurationMs = 100; diff --git a/chrome/browser/views/toolbar_star_toggle.cc b/chrome/browser/views/toolbar_star_toggle.cc index a44ebac..fe72283 100644 --- a/chrome/browser/views/toolbar_star_toggle.cc +++ b/chrome/browser/views/toolbar_star_toggle.cc @@ -12,6 +12,8 @@ #include "chrome/common/resource_bundle.h" #include "googleurl/src/gurl.h" +using base::TimeTicks; + // The amount of time (in milliseconds) between when the bubble closes and when // pressing on the button again does something. Yes, this is a hackish. I tried // many different options, all to no avail: @@ -88,4 +90,3 @@ void ToolbarStarToggle::InfoBubbleClosing(InfoBubble* info_bubble) { bool ToolbarStarToggle::CloseOnEscape() { return true; } - diff --git a/chrome/browser/views/toolbar_star_toggle.h b/chrome/browser/views/toolbar_star_toggle.h index 5f829cb..9537506 100644 --- a/chrome/browser/views/toolbar_star_toggle.h +++ b/chrome/browser/views/toolbar_star_toggle.h @@ -50,7 +50,7 @@ class ToolbarStarToggle : public views::ToggleButton, BrowserToolbarView* host_; // Time the bubble last closed. - TimeTicks bubble_closed_time_; + base::TimeTicks bubble_closed_time_; // If true NotifyClick does nothing. This is set in OnMousePressed based on // the amount of time between when the bubble clicked and now. diff --git a/chrome/browser/visitedlink_perftest.cc b/chrome/browser/visitedlink_perftest.cc index 4f7dc4a..0f02a5a 100644 --- a/chrome/browser/visitedlink_perftest.cc +++ b/chrome/browser/visitedlink_perftest.cc @@ -14,6 +14,8 @@ #include "chrome/test/test_file_util.h" #include "testing/gtest/include/gtest/gtest.h" +using base::TimeDelta; + namespace { // how we generate URLs, note that the two strings should be the same length diff --git a/chrome/browser/web_contents.cc b/chrome/browser/web_contents.cc index 082852c..1c27a0d 100644 --- a/chrome/browser/web_contents.cc +++ b/chrome/browser/web_contents.cc @@ -86,6 +86,9 @@ // DidNavigate method. This replaces the current RVH with the // pending RVH and goes back to the NORMAL RendererState. +using base::TimeDelta; +using base::TimeTicks; + namespace { // Amount of time we wait between when a key event is received and the renderer diff --git a/chrome/browser/web_contents.h b/chrome/browser/web_contents.h index f73bb97..705d027 100644 --- a/chrome/browser/web_contents.h +++ b/chrome/browser/web_contents.h @@ -490,7 +490,7 @@ class WebContents : public TabContents, HistoryRequestMap history_requests_; // System time at which the current load was started. - TimeTicks current_load_start_; + base::TimeTicks current_load_start_; // Whether we have a (non-empty) title for the current page. // Used to prevent subsequent title updates from affecting history. This @@ -527,7 +527,7 @@ class WebContents : public TabContents, scoped_refptr<SelectFileDialog> select_file_dialog_; // The time that the last javascript message was dismissed. - TimeTicks last_javascript_message_dismissal_; + base::TimeTicks last_javascript_message_dismissal_; // True if the user has decided to block future javascript messages. This is // reset on navigations to false on navigations. @@ -543,7 +543,7 @@ class WebContents : public TabContents, PendingInstall pending_install_; // The last time that the download shelf was made visible. - TimeTicks last_download_shelf_show_; + base::TimeTicks last_download_shelf_show_; // The current load state and the URL associated with it. net::LoadState load_state_; diff --git a/chrome/browser/webdata/web_data_service.cc b/chrome/browser/webdata/web_data_service.cc index 48eebd8..fd0e60a 100644 --- a/chrome/browser/webdata/web_data_service.cc +++ b/chrome/browser/webdata/web_data_service.cc @@ -20,6 +20,8 @@ // //////////////////////////////////////////////////////////////////////////////// +using base::Time; + WebDataService::WebDataService() : should_commit_(false), next_request_handle_(1), thread_(NULL), diff --git a/chrome/browser/webdata/web_data_service.h b/chrome/browser/webdata/web_data_service.h index d7e428d..25a4e27 100644 --- a/chrome/browser/webdata/web_data_service.h +++ b/chrome/browser/webdata/web_data_service.h @@ -314,11 +314,11 @@ class WebDataService : public base::RefCountedThreadSafe<WebDataService> { void RemoveIE7Login(const IE7PasswordInfo& info); // Removes all logins created in the specified daterange - void RemoveLoginsCreatedBetween(const Time delete_begin, - const Time delete_end); + void RemoveLoginsCreatedBetween(const base::Time delete_begin, + const base::Time delete_end); // Removes all logins created on or after the date passed in. - void RemoveLoginsCreatedAfter(const Time delete_begin); + void RemoveLoginsCreatedAfter(const base::Time delete_begin); // Gets a list of password forms that match |form|. // |consumer| will be notified when the request is done. The result is of @@ -407,7 +407,8 @@ class WebDataService : public base::RefCountedThreadSafe<WebDataService> { void UpdateLoginImpl(GenericRequest<PasswordForm>* request); void RemoveLoginImpl(GenericRequest<PasswordForm>* request); void RemoveIE7LoginImpl(GenericRequest<IE7PasswordInfo>* request); - void RemoveLoginsCreatedBetweenImpl(GenericRequest2<Time, Time>* request); + void RemoveLoginsCreatedBetweenImpl( + GenericRequest2<base::Time, base::Time>* request); void GetLoginsImpl(GenericRequest<PasswordForm>* request); void GetIE7LoginImpl(GenericRequest<IE7PasswordInfo>* request); void GetAllAutofillableLoginsImpl(WebDataRequest* request); @@ -481,4 +482,3 @@ class WebDataServiceConsumer { }; #endif // CHROME_BROWSER_WEBDATA_WEB_DATA_SERVICE_H__ - diff --git a/chrome/browser/webdata/web_database.cc b/chrome/browser/webdata/web_database.cc index 04be9fc..5e14723 100644 --- a/chrome/browser/webdata/web_database.cc +++ b/chrome/browser/webdata/web_database.cc @@ -73,6 +73,8 @@ // //////////////////////////////////////////////////////////////////////////////// +using base::Time; + // Current version number. static const int kCurrentVersionNumber = 21; @@ -883,4 +885,3 @@ void WebDatabase::MigrateOldVersionsAsNeeded() { return; } } - diff --git a/chrome/browser/webdata/web_database.h b/chrome/browser/webdata/web_database.h index 176e70f..386bf6c 100644 --- a/chrome/browser/webdata/web_database.h +++ b/chrome/browser/webdata/web_database.h @@ -14,7 +14,7 @@ #include "chrome/common/sqlite_utils.h" #include "skia/include/SkBitmap.h" -class Time; +class base::Time; struct PasswordForm; struct IE7PasswordInfo; @@ -91,8 +91,8 @@ class WebDatabase { // Removes all logins created from |delete_begin| onwards (inclusive) and // before |delete_end|. You may use a null Time value to do an unbounded // delete in either direction. - bool RemoveLoginsCreatedBetween(const Time delete_begin, - const Time delete_end); + bool RemoveLoginsCreatedBetween(const base::Time delete_begin, + const base::Time delete_end); // Loads a list of matching password forms into the specified vector |forms|. // The list will contain all possibly relevant entries to the observed |form|, diff --git a/chrome/browser/webdata/web_database_unittest.cc b/chrome/browser/webdata/web_database_unittest.cc index f6049cb..d4e0cf1 100644 --- a/chrome/browser/webdata/web_database_unittest.cc +++ b/chrome/browser/webdata/web_database_unittest.cc @@ -16,6 +16,9 @@ #include "testing/gtest/include/gtest/gtest.h" #include "webkit/glue/password_form.h" +using base::Time; +using base::TimeDelta; + class WebDatabaseTest : public testing::Test { protected: diff --git a/chrome/common/animation.cc b/chrome/common/animation.cc index d407ccc..bf69812 100644 --- a/chrome/common/animation.cc +++ b/chrome/common/animation.cc @@ -5,6 +5,8 @@ #include "base/message_loop.h" #include "chrome/common/animation.h" +using base::TimeDelta; + Animation::Animation(int frame_rate, AnimationDelegate* delegate) : animating_(false), diff --git a/chrome/common/chrome_plugin_lib.cc b/chrome/common/chrome_plugin_lib.cc index ae8964d..642c623 100644 --- a/chrome/common/chrome_plugin_lib.cc +++ b/chrome/common/chrome_plugin_lib.cc @@ -18,6 +18,8 @@ #include "chrome/common/chrome_paths.h" #include "webkit/glue/plugins/plugin_list.h" +using base::TimeDelta; + const TCHAR ChromePluginLib::kRegistryChromePlugins[] = _T("Software\\Google\\Chrome\\Plugins"); static const TCHAR kRegistryLoadOnStartup[] = _T("LoadOnStartup"); diff --git a/chrome/common/ipc_logging.cc b/chrome/common/ipc_logging.cc index 8199f84..db8bf84 100644 --- a/chrome/common/ipc_logging.cc +++ b/chrome/common/ipc_logging.cc @@ -18,6 +18,8 @@ #ifdef IPC_MESSAGE_LOG_ENABLED +using base::Time; + // IPC::Logging is allocated as a singleton, so we don't need any kind of // special retention program. template <> @@ -267,4 +269,3 @@ void GenerateLogData(const std::wstring& channel, const Message& message, } #endif // IPC_MESSAGE_LOG_ENABLED - diff --git a/chrome/common/ipc_message_utils.h b/chrome/common/ipc_message_utils.h index d5531e2..23a6f06 100644 --- a/chrome/common/ipc_message_utils.h +++ b/chrome/common/ipc_message_utils.h @@ -238,8 +238,8 @@ struct ParamTraits<wchar_t> { }; template <> -struct ParamTraits<Time> { - typedef Time param_type; +struct ParamTraits<base::Time> { + typedef base::Time param_type; static void Write(Message* m, const param_type& p) { ParamTraits<int64>::Write(m, p.ToInternalValue()); } @@ -247,7 +247,7 @@ struct ParamTraits<Time> { int64 value; if (!ParamTraits<int64>::Read(m, iter, &value)) return false; - *r = Time::FromInternalValue(value); + *r = base::Time::FromInternalValue(value); return true; } static void Log(const param_type& p, std::wstring* l) { @@ -636,16 +636,16 @@ struct ParamTraits<ThumbnailScore> { IPC::ParamTraits<double>::Write(m, p.boring_score); IPC::ParamTraits<bool>::Write(m, p.good_clipping); IPC::ParamTraits<bool>::Write(m, p.at_top); - IPC::ParamTraits<Time>::Write(m, p.time_at_snapshot); + IPC::ParamTraits<base::Time>::Write(m, p.time_at_snapshot); } static bool Read(const Message* m, void** iter, param_type* r) { double boring_score; bool good_clipping, at_top; - Time time_at_snapshot; + base::Time time_at_snapshot; if (!IPC::ParamTraits<double>::Read(m, iter, &boring_score) || !IPC::ParamTraits<bool>::Read(m, iter, &good_clipping) || !IPC::ParamTraits<bool>::Read(m, iter, &at_top) || - !IPC::ParamTraits<Time>::Read(m, iter, &time_at_snapshot)) + !IPC::ParamTraits<base::Time>::Read(m, iter, &time_at_snapshot)) return false; r->boring_score = boring_score; diff --git a/chrome/common/ipc_sync_channel.cc b/chrome/common/ipc_sync_channel.cc index 1f60def..0861790 100644 --- a/chrome/common/ipc_sync_channel.cc +++ b/chrome/common/ipc_sync_channel.cc @@ -13,6 +13,8 @@ #include "chrome/common/ipc_logging.h" #include "chrome/common/ipc_sync_message.h" +using base::TimeDelta; +using base::TimeTicks; namespace IPC { // When we're blocked in a Send(), we need to process incoming synchronous diff --git a/chrome/common/net/cookie_monster_sqlite.cc b/chrome/common/net/cookie_monster_sqlite.cc index 5f0f361..f4026d0 100644 --- a/chrome/common/net/cookie_monster_sqlite.cc +++ b/chrome/common/net/cookie_monster_sqlite.cc @@ -14,6 +14,8 @@ #include "chrome/common/sqlite_compiled_statement.h" #include "chrome/common/sqlite_utils.h" +using base::Time; + // This class is designed to be shared between any calling threads and the // database thread. It batches operations and commits them on a timer. class SQLitePersistentCookieStore::Backend @@ -354,4 +356,3 @@ void SQLitePersistentCookieStore::DeleteCookie( if (backend_.get()) backend_->DeleteCookie(cc); } - diff --git a/chrome/common/net/url_request_intercept_job.cc b/chrome/common/net/url_request_intercept_job.cc index 1b18a68..398f2b0 100644 --- a/chrome/common/net/url_request_intercept_job.cc +++ b/chrome/common/net/url_request_intercept_job.cc @@ -13,6 +13,9 @@ #include "chrome/common/chrome_plugin_lib.h" #include "net/base/net_errors.h" +using base::Time; +using base::TimeDelta; + // // URLRequestInterceptJob // @@ -207,4 +210,3 @@ void URLRequestInterceptJob::Observe(NotificationType type, DetachPlugin(); } - diff --git a/chrome/common/thumbnail_score.cc b/chrome/common/thumbnail_score.cc index 5a7cf90..72c6239 100644 --- a/chrome/common/thumbnail_score.cc +++ b/chrome/common/thumbnail_score.cc @@ -6,6 +6,9 @@ #include "base/logging.h" +using base::Time; +using base::TimeDelta; + const TimeDelta ThumbnailScore::kUpdateThumbnailTime = TimeDelta::FromDays(1); const double ThumbnailScore::kThumbnailMaximumBoringness = 0.94; const double ThumbnailScore::kThumbnailDegradePerHour = 0.01; diff --git a/chrome/common/thumbnail_score.h b/chrome/common/thumbnail_score.h index f6f83a9..6990726 100644 --- a/chrome/common/thumbnail_score.h +++ b/chrome/common/thumbnail_score.h @@ -19,7 +19,7 @@ struct ThumbnailScore { // Builds a ThumbnailScore with the passed in values. ThumbnailScore(double score, bool clipping, bool top, - const Time& time); + const base::Time& time); ~ThumbnailScore(); // Tests for equivalence between two ThumbnailScore objects. @@ -46,7 +46,7 @@ struct ThumbnailScore { // Record the time when a thumbnail was taken. This is used to make // sure thumbnails are kept fresh. - Time time_at_snapshot; + base::Time time_at_snapshot; // How bad a thumbnail needs to be before we completely ignore it. static const double kThumbnailMaximumBoringness; @@ -54,7 +54,7 @@ struct ThumbnailScore { // Time before we take a worse thumbnail (subject to // kThumbnailMaximumBoringness) over what's currently in the database // for freshness. - static const TimeDelta kUpdateThumbnailTime; + static const base::TimeDelta kUpdateThumbnailTime; // Penalty of how much more boring a thumbnail should be per hour. static const double kThumbnailDegradePerHour; diff --git a/chrome/common/time_format.cc b/chrome/common/time_format.cc index 39412ea..029aec0 100644 --- a/chrome/common/time_format.cc +++ b/chrome/common/time_format.cc @@ -21,6 +21,9 @@ #include "unicode/plurrule.h" #include "unicode/smpdtfmt.h" +using base::Time; +using base::TimeDelta; + class TimeRemainingFormat { public: const std::vector<PluralFormat*>& formatter(bool short_version) { diff --git a/chrome/common/time_format.h b/chrome/common/time_format.h index 8704e01..252599b 100644 --- a/chrome/common/time_format.h +++ b/chrome/common/time_format.h @@ -11,8 +11,10 @@ #include "unicode/smpdtfmt.h" +namespace base { class Time; class TimeDelta; +} class TimeFormat { public: @@ -20,10 +22,10 @@ class TimeFormat { // are simpler than PastTime since this is used for in-progress operations // and users have different expectations of units. // Ex: "3 mins left", "2 days left". - static std::wstring TimeRemaining(const TimeDelta& delta); + static std::wstring TimeRemaining(const base::TimeDelta& delta); // Same as TimeRemaining without the "left". - static std::wstring TimeRemainingShort(const TimeDelta& delta); + static std::wstring TimeRemainingShort(const base::TimeDelta& delta); // For displaying a relative time in the past. This method returns either // "Today", "Yesterday", or an empty string if it's older than that. @@ -38,9 +40,8 @@ class TimeFormat { // If NULL, the current day's midnight will be retrieved, which can be // slow. If many items are being processed, it is best to get the current // time once at the beginning and pass it for each computation. - static std::wstring RelativeDate(const Time& time, - const Time* optional_midnight_today); + static std::wstring RelativeDate(const base::Time& time, + const base::Time* optional_midnight_today); }; #endif // CHROME_COMMON_TIME_FORMAT_H__ - diff --git a/chrome/common/time_format_unittest.cc b/chrome/common/time_format_unittest.cc index bb910cc..07119d1 100644 --- a/chrome/common/time_format_unittest.cc +++ b/chrome/common/time_format_unittest.cc @@ -10,6 +10,9 @@ #include "chrome/common/time_format.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; +using base::TimeDelta; + TEST(TimeFormat, RelativeDate) { Time now = Time::Now(); std::wstring today_str = TimeFormat::RelativeDate(now, NULL); diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index f6c19d7..734514b 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -61,6 +61,8 @@ #include "generated_resources.h" +using base::TimeDelta; + //----------------------------------------------------------------------------- // define to write the time necessary for thumbnail/DOM text retrieval, diff --git a/chrome/test/automation/autocomplete_edit_proxy.cc b/chrome/test/automation/autocomplete_edit_proxy.cc index 889f624..3758c74 100644 --- a/chrome/test/automation/autocomplete_edit_proxy.cc +++ b/chrome/test/automation/autocomplete_edit_proxy.cc @@ -10,6 +10,9 @@ #include "chrome/test/automation/automation_messages.h" #include "chrome/test/automation/automation_proxy.h" +using base::TimeDelta; +using base::TimeTicks; + bool AutocompleteEditProxy::GetText(std::wstring* text) const { if (!is_valid()) return false; diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc index 1724f95..5588ea8 100644 --- a/chrome/test/automation/automation_proxy.cc +++ b/chrome/test/automation/automation_proxy.cc @@ -16,6 +16,9 @@ #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/window_proxy.h" +using base::TimeDelta; +using base::TimeTicks; + // This class exists to group together the data and functionality used for // synchronous automation requests. class AutomationRequest : @@ -556,4 +559,3 @@ TabProxy* AutomationProxy::CreateExternalTab(HWND* external_tab_container) { delete response; return tab_proxy; } - diff --git a/chrome/test/automation/browser_proxy.cc b/chrome/test/automation/browser_proxy.cc index 8a30c31..ce47335 100644 --- a/chrome/test/automation/browser_proxy.cc +++ b/chrome/test/automation/browser_proxy.cc @@ -13,6 +13,9 @@ #include "chrome/test/automation/automation_proxy.h" #include "chrome/test/automation/tab_proxy.h" +using base::TimeDelta; +using base::TimeTicks; + bool BrowserProxy::ActivateTab(int tab_index) { return ActivateTabWithTimeout(tab_index, INFINITE, NULL); } diff --git a/chrome/test/startup/feature_startup_test.cc b/chrome/test/startup/feature_startup_test.cc index ce37879..59fdfa1 100644 --- a/chrome/test/startup/feature_startup_test.cc +++ b/chrome/test/startup/feature_startup_test.cc @@ -15,6 +15,8 @@ #include "chrome/test/ui/ui_test.h" #include "net/base/net_util.h" +using base::TimeDelta; + namespace { // Returns the directory name where the "typical" user data is that we use for diff --git a/chrome/test/startup/startup_test.cc b/chrome/test/startup/startup_test.cc index 583dd58..34f91b9 100644 --- a/chrome/test/startup/startup_test.cc +++ b/chrome/test/startup/startup_test.cc @@ -10,6 +10,9 @@ #include "chrome/test/ui/ui_test.h" #include "net/base/net_util.h" +using base::TimeDelta; +using base::TimeTicks; + namespace { // Wrapper around CopyFile to retry 10 times if there is an error. diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc index 8abb4ec..235c568 100644 --- a/chrome/test/testing_profile.cc +++ b/chrome/test/testing_profile.cc @@ -8,6 +8,8 @@ #include "chrome/browser/history/history_backend.h" #include "chrome/common/chrome_constants.h" +using base::Time; + namespace { // BookmarkLoadObserver is used when blocking until the BookmarkModel diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h index ea45bc1..9eff18d 100644 --- a/chrome/test/testing_profile.h +++ b/chrome/test/testing_profile.h @@ -136,7 +136,7 @@ class TestingProfile : public Profile { virtual bool Profile::IsSameProfile(Profile *p) { return this == p; } - virtual Time GetStartTime() const { + virtual base::Time GetStartTime() const { return start_time_; } virtual TabRestoreService* GetTabRestoreService() { @@ -162,7 +162,7 @@ class TestingProfile : public Profile { // The path of the profile; the various database and other files are relative // to this. std::wstring path_; - Time start_time_; + base::Time start_time_; scoped_ptr<PrefService> prefs_; private: diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index f0aec29..322f02c 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -30,6 +30,8 @@ #include "googleurl/src/gurl.h" #include "net/base/net_util.h" +using base::TimeTicks; + bool UITest::in_process_renderer_ = false; bool UITest::in_process_plugins_ = false; bool UITest::no_sandbox_ = false; diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h index 8c67282..f575496 100644 --- a/chrome/test/ui/ui_test.h +++ b/chrome/test/ui/ui_test.h @@ -353,7 +353,7 @@ class UITest : public testing::Test { std::wstring homepage_; // Homepage used for testing. bool wait_for_initial_loads_; // Wait for initial loads to complete // in SetUp() before running test body. - TimeTicks browser_launch_time_; // Time when the browser was run. + base::TimeTicks browser_launch_time_; // Time when the browser was run. bool dom_automation_enabled_; // This can be set to true to have the // test run the dom automation case. std::wstring template_user_data_; // See set_template_user_data(). diff --git a/chrome/tools/profiles/generate_profile.cc b/chrome/tools/profiles/generate_profile.cc index 99098af..d60f3ae 100644 --- a/chrome/tools/profiles/generate_profile.cc +++ b/chrome/tools/profiles/generate_profile.cc @@ -19,6 +19,8 @@ #include "chrome/common/thumbnail_score.h" #include "SkBitmap.h" +using base::Time; + // Probabilities of different word lengths, as measured from Darin's profile. // kWordLengthProbabilities[n-1] = P(word of length n) const float kWordLengthProbabilities[] = { 0.069f, 0.132f, 0.199f, @@ -216,4 +218,3 @@ int main(int argc, const char* argv[]) { return 0; } - diff --git a/chrome/views/chrome_menu.cc b/chrome/views/chrome_menu.cc index 393afe0..b2870ee 100644 --- a/chrome/views/chrome_menu.cc +++ b/chrome/views/chrome_menu.cc @@ -28,6 +28,9 @@ #undef min #undef max +using base::Time; +using base::TimeDelta; + // Margins between the top of the item and the label. static const int kItemTopMargin = 3; @@ -2720,4 +2723,3 @@ void MenuController::StopScrolling() { } } // namespace views - diff --git a/chrome/views/menu_button.cc b/chrome/views/menu_button.cc index 412d8fa..e9205b1 100644 --- a/chrome/views/menu_button.cc +++ b/chrome/views/menu_button.cc @@ -21,6 +21,9 @@ #include "generated_resources.h" +using base::Time; +using base::TimeDelta; + namespace views { // The amount of time, in milliseconds, we wait before allowing another mouse diff --git a/chrome/views/menu_button.h b/chrome/views/menu_button.h index de6f973..c43d6b6 100644 --- a/chrome/views/menu_button.h +++ b/chrome/views/menu_button.h @@ -81,7 +81,7 @@ class MenuButton : public TextButton { // menu. There is no clean way to get the second click event because the // menu is displayed using a modal loop and, unlike regular menus in Windows, // the button is not part of the displayed menu. - Time menu_closed_time_; + base::Time menu_closed_time_; // The associated menu's resource identifier. ViewMenuDelegate* menu_delegate_; diff --git a/chrome/views/repeat_controller.cc b/chrome/views/repeat_controller.cc index d6a9ac4..2d52783 100644 --- a/chrome/views/repeat_controller.cc +++ b/chrome/views/repeat_controller.cc @@ -4,6 +4,8 @@ #include "chrome/views/repeat_controller.h" +using base::TimeDelta; + namespace views { // The delay before the first and then subsequent repeats. Values taken from diff --git a/chrome/views/throbber.cc b/chrome/views/throbber.cc index 7a82277..ba8695c 100644 --- a/chrome/views/throbber.cc +++ b/chrome/views/throbber.cc @@ -10,6 +10,8 @@ #include "chrome/common/resource_bundle.h" #include "skia/include/SkBitmap.h" +using base::TimeDelta; + namespace views { Throbber::Throbber(int frame_time_ms, 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 { 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; diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index 10fa6b0..4c00738 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -21,6 +21,8 @@ #include "net/http/http_transaction.h" #include "net/http/http_util.h" +using base::Time; + namespace net { // disk cache entry data indices. diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc index b715aa6..92ac6ca 100644 --- a/net/http/http_cache_unittest.cc +++ b/net/http/http_cache_unittest.cc @@ -16,6 +16,8 @@ #include "net/http/http_transaction_unittest.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; + namespace { //----------------------------------------------------------------------------- diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index 5ef592a..cad17af 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -28,6 +28,8 @@ // + pre-emptive authorization // + use the username/password encoded in the URL. +using base::Time; + namespace net { //----------------------------------------------------------------------------- diff --git a/net/http/http_response_headers.cc b/net/http/http_response_headers.cc index 1a7ea57..8c80c49 100644 --- a/net/http/http_response_headers.cc +++ b/net/http/http_response_headers.cc @@ -18,6 +18,9 @@ #include "net/base/escape.h" #include "net/http/http_util.h" +using base::Time; +using base::TimeDelta; + namespace net { //----------------------------------------------------------------------------- diff --git a/net/http/http_response_headers.h b/net/http/http_response_headers.h index feba262..3edb070 100644 --- a/net/http/http_response_headers.h +++ b/net/http/http_response_headers.h @@ -14,8 +14,11 @@ #include "net/http/http_version.h" class Pickle; + +namespace base { class Time; class TimeDelta; +} namespace net { @@ -150,33 +153,33 @@ class HttpResponseHeaders : // support unit testing. The request_time parameter indicates the time at // which the request was made that resulted in this response, which was // received at response_time. - bool RequiresValidation(const Time& request_time, - const Time& response_time, - const Time& current_time) const; + bool RequiresValidation(const base::Time& request_time, + const base::Time& response_time, + const base::Time& current_time) const; // Returns the amount of time the server claims the response is fresh from // the time the response was generated. See section 13.2.4 of RFC 2616. See // RequiresValidation for a description of the response_time parameter. - TimeDelta GetFreshnessLifetime(const Time& response_time) const; + base::TimeDelta GetFreshnessLifetime(const base::Time& response_time) const; // Returns the age of the response. See section 13.2.3 of RFC 2616. // See RequiresValidation for a description of this method's parameters. - TimeDelta GetCurrentAge(const Time& request_time, - const Time& response_time, - const Time& current_time) const; + base::TimeDelta GetCurrentAge(const base::Time& request_time, + const base::Time& response_time, + const base::Time& current_time) const; // The following methods extract values from the response headers. If a // value is not present, then false is returned. Otherwise, true is returned // and the out param is assigned to the corresponding value. - bool GetMaxAgeValue(TimeDelta* value) const; - bool GetAgeValue(TimeDelta* value) const; - bool GetDateValue(Time* value) const; - bool GetLastModifiedValue(Time* value) const; - bool GetExpiresValue(Time* value) const; + bool GetMaxAgeValue(base::TimeDelta* value) const; + bool GetAgeValue(base::TimeDelta* value) const; + bool GetDateValue(base::Time* value) const; + bool GetLastModifiedValue(base::Time* value) const; + bool GetExpiresValue(base::Time* value) const; // Extracts the time value of a particular header. This method looks for the // first matching header value and parses its value as a HTTP-date. - bool GetTimeValuedHeader(const std::string& name, Time* result) const; + bool GetTimeValuedHeader(const std::string& name, base::Time* result) const; // Determines if this response indicates a keep-alive connection. bool IsKeepAlive() const; @@ -284,4 +287,3 @@ class HttpResponseHeaders : } // namespace net #endif // NET_HTTP_RESPONSE_HEADERS_H_ - diff --git a/net/http/http_response_headers_unittest.cc b/net/http/http_response_headers_unittest.cc index df3add4..fa5cbaa 100644 --- a/net/http/http_response_headers_unittest.cc +++ b/net/http/http_response_headers_unittest.cc @@ -11,6 +11,7 @@ #include "testing/gtest/include/gtest/gtest.h" using namespace std; +using base::Time; using net::HttpResponseHeaders; using net::HttpVersion; diff --git a/net/http/http_response_info.h b/net/http/http_response_info.h index ee0767f..80defef 100644 --- a/net/http/http_response_info.h +++ b/net/http/http_response_info.h @@ -17,11 +17,11 @@ class HttpResponseInfo { public: // The time at which the request was made that resulted in this response. // For cached responses, this time could be "far" in the past. - Time request_time; + base::Time request_time; // The time at which the response headers were received. For cached // responses, this time could be "far" in the past. - Time response_time; + base::Time response_time; // If the response headers indicate a 401 or 407 failure, then this structure // will contain additional information about the authentication challenge. diff --git a/net/http/http_transaction_unittest.h b/net/http/http_transaction_unittest.h index 0b8a1c9..93f76c7 100644 --- a/net/http/http_transaction_unittest.h +++ b/net/http/http_transaction_unittest.h @@ -211,8 +211,8 @@ class MockNetworkTransaction : public net::HttpTransaction { StringPrintf("%s\n%s\n", resp_status.c_str(), resp_headers.c_str()); std::replace(header_data.begin(), header_data.end(), '\n', '\0'); - response_.request_time = Time::Now(); - response_.response_time = Time::Now(); + response_.request_time = base::Time::Now(); + response_.response_time = base::Time::Now(); response_.headers = new net::HttpResponseHeaders(header_data); response_.ssl_info.cert_status = t->cert_status; data_ = resp_data; diff --git a/net/http/http_transaction_winhttp.cc b/net/http/http_transaction_winhttp.cc index 550f32a..0dfb9db 100644 --- a/net/http/http_transaction_winhttp.cc +++ b/net/http/http_transaction_winhttp.cc @@ -29,6 +29,8 @@ #pragma comment(lib, "winhttp.lib") #pragma warning(disable: 4355) +using base::Time; + namespace net { static int TranslateOSError(DWORD error) { diff --git a/net/proxy/proxy_resolver_winhttp.cc b/net/proxy/proxy_resolver_winhttp.cc index 2a12e06..5a16df5 100644 --- a/net/proxy/proxy_resolver_winhttp.cc +++ b/net/proxy/proxy_resolver_winhttp.cc @@ -12,6 +12,9 @@ #pragma comment(lib, "winhttp.lib") +using base::TimeDelta; +using base::TimeTicks; + namespace net { // A small wrapper for histogramming purposes ;-) diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc index be11692..52d8491 100644 --- a/net/proxy/proxy_service.cc +++ b/net/proxy/proxy_service.cc @@ -18,6 +18,9 @@ #include "googleurl/src/gurl.h" #include "net/base/net_errors.h" +using base::TimeDelta; +using base::TimeTicks; + namespace net { // ProxyConfig ---------------------------------------------------------------- diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h index 5ca41e8..c596aab 100644 --- a/net/proxy/proxy_service.h +++ b/net/proxy/proxy_service.h @@ -65,11 +65,11 @@ class ProxyConfig { // Contains the information about when to retry a proxy server. struct ProxyRetryInfo { // We should not retry until this time. - TimeTicks bad_until; + base::TimeTicks bad_until; // This is the current delay. If the proxy is still bad, we need to increase // this delay. - TimeDelta current_delay; + base::TimeDelta current_delay; }; // Map of proxy servers with the associated RetryInfo structures. @@ -161,7 +161,7 @@ class ProxyService { bool config_is_bad_; // The time when the proxy configuration was last read from the system. - TimeTicks config_last_update_time_; + base::TimeTicks config_last_update_time_; // Map of the known bad proxies and the information about the retry time. ProxyRetryInfoMap proxy_retry_info_; diff --git a/net/tools/crash_cache/crash_cache.cc b/net/tools/crash_cache/crash_cache.cc index e6a5522..243ed45 100644 --- a/net/tools/crash_cache/crash_cache.cc +++ b/net/tools/crash_cache/crash_cache.cc @@ -22,6 +22,8 @@ #include "net/disk_cache/disk_cache_test_util.h" #include "net/disk_cache/rankings.h" +using base::Time; + enum Errors { GENERIC = -1, ALL_GOOD = 0, diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc index 8c6d5f3..22372db 100644 --- a/net/url_request/url_request.cc +++ b/net/url_request/url_request.cc @@ -20,6 +20,7 @@ URLRequestMetrics url_request_metrics; #endif +using base::Time; using net::UploadData; using std::string; using std::wstring; @@ -335,4 +336,3 @@ int64 URLRequest::GetExpectedContentSize() const { return expected_content_size; } - diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h index 549665f..1f5a06e 100644 --- a/net/url_request/url_request.h +++ b/net/url_request/url_request.h @@ -286,13 +286,13 @@ class URLRequest { // The time at which the returned response was requested. For cached // responses, this may be a time well in the past. - const Time& request_time() const { + const base::Time& request_time() const { return response_info_.request_time; } // The time at which the returned response was generated. For cached // responses, this may be a time well in the past. - const Time& response_time() const { + const base::Time& response_time() const { return response_info_.response_time; } diff --git a/net/url_request/url_request_job.cc b/net/url_request/url_request_job.cc index 10323f6..dc372ba 100644 --- a/net/url_request/url_request_job.cc +++ b/net/url_request/url_request_job.cc @@ -13,6 +13,9 @@ #include "net/url_request/url_request_job_metrics.h" #include "net/url_request/url_request_job_tracker.h" +using base::Time; +using base::TimeTicks; + // Buffer size allocated when de-compressing data. static const int kFilterBufSize = 32 * 1024; @@ -498,4 +501,3 @@ void URLRequestJob::SetStatus(const URLRequestStatus &status) { if (request_) request_->set_status(status); } - diff --git a/net/url_request/url_request_job_metrics.cc b/net/url_request/url_request_job_metrics.cc index ecb717f..8db26fb 100644 --- a/net/url_request/url_request_job_metrics.cc +++ b/net/url_request/url_request_job_metrics.cc @@ -7,6 +7,8 @@ #include "base/basictypes.h" #include "base/string_util.h" +using base::TimeDelta; + void URLRequestJobMetrics::AppendText(std::wstring* text) { if (!text) return; diff --git a/net/url_request/url_request_job_metrics.h b/net/url_request/url_request_job_metrics.h index 950d0ae..5e6de7f 100644 --- a/net/url_request/url_request_job_metrics.h +++ b/net/url_request/url_request_job_metrics.h @@ -28,10 +28,10 @@ class URLRequestJobMetrics { scoped_ptr<GURL> url_; // Time when the job starts. - TimeTicks start_time_; + base::TimeTicks start_time_; // Time when the job is done. - TimeTicks end_time_; + base::TimeTicks end_time_; // Total number of bytes the job reads from underline IO. int total_bytes_read_; diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index 9bf467f..cd21a2d 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc @@ -26,6 +26,8 @@ #include "net/url_request/url_request.h" #include "testing/gtest/include/gtest/gtest.h" +using base::Time; + namespace { class URLRequestTest : public testing::Test { diff --git a/webkit/default_plugin/plugin_database_handler.cc b/webkit/default_plugin/plugin_database_handler.cc index 1a35285..2a1ed26 100644 --- a/webkit/default_plugin/plugin_database_handler.cc +++ b/webkit/default_plugin/plugin_database_handler.cc @@ -13,6 +13,9 @@ #include "webkit/default_plugin/plugin_impl.h" #include "webkit/default_plugin/plugin_main.h" +using base::Time; +using base::TimeDelta; + PluginDatabaseHandler::PluginDatabaseHandler( PluginInstallerImpl& plugin_installer_instance) : plugin_downloads_file_(INVALID_HANDLE_VALUE), diff --git a/webkit/glue/password_form.h b/webkit/glue/password_form.h index 9afadc8..aa577e3 100644 --- a/webkit/glue/password_form.h +++ b/webkit/glue/password_form.h @@ -124,7 +124,7 @@ struct PasswordForm { // When the login was saved (by chrome). // // When parsing an HTML form, this is not used. - Time date_created; + base::Time date_created; // Tracks if the user opted to never remember passwords for this form. Default // to false. diff --git a/webkit/glue/plugins/plugin_list.cc b/webkit/glue/plugins/plugin_list.cc index 02b52ac..7ef4b92 100644 --- a/webkit/glue/plugins/plugin_list.cc +++ b/webkit/glue/plugins/plugin_list.cc @@ -23,6 +23,9 @@ #include "webkit/glue/plugins/plugin_lib.h" #include "googleurl/src/gurl.h" +using base::TimeDelta; +using base::TimeTicks; + namespace NPAPI { diff --git a/webkit/glue/resource_handle_impl.cc b/webkit/glue/resource_handle_impl.cc index 058a6ca..7db50ca 100644 --- a/webkit/glue/resource_handle_impl.cc +++ b/webkit/glue/resource_handle_impl.cc @@ -59,6 +59,8 @@ MSVC_POP_WARNING(); #include "net/base/load_flags.h" using webkit_glue::ResourceLoaderBridge; +using base::Time; +using base::TimeDelta; using net::HttpResponseHeaders; namespace { @@ -751,4 +753,3 @@ bool ResourceHandle::willLoadFromCache(ResourceRequest& request) { } } // namespace WebCore - diff --git a/webkit/glue/resource_loader_bridge.h b/webkit/glue/resource_loader_bridge.h index 15414ae..ce09b21 100644 --- a/webkit/glue/resource_loader_bridge.h +++ b/webkit/glue/resource_loader_bridge.h @@ -36,11 +36,11 @@ class ResourceLoaderBridge { struct ResponseInfo { // The time at which the request was made that resulted in this response. // For cached responses, this time could be "far" in the past. - Time request_time; + base::Time request_time; // The time at which the response headers were received. For cached // responses, this time could be "far" in the past. - Time response_time; + base::Time response_time; // The response headers or NULL if the URL type does not support headers. scoped_refptr<net::HttpResponseHeaders> headers; diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc index bdbcc77..f9e9c5f 100644 --- a/webkit/glue/webframe_impl.cc +++ b/webkit/glue/webframe_impl.cc @@ -154,6 +154,7 @@ MSVC_POP_WARNING(); #include "bridge/runtime_object.h" #endif +using base::Time; using WebCore::ChromeClientChromium; using WebCore::Color; using WebCore::Document; diff --git a/webkit/port/platform/chromium/SystemTimeChromium.cpp b/webkit/port/platform/chromium/SystemTimeChromium.cpp index fe3f6d6..bd93574 100644 --- a/webkit/port/platform/chromium/SystemTimeChromium.cpp +++ b/webkit/port/platform/chromium/SystemTimeChromium.cpp @@ -29,6 +29,8 @@ #include "NotImplemented.h" #include "base/time.h" +using base::Time; + namespace WebCore { // Get the current time in seconds since epoch. diff --git a/webkit/tools/test_shell/event_sending_controller.cc b/webkit/tools/test_shell/event_sending_controller.cc index 69bae35..12e69d3 100644 --- a/webkit/tools/test_shell/event_sending_controller.cc +++ b/webkit/tools/test_shell/event_sending_controller.cc @@ -30,6 +30,9 @@ // TODO(mpcomplete): layout before each event? // TODO(mpcomplete): do we need modifiers for mouse events? +using base::Time; +using base::TimeTicks; + TestShell* EventSendingController::shell_ = NULL; gfx::Point EventSendingController::last_mouse_pos_; WebMouseEvent::Button EventSendingController::pressed_button_ = diff --git a/webkit/tools/test_shell/image_decoder_unittest.cc b/webkit/tools/test_shell/image_decoder_unittest.cc index 8c954cf..d8df2e0 100644 --- a/webkit/tools/test_shell/image_decoder_unittest.cc +++ b/webkit/tools/test_shell/image_decoder_unittest.cc @@ -14,6 +14,8 @@ #include "base/time.h" #include "webkit/tools/test_shell/image_decoder_unittest.h" +using base::Time; + void ReadFileToVector(const std::wstring& path, Vector<char>* contents) { std::string contents_str; file_util::ReadFileToString(path, &contents_str); |