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

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

Issue 1466633002: media: Add ProvisionFetcher mojo interface and implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix std::move use 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"
11 14
12 namespace media { 15 namespace media {
13 namespace internal { 16 namespace internal {
17
14 namespace { 18 namespace {
15 19
16 // A temporary solution until we pass the proper CDM provision fetcher. 20 scoped_ptr<ProvisionFetcher> CreateProvisionFetcher(
17 class DummyProvisionFetcher : public ProvisionFetcher { 21 mojo::ServiceProvider* service_provider) {
18 public: 22 interfaces::ProvisionFetcherPtr provision_fetcher_ptr;
19 DummyProvisionFetcher() {} 23 mojo::ConnectToService(service_provider, &provision_fetcher_ptr);
20 ~DummyProvisionFetcher() final {} 24 return make_scoped_ptr(
21 25 new MojoProvisionFetcher(std::move(provision_fetcher_ptr)));
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());
32 } 26 }
33 27
34 } // namespace (anonymous) 28 } // namespace (anonymous)
35 29
36 class AndroidMojoMediaClient : public PlatformMojoMediaClient { 30 class AndroidMojoMediaClient : public PlatformMojoMediaClient {
37 public: 31 public:
38 AndroidMojoMediaClient() {} 32 AndroidMojoMediaClient() {}
39 33
40 scoped_ptr<CdmFactory> CreateCdmFactory() override { 34 scoped_ptr<CdmFactory> CreateCdmFactory(
41 return make_scoped_ptr( 35 mojo::ServiceProvider* service_provider) override {
42 new AndroidCdmFactory(base::Bind(&CreateDummyProvisionFetcher))); 36 return make_scoped_ptr(new AndroidCdmFactory(
37 base::Bind(&CreateProvisionFetcher, service_provider)));
43 } 38 }
44 39
45 private: 40 private:
46 DISALLOW_COPY_AND_ASSIGN(AndroidMojoMediaClient); 41 DISALLOW_COPY_AND_ASSIGN(AndroidMojoMediaClient);
47 }; 42 };
48 43
49 scoped_ptr<PlatformMojoMediaClient> CreatePlatformMojoMediaClient() { 44 scoped_ptr<PlatformMojoMediaClient> CreatePlatformMojoMediaClient() {
50 return make_scoped_ptr(new AndroidMojoMediaClient()); 45 return make_scoped_ptr(new AndroidMojoMediaClient());
51 } 46 }
52 47
53 } // namespace internal 48 } // namespace internal
54 } // namespace media 49 } // 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