From 55d06b4919b3f310c48dd9520679ca9c338ffca4 Mon Sep 17 00:00:00 2001 From: hiroshige Date: Mon, 15 Feb 2016 11:33:51 -0800 Subject: Revert of Reland "media: Refactor MojoMediaClient" with fix. (patchset #2 id:20001 of https://codereview.chromium.org/1690213002/ ) Reason for revert: Suspected to break a layout test on android. https://crbug.com/586902 Original issue's description: > Reland "media: Refactor MojoMediaClient" with fix. > > This reverts commit 29775799918ebeb0f2aedd554722e3db0c6211c2. > > Instead of specifying a platform based MojoMediaClient at compile time, > provide the capability of setting one at run time. This improves the flexibility > of using MojoMediaApplication in different cases. For example, on desktop, we > may want to run the MojoMediaApplication in the utility process (for the CDM > service) and in the GPU process (for hardware decoding). In those two cases, > we'll want to specify two different MojoMediaClients even though we are on the > same platform. > > TBR=alokp@chromium.org > BUG=570357,571155 TBR=alokp@chromium.org,jam@chromium.org,thakis@chromium.org,xhwang@chromium.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=586902,570357,571155 Review URL: https://codereview.chromium.org/1702453002 Cr-Commit-Position: refs/heads/master@{#375482} --- chromecast/browser/cast_content_browser_client.cc | 8 ++--- chromecast/media/mojo/BUILD.gn | 1 - chromecast/media/mojo/cast_mojo_media_client.cc | 37 +++++++++++++---------- chromecast/media/mojo/cast_mojo_media_client.h | 32 -------------------- 4 files changed, 24 insertions(+), 54 deletions(-) delete mode 100644 chromecast/media/mojo/cast_mojo_media_client.h (limited to 'chromecast') diff --git a/chromecast/browser/cast_content_browser_client.cc b/chromecast/browser/cast_content_browser_client.cc index 12a4754..aea55a6 100644 --- a/chromecast/browser/cast_content_browser_client.cc +++ b/chromecast/browser/cast_content_browser_client.cc @@ -52,7 +52,6 @@ #include "ui/gl/gl_switches.h" #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) -#include "chromecast/media/mojo/cast_mojo_media_client.h" // nogncheck because of conditional dependency. #include "media/mojo/services/mojo_media_application.h" // nogncheck #endif // ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS @@ -358,10 +357,9 @@ bool CastContentBrowserClient::CanCreateWindow( void CastContentBrowserClient::RegisterInProcessMojoApplications( StaticMojoApplicationMap* apps) { #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) - apps->insert(std::make_pair( - GURL("mojo:media"), - base::Bind(::media::MojoMediaApplication::CreateAppWithClient, - base::Bind(&media::CastMojoMediaClient::Create)))); + apps->insert( + std::make_pair(GURL("mojo:media"), + base::Bind(::media::MojoMediaApplication::CreateApp))); #endif } diff --git a/chromecast/media/mojo/BUILD.gn b/chromecast/media/mojo/BUILD.gn index f8e8ec1..f197973 100644 --- a/chromecast/media/mojo/BUILD.gn +++ b/chromecast/media/mojo/BUILD.gn @@ -10,7 +10,6 @@ assert(enable_mojo_media == "browser") source_set("mojo") { sources = [ "cast_mojo_media_client.cc", - "cast_mojo_media_client.h", ] public_deps = [ diff --git a/chromecast/media/mojo/cast_mojo_media_client.cc b/chromecast/media/mojo/cast_mojo_media_client.cc index 3a16021..e239269 100644 --- a/chromecast/media/mojo/cast_mojo_media_client.cc +++ b/chromecast/media/mojo/cast_mojo_media_client.cc @@ -2,26 +2,31 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromecast/media/mojo/cast_mojo_media_client.h" +#include "media/mojo/services/mojo_media_application.h" -namespace chromecast { -namespace media { - -CastMojoMediaClient::CastMojoMediaClient() {} +#include "media/mojo/services/mojo_media_client.h" -CastMojoMediaClient::~CastMojoMediaClient() {} +namespace { +class CastMojoMediaClient : public ::media::MojoMediaClient { + public: + CastMojoMediaClient() {} + ~CastMojoMediaClient() override {} -// static -scoped_ptr<::media::MojoMediaClient> CastMojoMediaClient::Create() { - return scoped_ptr<::media::MojoMediaClient>(new CastMojoMediaClient()); -} + // MojoMediaClient overrides. + void Initialize() override {} + scoped_ptr<::media::RendererFactory> CreateRendererFactory( + const scoped_refptr<::media::MediaLog>& media_log) override { + return scoped_ptr<::media::RendererFactory>(); + } -void CastMojoMediaClient::Initialize() {} + private: + DISALLOW_COPY_AND_ASSIGN(CastMojoMediaClient); +}; +} // namespace -scoped_ptr<::media::RendererFactory> CastMojoMediaClient::CreateRendererFactory( - const scoped_refptr<::media::MediaLog>& /* media_log */) { - return scoped_ptr<::media::RendererFactory>(); +namespace media { +// static +scoped_ptr MojoMediaClient::Create() { + return make_scoped_ptr(new CastMojoMediaClient()); } - } // namespace media -} // namespace chromecast diff --git a/chromecast/media/mojo/cast_mojo_media_client.h b/chromecast/media/mojo/cast_mojo_media_client.h deleted file mode 100644 index 1f7fcde..0000000 --- a/chromecast/media/mojo/cast_mojo_media_client.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2016 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. - -#ifndef CHROMECAST_MEDIA_MOJO_CAST_MOJO_MEDIA_CLIENT_H_ -#define CHROMECAST_MEDIA_MOJO_CAST_MOJO_MEDIA_CLIENT_H_ - -#include "media/mojo/services/mojo_media_client.h" - -namespace chromecast { -namespace media { - -class CastMojoMediaClient : public ::media::MojoMediaClient { - public: - CastMojoMediaClient(); - ~CastMojoMediaClient() override; - - static scoped_ptr<::media::MojoMediaClient> Create(); - - // MojoMediaClient overrides. - void Initialize() override; - scoped_ptr<::media::RendererFactory> CreateRendererFactory( - const scoped_refptr<::media::MediaLog>& media_log) override; - - private: - DISALLOW_COPY_AND_ASSIGN(CastMojoMediaClient); -}; - -} // namespace media -} // namespace chromecast - -#endif // CHROMECAST_MEDIA_MOJO_CAST_MOJO_MEDIA_CLIENT_H_ -- cgit v1.1