Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / libjingle / source / talk / session / media / typingmonitor.cc
index 3c5d387..ee0f92a 100644 (file)
 
 #include "talk/session/media/typingmonitor.h"
 
-#include "talk/base/logging.h"
-#include "talk/base/thread.h"
 #include "talk/session/media/channel.h"
+#include "webrtc/base/logging.h"
+#include "webrtc/base/thread.h"
 
 namespace cricket {
 
 TypingMonitor::TypingMonitor(VoiceChannel* channel,
-                             talk_base::Thread* worker_thread,
+                             rtc::Thread* worker_thread,
                              const TypingMonitorOptions& settings)
     : channel_(channel),
       worker_thread_(worker_thread),
@@ -52,7 +52,7 @@ TypingMonitor::TypingMonitor(VoiceChannel* channel,
 TypingMonitor::~TypingMonitor() {
   // Shortcut any pending unmutes.
   if (has_pending_unmute_) {
-    talk_base::MessageList messages;
+    rtc::MessageList messages;
     worker_thread_->Clear(this, 0, &messages);
     ASSERT(messages.size() == 1);
     channel_->MuteStream(0, false);
@@ -75,7 +75,7 @@ void TypingMonitor::OnVoiceChannelError(uint32 ssrc,
     channel_->MuteStream(0, true);
     SignalMuted(channel_, true);
     has_pending_unmute_ = true;
-    muted_at_ = talk_base::Time();
+    muted_at_ = rtc::Time();
 
     worker_thread_->PostDelayed(mute_period_, this, 0);
     LOG(LS_INFO) << "Muting for at least " << mute_period_ << "ms.";
@@ -89,7 +89,7 @@ void TypingMonitor::OnVoiceChannelError(uint32 ssrc,
  */
 void TypingMonitor::OnChannelMuted() {
   if (has_pending_unmute_) {
-    talk_base::MessageList removed;
+    rtc::MessageList removed;
     worker_thread_->Clear(this, 0, &removed);
     ASSERT(removed.size() == 1);
     has_pending_unmute_ = false;
@@ -102,13 +102,13 @@ void TypingMonitor::OnChannelMuted() {
  * elapse since they finished and try to unmute again.  Should be called on the
  * worker thread.
  */
-void TypingMonitor::OnMessage(talk_base::Message* msg) {
+void TypingMonitor::OnMessage(rtc::Message* msg) {
   if (!channel_->IsStreamMuted(0) || !has_pending_unmute_) return;
   int silence_period = channel_->media_channel()->GetTimeSinceLastTyping();
   int expiry_time = mute_period_ - silence_period;
   if (silence_period < 0 || expiry_time < 50) {
     LOG(LS_INFO) << "Mute timeout hit, last typing " << silence_period
-                 << "ms ago, unmuting after " << talk_base::TimeSince(muted_at_)
+                 << "ms ago, unmuting after " << rtc::TimeSince(muted_at_)
                  << "ms total.";
     has_pending_unmute_ = false;
     channel_->MuteStream(0, false);
@@ -116,7 +116,7 @@ void TypingMonitor::OnMessage(talk_base::Message* msg) {
   } else {
     LOG(LS_INFO) << "Mute timeout hit, last typing " << silence_period
                  << "ms ago, check again in " << expiry_time << "ms.";
-    talk_base::Thread::Current()->PostDelayed(expiry_time, this, 0);
+    rtc::Thread::Current()->PostDelayed(expiry_time, this, 0);
   }
 }