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

Side by Side Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 2041033003: clang-tidy WaitableEvent refactor (Android side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0_windows
Patch Set: Created 4 years, 6 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/android/webmediaplayer_android.h" 5 #include "content/renderer/media/android/webmediaplayer_android.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 280
281 if (delegate_) { 281 if (delegate_) {
282 delegate_->PlayerGone(delegate_id_); 282 delegate_->PlayerGone(delegate_id_);
283 delegate_->RemoveObserver(delegate_id_); 283 delegate_->RemoveObserver(delegate_id_);
284 } 284 }
285 285
286 if (media_source_delegate_) { 286 if (media_source_delegate_) {
287 // Part of |media_source_delegate_| needs to be stopped on the media thread. 287 // Part of |media_source_delegate_| needs to be stopped on the media thread.
288 // Wait until |media_source_delegate_| is fully stopped before tearing 288 // Wait until |media_source_delegate_| is fully stopped before tearing
289 // down other objects. 289 // down other objects.
290 base::WaitableEvent waiter(false, false); 290 base::WaitableEvent waiter(base::WaitableEvent::ResetPolicy::AUTOMATIC,
291 base::WaitableEvent::InitialState::NOT_SIGNALED);
291 media_source_delegate_->Stop( 292 media_source_delegate_->Stop(
292 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&waiter))); 293 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&waiter)));
293 waiter.Wait(); 294 waiter.Wait();
294 } 295 }
295 } 296 }
296 297
297 void WebMediaPlayerAndroid::load(LoadType load_type, 298 void WebMediaPlayerAndroid::load(LoadType load_type,
298 const blink::WebMediaPlayerSource& source, 299 const blink::WebMediaPlayerSource& source,
299 CORSMode cors_mode) { 300 CORSMode cors_mode) {
300 // Only URL or MSE blob URL is supported. 301 // Only URL or MSE blob URL is supported.
(...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after
1678 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; 1679 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER;
1679 } else if (is_hls_url == is_hls) { 1680 } else if (is_hls_url == is_hls) {
1680 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; 1681 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER;
1681 } 1682 }
1682 UMA_HISTOGRAM_ENUMERATION( 1683 UMA_HISTOGRAM_ENUMERATION(
1683 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", 1684 "Media.Android.IsHttpLiveStreamingMediaPredictionResult",
1684 result, PREDICTION_RESULT_MAX); 1685 result, PREDICTION_RESULT_MAX);
1685 } 1686 }
1686 1687
1687 } // namespace content 1688 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/nested_message_pump_android.cc ('k') | media/audio/android/audio_android_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698