Delete all use of tick_util.h.

Depends on Chrome cl https://codereview.chromium.org/1888003002/, which was landed some time ago.

BUG=webrtc:5740
R=stefan@webrtc.org, tommi@webrtc.org

Review URL: https://codereview.webrtc.org/1888593004 .

Cr-Commit-Position: refs/heads/master@{#12674}
diff --git a/webrtc/api/java/jni/androidmediacodeccommon.h b/webrtc/api/java/jni/androidmediacodeccommon.h
index 2f9e05d..db7260a 100644
--- a/webrtc/api/java/jni/androidmediacodeccommon.h
+++ b/webrtc/api/java/jni/androidmediacodeccommon.h
@@ -19,7 +19,6 @@
 #include "webrtc/api/java/jni/jni_helpers.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/thread.h"
-#include "webrtc/system_wrappers/include/tick_util.h"
 
 namespace webrtc_jni {
 
@@ -59,10 +58,6 @@
 // Maximum amount of encoded frames for which per-frame logging is enabled.
 enum { kMaxEncodedLogFrames = 10 };
 
-static inline int64_t GetCurrentTimeMs() {
-  return webrtc::TickTime::Now().Ticks() / 1000000LL;
-}
-
 static inline void AllowBlockingCalls() {
   rtc::Thread* current_thread = rtc::Thread::Current();
   if (current_thread != NULL)
diff --git a/webrtc/api/java/jni/androidmediadecoder_jni.cc b/webrtc/api/java/jni/androidmediadecoder_jni.cc
index 11c8d66..b3c2ffc 100644
--- a/webrtc/api/java/jni/androidmediadecoder_jni.cc
+++ b/webrtc/api/java/jni/androidmediadecoder_jni.cc
@@ -32,7 +32,6 @@
 #include "webrtc/common_video/include/i420_buffer_pool.h"
 #include "webrtc/modules/video_coding/include/video_codec_interface.h"
 #include "webrtc/system_wrappers/include/logcat_trace_context.h"
-#include "webrtc/system_wrappers/include/tick_util.h"
 
 using rtc::Bind;
 using rtc::Thread;
@@ -43,7 +42,6 @@
 using webrtc::EncodedImage;
 using webrtc::VideoFrame;
 using webrtc::RTPFragmentationHeader;
-using webrtc::TickTime;
 using webrtc::VideoCodec;
 using webrtc::VideoCodecType;
 using webrtc::kVideoCodecH264;
@@ -319,7 +317,7 @@
   frames_received_ = 0;
   frames_decoded_ = 0;
   frames_decoded_logged_ = kMaxDecodedLogFrames;
-  start_time_ms_ = GetCurrentTimeMs();
+  start_time_ms_ = rtc::TimeMillis();
   current_frames_ = 0;
   current_bytes_ = 0;
   current_decoding_time_ms_ = 0;
@@ -589,9 +587,9 @@
         frames_received_ << ". Decoded: " << frames_decoded_;
     EnableFrameLogOnWarning();
   }
-  const int64 drain_start = GetCurrentTimeMs();
+  const int64 drain_start = rtc::TimeMillis();
   while ((frames_received_ > frames_decoded_ + max_pending_frames_) &&
-         (GetCurrentTimeMs() - drain_start) < kMediaCodecTimeoutMs) {
+         (rtc::TimeMillis() - drain_start) < kMediaCodecTimeoutMs) {
     if (!DeliverPendingOutputs(jni, kMediaCodecPollMs)) {
       ALOGE << "DeliverPendingOutputs error. Frames received: " <<
           frames_received_ << ". Frames decoded: " << frames_decoded_;
@@ -844,7 +842,7 @@
   current_frames_++;
   current_decoding_time_ms_ += decode_time_ms;
   current_delay_time_ms_ += frame_delayed_ms;
-  int statistic_time_ms = GetCurrentTimeMs() - start_time_ms_;
+  int statistic_time_ms = rtc::TimeMillis() - start_time_ms_;
   if (statistic_time_ms >= kMediaCodecStatisticsIntervalMs &&
       current_frames_ > 0) {
     int current_bitrate = current_bytes_ * 8 / statistic_time_ms;
@@ -857,7 +855,7 @@
         ". DecTime: " << (current_decoding_time_ms_ / current_frames_) <<
         ". DelayTime: " << (current_delay_time_ms_ / current_frames_) <<
         " for last " << statistic_time_ms << " ms.";
-    start_time_ms_ = GetCurrentTimeMs();
+    start_time_ms_ = rtc::TimeMillis();
     current_frames_ = 0;
     current_bytes_ = 0;
     current_decoding_time_ms_ = 0;
@@ -993,4 +991,3 @@
 }
 
 }  // namespace webrtc_jni
-
diff --git a/webrtc/api/java/jni/androidmediaencoder_jni.cc b/webrtc/api/java/jni/androidmediaencoder_jni.cc
index 7a13270..5a817b6 100644
--- a/webrtc/api/java/jni/androidmediaencoder_jni.cc
+++ b/webrtc/api/java/jni/androidmediaencoder_jni.cc
@@ -27,6 +27,7 @@
 #include "webrtc/base/logging.h"
 #include "webrtc/base/thread.h"
 #include "webrtc/base/thread_checker.h"
+#include "webrtc/base/timeutils.h"
 #include "webrtc/common_types.h"
 #include "webrtc/modules/rtp_rtcp/source/h264_bitstream_parser.h"
 #include "webrtc/modules/video_coding/include/video_codec_interface.h"
@@ -524,7 +525,7 @@
   frames_dropped_media_encoder_ = 0;
   consecutive_full_queue_frame_drops_ = 0;
   current_timestamp_us_ = 0;
-  stat_start_time_ms_ = GetCurrentTimeMs();
+  stat_start_time_ms_ = rtc::TimeMillis();
   current_frames_ = 0;
   current_bytes_ = 0;
   current_acc_qp_ = 0;
@@ -612,7 +613,7 @@
   bool send_key_frame = false;
   if (codec_mode_ == webrtc::kRealtimeVideo) {
     ++frames_received_since_last_key_;
-    int64_t now_ms = GetCurrentTimeMs();
+    int64_t now_ms = rtc::TimeMillis();
     if (last_frame_received_ms_ != -1 &&
         (now_ms - last_frame_received_ms_) > kFrameDiffThresholdMs) {
       // Add limit to prevent triggering a key for every frame for very low
@@ -698,7 +699,7 @@
     return WEBRTC_VIDEO_CODEC_ERROR;
   }
 
-  const int64_t time_before_calling_encode = GetCurrentTimeMs();
+  const int64_t time_before_calling_encode = rtc::TimeMillis();
   const bool key_frame =
       frame_types->front() != webrtc::kVideoFrameDelta || send_key_frame;
   bool encode_status = true;
@@ -950,7 +951,7 @@
       output_render_time_ms_ = frame_info.frame_render_time_ms;
       output_rotation_ = frame_info.rotation;
       frame_encoding_time_ms =
-          GetCurrentTimeMs() - frame_info.encode_start_time;
+          rtc::TimeMillis() - frame_info.encode_start_time;
       input_frame_infos_.pop_front();
     }
 
@@ -1113,7 +1114,7 @@
 }
 
 void MediaCodecVideoEncoder::LogStatistics(bool force_log) {
-  int statistic_time_ms = GetCurrentTimeMs() - stat_start_time_ms_;
+  int statistic_time_ms = rtc::TimeMillis() - stat_start_time_ms_;
   if ((statistic_time_ms >= kMediaCodecStatisticsIntervalMs || force_log) &&
       current_frames_ > 0 && statistic_time_ms > 0) {
     int current_bitrate = current_bytes_ * 8 / statistic_time_ms;
@@ -1126,7 +1127,7 @@
         ", encTime: " << (current_encoding_time_ms_ / current_frames_) <<
         ". QP: " << (current_acc_qp_ / current_frames_) <<
         " for last " << statistic_time_ms << " ms.";
-    stat_start_time_ms_ = GetCurrentTimeMs();
+    stat_start_time_ms_ = rtc::TimeMillis();
     current_frames_ = 0;
     current_bytes_ = 0;
     current_acc_qp_ = 0;