| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "webkit/renderer/media/android/proxy_media_keys.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 #include "webkit/renderer/media/android/webmediaplayer_proxy_android.h" | |
| 9 | |
| 10 namespace webkit_media { | |
| 11 | |
| 12 ProxyMediaKeys::ProxyMediaKeys(WebMediaPlayerProxyAndroid* proxy, | |
| 13 int media_keys_id) | |
| 14 : proxy_(proxy), media_keys_id_(media_keys_id) { | |
| 15 DCHECK(proxy_); | |
| 16 } | |
| 17 | |
| 18 bool ProxyMediaKeys::GenerateKeyRequest(const std::string& type, | |
| 19 const uint8* init_data, | |
| 20 int init_data_length) { | |
| 21 proxy_->GenerateKeyRequest( | |
| 22 media_keys_id_, | |
| 23 type, | |
| 24 std::vector<uint8>(init_data, init_data + init_data_length)); | |
| 25 return true; | |
| 26 } | |
| 27 | |
| 28 void ProxyMediaKeys::AddKey(const uint8* key, int key_length, | |
| 29 const uint8* init_data, int init_data_length, | |
| 30 const std::string& session_id) { | |
| 31 proxy_->AddKey(media_keys_id_, | |
| 32 std::vector<uint8>(key, key + key_length), | |
| 33 std::vector<uint8>(init_data, init_data + init_data_length), | |
| 34 session_id); | |
| 35 } | |
| 36 | |
| 37 void ProxyMediaKeys::CancelKeyRequest(const std::string& session_id) { | |
| 38 proxy_->CancelKeyRequest(media_keys_id_, session_id); | |
| 39 } | |
| 40 | |
| 41 } // namespace webkit_media | |
| OLD | NEW |