diff --git a/base/files/file_enumerator_starboard.cc b/base/files/file_enumerator_starboard.cc index 978e9405b6d8..ed6fe9d338a7 100644 --- a/base/files/file_enumerator_starboard.cc +++ b/base/files/file_enumerator_starboard.cc @@ -43,7 +43,8 @@ int64_t FileEnumerator::FileInfo::GetSize() const { } base::Time FileEnumerator::FileInfo::GetLastModifiedTime() const { - return base::Time::FromSbTime(sb_info_.last_modified); + return base::Time::FromDeltaSinceWindowsEpoch( + base::TimeDelta::FromMicroseconds(sb_info_.last_modified)); } // FileEnumerator -------------------------------------------------------------- diff --git a/base/files/file_starboard.cc b/base/files/file_starboard.cc index 40e63d2fc0ac..b3f7362fc745 100644 --- a/base/files/file_starboard.cc +++ b/base/files/file_starboard.cc @@ -256,9 +256,12 @@ bool File::GetInfo(Info* info) { info->is_directory = file_info.is_directory; info->is_symbolic_link = file_info.is_symbolic_link; info->size = file_info.size; - info->last_modified = base::Time::FromSbTime(file_info.last_modified); - info->last_accessed = base::Time::FromSbTime(file_info.last_accessed); - info->creation_time = base::Time::FromSbTime(file_info.creation_time); + info->last_modified = base::Time::FromDeltaSinceWindowsEpoch( + base::TimeDelta::FromMicroseconds(file_info.last_modified)); + info->last_accessed = base::Time::FromDeltaSinceWindowsEpoch( + base::TimeDelta::FromMicroseconds(file_info.last_accessed)); + info->creation_time = base::Time::FromDeltaSinceWindowsEpoch( + base::TimeDelta::FromMicroseconds(file_info.creation_time)); return true; } diff --git a/base/files/file_util_starboard.cc b/base/files/file_util_starboard.cc index be80ab1605e8..83194f42dbbe 100644 --- a/base/files/file_util_starboard.cc +++ b/base/files/file_util_starboard.cc @@ -374,9 +374,12 @@ bool GetFileInfo(const FilePath &file_path, File::Info *results) { results->is_directory = info.is_directory; results->size = info.size; - results->last_modified = base::Time::FromSbTime(info.last_modified); - results->last_accessed = base::Time::FromSbTime(info.last_accessed); - results->creation_time = base::Time::FromSbTime(info.creation_time); + results->last_modified = base::Time::FromDeltaSinceWindowsEpoch( + base::TimeDelta::FromMicroseconds(info.last_modified)); + results->last_accessed = base::Time::FromDeltaSinceWindowsEpoch( + base::TimeDelta::FromMicroseconds(info.last_accessed)); + results->creation_time = base::Time::FromDeltaSinceWindowsEpoch( + base::TimeDelta::FromMicroseconds(info.creation_time)); return true; } diff --git a/base/logging.cc b/base/logging.cc index 5a159ff4f3a0..df473b4b4a46 100644 --- a/base/logging.cc +++ b/base/logging.cc @@ -15,11 +15,11 @@ #include "starboard/client_porting/eztime/eztime.h" #include "starboard/common/log.h" #include "starboard/common/mutex.h" +#include "starboard/common/time.h" #include "starboard/configuration.h" #include "starboard/configuration_constants.h" #include "starboard/file.h" #include "starboard/system.h" -#include "starboard/time.h" typedef SbFile FileHandle; typedef SbMutex MutexHandle; #else @@ -210,7 +210,7 @@ int32_t CurrentProcessId() { uint64_t TickCount() { #if defined(STARBOARD) - return static_cast(SbTimeGetMonotonicNow()); + return starboard::CurrentMonotonicTime(); #else #if defined(OS_WIN) return GetTickCount(); diff --git a/base/message_loop/message_pump_io_starboard.cc b/base/message_loop/message_pump_io_starboard.cc index 0194e5442a8f..5072fc188b37 100644 --- a/base/message_loop/message_pump_io_starboard.cc +++ b/base/message_loop/message_pump_io_starboard.cc @@ -215,7 +215,7 @@ void MessagePumpIOStarboard::Run(Delegate* delegate) { } else { TimeDelta delay = delayed_work_time_ - TimeTicks::Now(); if (delay > TimeDelta()) { - SbSocketWaiterWaitTimed(waiter_, delay.ToSbTime()); + SbSocketWaiterWaitTimed(waiter_, delay.InMicroseconds()); } else { // It looks like delayed_work_time_ indicates a time in the past, so we // need to call DoDelayedWork now. diff --git a/base/message_loop/message_pump_ui_starboard.cc b/base/message_loop/message_pump_ui_starboard.cc index ca6ce46ae41b..32b9e09b9a48 100644 --- a/base/message_loop/message_pump_ui_starboard.cc +++ b/base/message_loop/message_pump_ui_starboard.cc @@ -120,7 +120,7 @@ void MessagePumpUIStarboard::ScheduleDelayedWork( CancelDelayedLocked(); outstanding_delayed_events_.insert( - SbEventSchedule(&CallMessagePumpDelayed, this, delay.ToSbTime())); + SbEventSchedule(&CallMessagePumpDelayed, this, delay.InMicroseconds())); } } diff --git a/base/synchronization/condition_variable_starboard.cc b/base/synchronization/condition_variable_starboard.cc index 67747f0c90e3..b5a782d3dfcd 100644 --- a/base/synchronization/condition_variable_starboard.cc +++ b/base/synchronization/condition_variable_starboard.cc @@ -56,7 +56,7 @@ void ConditionVariable::Wait() { void ConditionVariable::TimedWait(const TimeDelta& max_time) { internal::ScopedBlockingCallWithBaseSyncPrimitives scoped_blocking_call( BlockingType::MAY_BLOCK); - SbTime duration = max_time.ToSbTime(); + int64_t duration = max_time.InMicroseconds(); #if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) user_lock_->CheckHeldAndUnmark(); diff --git a/base/threading/platform_thread_starboard.cc b/base/threading/platform_thread_starboard.cc index 0139ec28b381..4f26edef57e7 100644 --- a/base/threading/platform_thread_starboard.cc +++ b/base/threading/platform_thread_starboard.cc @@ -101,7 +101,7 @@ void PlatformThread::YieldCurrentThread() { // static void PlatformThread::Sleep(TimeDelta duration) { - SbThreadSleep(duration.ToSbTime()); + SbThreadSleep(duration.InMicroseconds()); } // static diff --git a/base/time/time.h b/base/time/time.h index 58305d86afc3..1d6e281a9278 100644 --- a/base/time/time.h +++ b/base/time/time.h @@ -182,10 +182,6 @@ class BASE_EXPORT TimeDelta { return delta_ == std::numeric_limits::min(); } -#if defined(STARBOARD) - SbTime ToSbTime() const; -#endif - #if defined(OS_POSIX) || defined(OS_FUCHSIA) struct timespec ToTimeSpec() const; #endif @@ -578,11 +574,6 @@ class BASE_EXPORT Time : public time_internal::TimeBase