Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Side by Side Diff: webrtc/modules/desktop_capture/mac/full_screen_chrome_window_detector.cc

Issue 1888593004: Delete all use of tick_util.h. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include "webrtc/modules/desktop_capture/mac/full_screen_chrome_window_detector. h" 11 #include "webrtc/modules/desktop_capture/mac/full_screen_chrome_window_detector. h"
12 12
13 #include <assert.h> 13 #include <assert.h>
14 #include <libproc.h> 14 #include <libproc.h>
15 #include <string> 15 #include <string>
16 16
17 #include "webrtc/base/macutils.h" 17 #include "webrtc/base/macutils.h"
18 #include "webrtc/base/timeutils.h"
18 #include "webrtc/modules/desktop_capture/mac/window_list_utils.h" 19 #include "webrtc/modules/desktop_capture/mac/window_list_utils.h"
19 #include "webrtc/system_wrappers/include/logging.h" 20 #include "webrtc/system_wrappers/include/logging.h"
20 21
21 22
22 namespace webrtc { 23 namespace webrtc {
23 24
24 namespace { 25 namespace {
25 26
26 const int64_t kUpdateIntervalMs = 500; 27 const int64_t kUpdateIntervalMs = 500;
27 28
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 156
156 if (full_screen_window_id == kCGNullWindowID) 157 if (full_screen_window_id == kCGNullWindowID)
157 return kCGNullWindowID; 158 return kCGNullWindowID;
158 159
159 for (WindowCapturer::WindowList::iterator it = previous_window_list_.begin(); 160 for (WindowCapturer::WindowList::iterator it = previous_window_list_.begin();
160 it != previous_window_list_.end(); ++it) { 161 it != previous_window_list_.end(); ++it) {
161 if (static_cast<CGWindowID>(it->id) != full_screen_window_id) 162 if (static_cast<CGWindowID>(it->id) != full_screen_window_id)
162 continue; 163 continue;
163 164
164 int64_t time_interval = 165 int64_t time_interval =
165 (TickTime::Now() - last_udpate_time_).Milliseconds(); 166 (rtc::TimeNanos() - last_update_time_) / rtc::kNumNanosecsPerMillisec;
166 LOG(LS_WARNING) << "The full-screen window exists in the list, " 167 LOG(LS_WARNING) << "The full-screen window exists in the list, "
167 << "which was updated " << time_interval << "ms ago."; 168 << "which was updated " << time_interval << "ms ago.";
168 return kCGNullWindowID; 169 return kCGNullWindowID;
169 } 170 }
170 171
171 return full_screen_window_id; 172 return full_screen_window_id;
172 } 173 }
173 174
174 void FullScreenChromeWindowDetector::UpdateWindowListIfNeeded( 175 void FullScreenChromeWindowDetector::UpdateWindowListIfNeeded(
175 CGWindowID original_window) { 176 CGWindowID original_window) {
176 if (IsChromeWindow(original_window) && 177 if (IsChromeWindow(original_window) &&
177 (TickTime::Now() - last_udpate_time_).Milliseconds() 178 (TickTime::Now() - last_udpate_time_).Milliseconds()
178 > kUpdateIntervalMs) { 179 > kUpdateIntervalMs) {
179 previous_window_list_.clear(); 180 previous_window_list_.clear();
180 previous_window_list_.swap(current_window_list_); 181 previous_window_list_.swap(current_window_list_);
181 182
182 // No need to update the window list when the window is minimized. 183 // No need to update the window list when the window is minimized.
183 if (IsWindowMinimized(original_window)) { 184 if (IsWindowMinimized(original_window)) {
184 previous_window_list_.clear(); 185 previous_window_list_.clear();
185 return; 186 return;
186 } 187 }
187 188
188 GetWindowList(&current_window_list_); 189 GetWindowList(&current_window_list_);
189 last_udpate_time_ = TickTime::Now(); 190 last_udpate_time_ = rtc::TimeNanos();
190 } 191 }
191 } 192 }
192 193
193 } // namespace webrtc 194 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698