Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROMECAST_MEDIA_CDM_BROWSER_CDM_CAST_H_ | 5 #ifndef CHROMECAST_MEDIA_CDM_BROWSER_CDM_CAST_H_ |
| 6 #define CHROMECAST_MEDIA_CDM_BROWSER_CDM_CAST_H_ | 6 #define CHROMECAST_MEDIA_CDM_BROWSER_CDM_CAST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/threading/thread_checker.h" | 17 #include "base/threading/thread_checker.h" |
| 18 #include "media/base/browser_cdm.h" | 18 #include "media/base/browser_cdm.h" |
| 19 #include "media/cdm/json_web_key.h" | 19 #include "media/cdm/json_web_key.h" |
| 20 | 20 |
| 21 namespace base { | 21 namespace base { |
| 22 class MessageLoopProxy; | 22 class SingleThreadTaskRunner; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace media { | 25 namespace media { |
| 26 class PlayerTrackerImpl; | 26 class PlayerTrackerImpl; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace chromecast { | 29 namespace chromecast { |
| 30 namespace media { | 30 namespace media { |
| 31 class DecryptContext; | 31 class DecryptContext; |
| 32 | 32 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 base::ThreadChecker thread_checker_; | 92 base::ThreadChecker thread_checker_; |
| 93 | 93 |
| 94 DISALLOW_COPY_AND_ASSIGN(BrowserCdmCast); | 94 DISALLOW_COPY_AND_ASSIGN(BrowserCdmCast); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 // BrowserCdm implementation that lives on the UI thread and forwards all calls | 97 // BrowserCdm implementation that lives on the UI thread and forwards all calls |
| 98 // to a BrowserCdmCast instance on the CMA thread. This is used to simplify the | 98 // to a BrowserCdmCast instance on the CMA thread. This is used to simplify the |
| 99 // UI-CMA threading interaction. | 99 // UI-CMA threading interaction. |
| 100 class BrowserCdmCastUi : public ::media::BrowserCdm { | 100 class BrowserCdmCastUi : public ::media::BrowserCdm { |
| 101 public: | 101 public: |
| 102 BrowserCdmCastUi( | 102 BrowserCdmCastUi(scoped_ptr<BrowserCdmCast> browser_cdm_cast, |
| 103 scoped_ptr<BrowserCdmCast> browser_cdm_cast, | 103 const scoped_refptr<base::SingleThreadTaskRunner>& cdm_loop); |
|
lcwu1
2015/05/19 01:45:38
s/cdm_loop/cdm_runner
gunsch
2015/05/19 03:01:58
Done.
| |
| 104 const scoped_refptr<base::MessageLoopProxy>& cdm_loop); | |
| 105 ~BrowserCdmCastUi() override; | 104 ~BrowserCdmCastUi() override; |
| 106 | 105 |
| 107 // PlayerTracker implementation: | 106 // PlayerTracker implementation: |
| 108 int RegisterPlayer(const base::Closure& new_key_cb, | 107 int RegisterPlayer(const base::Closure& new_key_cb, |
| 109 const base::Closure& cdm_unset_cb) override; | 108 const base::Closure& cdm_unset_cb) override; |
| 110 void UnregisterPlayer(int registration_id) override; | 109 void UnregisterPlayer(int registration_id) override; |
| 111 | 110 |
| 112 BrowserCdmCast* browser_cdm_cast() const; | 111 BrowserCdmCast* browser_cdm_cast() const; |
| 113 | 112 |
| 114 private: | 113 private: |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 127 void UpdateSession(const std::string& session_id, | 126 void UpdateSession(const std::string& session_id, |
| 128 const std::vector<uint8_t>& response, | 127 const std::vector<uint8_t>& response, |
| 129 scoped_ptr<::media::SimpleCdmPromise> promise) override; | 128 scoped_ptr<::media::SimpleCdmPromise> promise) override; |
| 130 void CloseSession(const std::string& session_id, | 129 void CloseSession(const std::string& session_id, |
| 131 scoped_ptr<::media::SimpleCdmPromise> promise) override; | 130 scoped_ptr<::media::SimpleCdmPromise> promise) override; |
| 132 void RemoveSession(const std::string& session_id, | 131 void RemoveSession(const std::string& session_id, |
| 133 scoped_ptr<::media::SimpleCdmPromise> promise) override; | 132 scoped_ptr<::media::SimpleCdmPromise> promise) override; |
| 134 ::media::CdmContext* GetCdmContext() override; | 133 ::media::CdmContext* GetCdmContext() override; |
| 135 | 134 |
| 136 scoped_ptr<BrowserCdmCast> browser_cdm_cast_; | 135 scoped_ptr<BrowserCdmCast> browser_cdm_cast_; |
| 137 scoped_refptr<base::MessageLoopProxy> cdm_loop_; | 136 scoped_refptr<base::SingleThreadTaskRunner> cdm_loop_; |
|
lcwu1
2015/05/19 01:45:38
Ditto.
gunsch
2015/05/19 03:01:58
Done.
| |
| 138 | 137 |
| 139 base::ThreadChecker thread_checker_; | 138 base::ThreadChecker thread_checker_; |
| 140 | 139 |
| 141 DISALLOW_COPY_AND_ASSIGN(BrowserCdmCastUi); | 140 DISALLOW_COPY_AND_ASSIGN(BrowserCdmCastUi); |
| 142 }; | 141 }; |
| 143 | 142 |
| 144 } // namespace media | 143 } // namespace media |
| 145 } // namespace chromecast | 144 } // namespace chromecast |
| 146 | 145 |
| 147 #endif // CHROMECAST_MEDIA_CDM_BROWSER_CDM_CAST_H_ | 146 #endif // CHROMECAST_MEDIA_CDM_BROWSER_CDM_CAST_H_ |
| OLD | NEW |