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 #include "media/mojo/services/mojo_cdm.h" | 5 #include "media/mojo/services/mojo_cdm.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "media/base/cdm_key_information.h" | 9 #include "media/base/cdm_key_information.h" |
10 #include "media/base/cdm_promise.h" | 10 #include "media/base/cdm_promise.h" |
11 #include "media/mojo/services/media_type_converters.h" | 11 #include "media/mojo/services/media_type_converters.h" |
12 #include "third_party/mojo/src/mojo/public/cpp/application/connect.h" | 12 #include "mojo/application/public/cpp/connect.h" |
| 13 #include "mojo/application/public/interfaces/service_provider.mojom.h" |
13 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_impl.h" | 14 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_impl.h" |
14 #include "third_party/mojo/src/mojo/public/interfaces/application/service_provid
er.mojom.h" | |
15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
16 | 16 |
17 namespace media { | 17 namespace media { |
18 | 18 |
19 template <typename PromiseType> | 19 template <typename PromiseType> |
20 static void RejectPromise(scoped_ptr<PromiseType> promise, | 20 static void RejectPromise(scoped_ptr<PromiseType> promise, |
21 mojo::CdmPromiseResultPtr result) { | 21 mojo::CdmPromiseResultPtr result) { |
22 promise->reject(static_cast<MediaKeys::Exception>(result->exception), | 22 promise->reject(static_cast<MediaKeys::Exception>(result->exception), |
23 result->system_code, result->error_message); | 23 result->system_code, result->error_message); |
24 } | 24 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 key_data.Pass()); | 155 key_data.Pass()); |
156 } | 156 } |
157 | 157 |
158 void MojoCdm::OnSessionExpirationUpdate(const mojo::String& session_id, | 158 void MojoCdm::OnSessionExpirationUpdate(const mojo::String& session_id, |
159 double new_expiry_time_sec) { | 159 double new_expiry_time_sec) { |
160 session_expiration_update_cb_.Run( | 160 session_expiration_update_cb_.Run( |
161 session_id, base::Time::FromDoubleT(new_expiry_time_sec)); | 161 session_id, base::Time::FromDoubleT(new_expiry_time_sec)); |
162 } | 162 } |
163 | 163 |
164 } // namespace media | 164 } // namespace media |
OLD | NEW |