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

Unified Diff: content/browser/media/android/browser_surface_view_manager.cc

Issue 2481583003: Send the video surface destruction message on all Android versions (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/media/android/browser_surface_view_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/android/browser_surface_view_manager.cc
diff --git a/content/browser/media/android/browser_surface_view_manager.cc b/content/browser/media/android/browser_surface_view_manager.cc
index 00c51fe1590559dc2a266d69fd6ee75c2b40c573..7ce80ecbcc3833766f11bfb6279e8cd29fad0722 100644
--- a/content/browser/media/android/browser_surface_view_manager.cc
+++ b/content/browser/media/android/browser_surface_view_manager.cc
@@ -42,10 +42,10 @@ void BrowserSurfaceViewManager::SetVideoSurface(gl::ScopedJavaSurface surface) {
DCHECK_NE(surface_id_, media::SurfaceManager::kNoSurfaceID);
gpu::GpuSurfaceTracker::Get()->RemoveSurface(surface_id_);
gpu::GpuSurfaceTracker::Get()->UnregisterViewSurface(surface_id_);
- SendDestroyingVideoSurfaceIfRequired(surface_id_);
+ SendDestroyingVideoSurface(surface_id_);
surface_id_ = media::SurfaceManager::kNoSurfaceID;
} else {
- // We mainly use the surface tracker to allocate a surface id for us. The
+ // We just use the surface tracker to allocate a surface id for us. The
// lookup will go through the Android specific path and get the java
// surface directly, so there's no need to add a valid native widget here.
surface_id_ = gpu::GpuSurfaceTracker::Get()->AddSurfaceForNativeWidget(
@@ -57,7 +57,7 @@ void BrowserSurfaceViewManager::SetVideoSurface(gl::ScopedJavaSurface surface) {
}
void BrowserSurfaceViewManager::DidExitFullscreen(bool release_media_player) {
- DVLOG(3) << __FUNCTION__;
+ DVLOG(3) << __func__;
content_video_view_.reset();
}
@@ -104,13 +104,7 @@ bool BrowserSurfaceViewManager::SendSurfaceID(int surface_id) {
render_frame_host_->GetRoutingID(), surface_id));
}
-void BrowserSurfaceViewManager::SendDestroyingVideoSurfaceIfRequired(
- int surface_id) {
- // Only send the surface destruction message on JB, where not doing it can
- // cause a crash.
- if (base::android::BuildInfo::GetInstance()->sdk_int() >= 18)
- return;
-
+void BrowserSurfaceViewManager::SendDestroyingVideoSurface(int surface_id) {
base::WaitableEvent waiter(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
// Unretained is okay because we're waiting on the callback.
« no previous file with comments | « content/browser/media/android/browser_surface_view_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698