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

Side by Side Diff: media/mojo/services/android_mojo_media_client.cc

Issue 1473233005: Revert of media: Add ProvisionFetcher mojo interface and implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « media/mojo/services/BUILD.gn ('k') | media/mojo/services/default_mojo_media_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "media/mojo/services/mojo_media_client.h" 5 #include "media/mojo/services/mojo_media_client.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "media/base/android/android_cdm_factory.h" 8 #include "media/base/android/android_cdm_factory.h"
9 #include "media/base/bind_to_current_loop.h" 9 #include "media/base/bind_to_current_loop.h"
10 #include "media/base/media.h" 10 #include "media/base/media.h"
11 #include "media/mojo/interfaces/provision_fetcher.mojom.h"
12 #include "media/mojo/services/mojo_provision_fetcher.h"
13 #include "mojo/application/public/cpp/connect.h"
14 11
15 namespace media { 12 namespace media {
16 namespace internal { 13 namespace internal {
17
18 namespace { 14 namespace {
19 15
20 scoped_ptr<ProvisionFetcher> CreateProvisionFetcher( 16 // A temporary solution until we pass the proper CDM provision fetcher.
21 mojo::ServiceProvider* service_provider) { 17 class DummyProvisionFetcher : public ProvisionFetcher {
22 interfaces::ProvisionFetcherPtr provision_fetcher_ptr; 18 public:
23 mojo::ConnectToService(service_provider, &provision_fetcher_ptr); 19 DummyProvisionFetcher() {}
24 return make_scoped_ptr( 20 ~DummyProvisionFetcher() final {}
25 new MojoProvisionFetcher(std::move(provision_fetcher_ptr))); 21
22 // Retrieve() always fails for this fetcher.
23 void Retrieve(const std::string& default_url,
24 const std::string& request_data,
25 const ResponseCB& response_cb) final {
26 BindToCurrentLoop(response_cb).Run(false, "");
27 };
28 };
29
30 scoped_ptr<ProvisionFetcher> CreateDummyProvisionFetcher() {
31 return make_scoped_ptr(new DummyProvisionFetcher());
26 } 32 }
27 33
28 } // namespace (anonymous) 34 } // namespace (anonymous)
29 35
30 class AndroidMojoMediaClient : public PlatformMojoMediaClient { 36 class AndroidMojoMediaClient : public PlatformMojoMediaClient {
31 public: 37 public:
32 AndroidMojoMediaClient() {} 38 AndroidMojoMediaClient() {}
33 39
34 scoped_ptr<CdmFactory> CreateCdmFactory( 40 scoped_ptr<CdmFactory> CreateCdmFactory() override {
35 mojo::ServiceProvider* service_provider) override { 41 return make_scoped_ptr(
36 return make_scoped_ptr(new AndroidCdmFactory( 42 new AndroidCdmFactory(base::Bind(&CreateDummyProvisionFetcher)));
37 base::Bind(&CreateProvisionFetcher, service_provider)));
38 } 43 }
39 44
40 private: 45 private:
41 DISALLOW_COPY_AND_ASSIGN(AndroidMojoMediaClient); 46 DISALLOW_COPY_AND_ASSIGN(AndroidMojoMediaClient);
42 }; 47 };
43 48
44 scoped_ptr<PlatformMojoMediaClient> CreatePlatformMojoMediaClient() { 49 scoped_ptr<PlatformMojoMediaClient> CreatePlatformMojoMediaClient() {
45 return make_scoped_ptr(new AndroidMojoMediaClient()); 50 return make_scoped_ptr(new AndroidMojoMediaClient());
46 } 51 }
47 52
48 } // namespace internal 53 } // namespace internal
49 } // namespace media 54 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/BUILD.gn ('k') | media/mojo/services/default_mojo_media_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698