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

Side by Side Diff: content/browser/media/android/browser_surface_view_manager.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/browser/media/android/browser_surface_view_manager.h" 5 #include "content/browser/media/android/browser_surface_view_manager.h"
6 6
7 #include "base/android/build_info.h" 7 #include "base/android/build_info.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "content/browser/android/child_process_launcher_android.h" 9 #include "content/browser/android/child_process_launcher_android.h"
10 #include "content/browser/android/content_view_core_impl.h" 10 #include "content/browser/android/content_view_core_impl.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 render_frame_host_->GetRoutingID(), surface_id)); 99 render_frame_host_->GetRoutingID(), surface_id));
100 } 100 }
101 101
102 void BrowserSurfaceViewManager::SendDestroyingVideoSurfaceIfRequired( 102 void BrowserSurfaceViewManager::SendDestroyingVideoSurfaceIfRequired(
103 int surface_id) { 103 int surface_id) {
104 // Only send the surface destruction message on JB, where not doing it can 104 // Only send the surface destruction message on JB, where not doing it can
105 // cause a crash. 105 // cause a crash.
106 if (base::android::BuildInfo::GetInstance()->sdk_int() >= 18) 106 if (base::android::BuildInfo::GetInstance()->sdk_int() >= 18)
107 return; 107 return;
108 108
109 base::WaitableEvent waiter(false, false); 109 base::WaitableEvent waiter(base::WaitableEvent::ResetPolicy::AUTOMATIC,
110 base::WaitableEvent::InitialState::NOT_SIGNALED);
110 // Unretained is okay because we're waiting on the callback. 111 // Unretained is okay because we're waiting on the callback.
111 if (BrowserThread::PostTask( 112 if (BrowserThread::PostTask(
112 BrowserThread::IO, FROM_HERE, 113 BrowserThread::IO, FROM_HERE,
113 base::Bind(&SendDestroyingVideoSurfaceOnIO, surface_id, 114 base::Bind(&SendDestroyingVideoSurfaceOnIO, surface_id,
114 base::Bind(&base::WaitableEvent::Signal, 115 base::Bind(&base::WaitableEvent::Signal,
115 base::Unretained(&waiter))))) { 116 base::Unretained(&waiter))))) {
116 base::ThreadRestrictions::ScopedAllowWait allow_wait; 117 base::ThreadRestrictions::ScopedAllowWait allow_wait;
117 waiter.Wait(); 118 waiter.Wait();
118 } 119 }
119 } 120 }
120 121
121 } // namespace content 122 } // namespace content
OLDNEW
« no previous file with comments | « chrome/chrome_watcher/chrome_watcher_main.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698