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

Unified Diff: content/browser/android/surface_texture_peer_browser_impl.cc

Issue 634643002: content: Out-of-process GPU service support for SurfaceTexture backed GpuMemoryBuffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one last build fix Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/android/surface_texture_peer_browser_impl.h ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/surface_texture_peer_browser_impl.cc
diff --git a/content/browser/android/surface_texture_peer_browser_impl.cc b/content/browser/android/surface_texture_peer_browser_impl.cc
deleted file mode 100644
index b533bec292d5e93dc504da59a236895269d7933a..0000000000000000000000000000000000000000
--- a/content/browser/android/surface_texture_peer_browser_impl.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/browser/android/surface_texture_peer_browser_impl.h"
-
-#include "content/browser/frame_host/render_frame_host_impl.h"
-#include "content/browser/media/android/browser_media_player_manager.h"
-#include "content/browser/media/media_web_contents_observer.h"
-#include "content/browser/renderer_host/render_view_host_impl.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/render_process_host.h"
-#include "media/base/android/media_player_android.h"
-#include "ui/gl/android/scoped_java_surface.h"
-
-namespace content {
-
-namespace {
-
-// Pass a java surface object to the MediaPlayerAndroid object
-// identified by render process handle, render frame ID and player ID.
-static void SetSurfacePeer(
- scoped_refptr<gfx::SurfaceTexture> surface_texture,
- base::ProcessHandle render_process_handle,
- int render_frame_id,
- int player_id) {
- int render_process_id = 0;
- RenderProcessHost::iterator it = RenderProcessHost::AllHostsIterator();
- while (!it.IsAtEnd()) {
- if (it.GetCurrentValue()->GetHandle() == render_process_handle) {
- render_process_id = it.GetCurrentValue()->GetID();
- break;
- }
- it.Advance();
- }
- if (!render_process_id) {
- DVLOG(1) << "Cannot find render process for render_process_handle "
- << render_process_handle;
- return;
- }
-
- RenderFrameHostImpl* frame =
- RenderFrameHostImpl::FromID(render_process_id, render_frame_id);
- if (!frame) {
- DVLOG(1) << "Cannot find frame for render_frame_id " << render_frame_id;
- return;
- }
-
- RenderViewHostImpl* view =
- static_cast<RenderViewHostImpl*>(frame->GetRenderViewHost());
- BrowserMediaPlayerManager* player_manager =
- view->media_web_contents_observer()->GetMediaPlayerManager(frame);
- if (!player_manager) {
- DVLOG(1) << "Cannot find the media player manager for frame " << frame;
- return;
- }
-
- media::MediaPlayerAndroid* player = player_manager->GetPlayer(player_id);
- if (!player) {
- DVLOG(1) << "Cannot find media player for player_id " << player_id;
- return;
- }
-
- if (player != player_manager->GetFullscreenPlayer()) {
- gfx::ScopedJavaSurface scoped_surface(surface_texture.get());
- player->SetVideoSurface(scoped_surface.Pass());
- }
-}
-
-} // anonymous namespace
-
-SurfaceTexturePeerBrowserImpl::SurfaceTexturePeerBrowserImpl() {
-}
-
-SurfaceTexturePeerBrowserImpl::~SurfaceTexturePeerBrowserImpl() {
-}
-
-void SurfaceTexturePeerBrowserImpl::EstablishSurfaceTexturePeer(
- base::ProcessHandle render_process_handle,
- scoped_refptr<gfx::SurfaceTexture> surface_texture,
- int render_frame_id,
- int player_id) {
- if (!surface_texture.get())
- return;
-
- BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(
- &SetSurfacePeer, surface_texture, render_process_handle,
- render_frame_id, player_id));
-}
-
-} // namespace content
« no previous file with comments | « content/browser/android/surface_texture_peer_browser_impl.h ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698