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

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

Issue 1427183002: Move MediaDrmBridge provision communication to native side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reformatted media/ Created 5 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 unified diff | Download patch
« no previous file with comments | « media/media.gyp ('k') | no next file » | 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/media.h" 10 #include "media/base/media.h"
10 11
11 namespace media { 12 namespace media {
12 namespace internal { 13 namespace internal {
14 namespace {
15
16 // A temporary solution until we pass the proper CDM provision fetcher.
17 class DummyProvisionFetcher : public ProvisionFetcher {
18 public:
19 DummyProvisionFetcher() {}
20 ~DummyProvisionFetcher() final {}
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());
32 }
33
34 } // namespace (anonymous)
13 35
14 class AndroidMojoMediaClient : public PlatformMojoMediaClient { 36 class AndroidMojoMediaClient : public PlatformMojoMediaClient {
15 public: 37 public:
16 AndroidMojoMediaClient() {} 38 AndroidMojoMediaClient() {}
17 39
18 scoped_ptr<CdmFactory> CreateCdmFactory() override { 40 scoped_ptr<CdmFactory> CreateCdmFactory() override {
19 return make_scoped_ptr(new AndroidCdmFactory()); 41 return make_scoped_ptr(
42 new AndroidCdmFactory(base::Bind(&CreateDummyProvisionFetcher)));
20 } 43 }
21 44
22 private: 45 private:
23 DISALLOW_COPY_AND_ASSIGN(AndroidMojoMediaClient); 46 DISALLOW_COPY_AND_ASSIGN(AndroidMojoMediaClient);
24 }; 47 };
25 48
26 scoped_ptr<PlatformMojoMediaClient> CreatePlatformMojoMediaClient() { 49 scoped_ptr<PlatformMojoMediaClient> CreatePlatformMojoMediaClient() {
27 return make_scoped_ptr(new AndroidMojoMediaClient()); 50 return make_scoped_ptr(new AndroidMojoMediaClient());
28 } 51 }
29 52
30 } // namespace internal 53 } // namespace internal
31 } // namespace media 54 } // namespace media
OLDNEW
« no previous file with comments | « media/media.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698