diff --git a/talk/app/webrtc/statscollector.cc b/talk/app/webrtc/statscollector.cc index 86a88c159..74fc3a72e 100644 --- a/talk/app/webrtc/statscollector.cc +++ b/talk/app/webrtc/statscollector.cc @@ -32,6 +32,7 @@ #include "talk/base/base64.h" #include "talk/base/scoped_ptr.h" +#include "talk/base/timing.h" #include "talk/session/media/channel.h" namespace webrtc { @@ -924,7 +925,7 @@ void StatsCollector::ExtractVideoInfo( } double StatsCollector::GetTimeNow() { - return timing_.WallTimeNow() * talk_base::kNumMillisecsPerSec; + return talk_base::Timing::WallTimeNow() * talk_base::kNumMillisecsPerSec; } bool StatsCollector::GetTransportIdFromProxy(const std::string& proxy, diff --git a/talk/app/webrtc/statscollector.h b/talk/app/webrtc/statscollector.h index 77a1ba086..251690455 100644 --- a/talk/app/webrtc/statscollector.h +++ b/talk/app/webrtc/statscollector.h @@ -40,8 +40,6 @@ #include "talk/app/webrtc/statstypes.h" #include "talk/app/webrtc/webrtcsession.h" -#include "talk/base/timing.h" - namespace webrtc { class StatsCollector { @@ -130,7 +128,6 @@ class StatsCollector { // Raw pointer to the session the statistics are gathered from. WebRtcSession* session_; double stats_gathering_started_; - talk_base::Timing timing_; cricket::ProxyTransportMap proxy_to_transport_; typedef std::vector > diff --git a/talk/base/timing.cc b/talk/base/timing.cc index 4df9f1f34..0b55eaf8c 100644 --- a/talk/base/timing.cc +++ b/talk/base/timing.cc @@ -63,6 +63,7 @@ Timing::~Timing() { #endif } +// static double Timing::WallTimeNow() { #if defined(POSIX) struct timeval time; diff --git a/talk/base/timing.h b/talk/base/timing.h index f2bf0130b..2112e862d 100644 --- a/talk/base/timing.h +++ b/talk/base/timing.h @@ -41,7 +41,8 @@ class Timing { // WallTimeNow() returns the current wall-clock time in seconds, // within 10 milliseconds resolution. - virtual double WallTimeNow(); + // WallTimeNow is static and does not require a timer_handle_ on Windows. + static double WallTimeNow(); // TimerNow() is like WallTimeNow(), but is monotonically // increasing. It returns seconds in resolution of 10 microseconds diff --git a/webrtc/base/timing.cc b/webrtc/base/timing.cc index aa1fc4290..0c5ed5e12 100644 --- a/webrtc/base/timing.cc +++ b/webrtc/base/timing.cc @@ -46,6 +46,7 @@ Timing::~Timing() { #endif } +// static double Timing::WallTimeNow() { #if defined(WEBRTC_POSIX) struct timeval time; diff --git a/webrtc/base/timing.h b/webrtc/base/timing.h index 58b17a9fb..1dee60761 100644 --- a/webrtc/base/timing.h +++ b/webrtc/base/timing.h @@ -24,7 +24,8 @@ class Timing { // WallTimeNow() returns the current wall-clock time in seconds, // within 10 milliseconds resolution. - virtual double WallTimeNow(); + // WallTimeNow is static and does not require a timer_handle_ on Windows. + static double WallTimeNow(); // TimerNow() is like WallTimeNow(), but is monotonically // increasing. It returns seconds in resolution of 10 microseconds