Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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/base/android/media_drm_bridge.h" | 5 #include "media/base/android/media_drm_bridge.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
| 10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 426 } | 426 } |
| 427 | 427 |
| 428 void MediaDrmBridge::OnSessionMessage(JNIEnv* env, | 428 void MediaDrmBridge::OnSessionMessage(JNIEnv* env, |
| 429 jobject j_media_drm, | 429 jobject j_media_drm, |
| 430 jint j_session_id, | 430 jint j_session_id, |
| 431 jbyteArray j_message, | 431 jbyteArray j_message, |
| 432 jstring j_destination_url) { | 432 jstring j_destination_url) { |
| 433 uint32 session_id = j_session_id; | 433 uint32 session_id = j_session_id; |
| 434 std::vector<uint8> message; | 434 std::vector<uint8> message; |
| 435 JavaByteArrayToByteVector(env, j_message, &message); | 435 JavaByteArrayToByteVector(env, j_message, &message); |
| 436 std::string destination_url = ConvertJavaStringToUTF8(env, j_destination_url); | 436 GURL destination_gurl = GURL(ConvertJavaStringToUTF8(env, j_destination_url)); |
|
xhwang
2014/05/21 16:59:01
Can you move the GURL verification in BrowserMedia
| |
| 437 session_message_cb_.Run(session_id, message, destination_url); | 437 session_message_cb_.Run(session_id, message, destination_gurl); |
| 438 } | 438 } |
| 439 | 439 |
| 440 void MediaDrmBridge::OnSessionReady(JNIEnv* env, | 440 void MediaDrmBridge::OnSessionReady(JNIEnv* env, |
| 441 jobject j_media_drm, | 441 jobject j_media_drm, |
| 442 jint j_session_id) { | 442 jint j_session_id) { |
| 443 uint32 session_id = j_session_id; | 443 uint32 session_id = j_session_id; |
| 444 session_ready_cb_.Run(session_id); | 444 session_ready_cb_.Run(session_id); |
| 445 } | 445 } |
| 446 | 446 |
| 447 void MediaDrmBridge::OnSessionClosed(JNIEnv* env, | 447 void MediaDrmBridge::OnSessionClosed(JNIEnv* env, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 483 JNIEnv* env = AttachCurrentThread(); | 483 JNIEnv* env = AttachCurrentThread(); |
| 484 Java_MediaDrmBridge_resetDeviceCredentials(env, j_media_drm_.obj()); | 484 Java_MediaDrmBridge_resetDeviceCredentials(env, j_media_drm_.obj()); |
| 485 } | 485 } |
| 486 | 486 |
| 487 void MediaDrmBridge::OnResetDeviceCredentialsCompleted( | 487 void MediaDrmBridge::OnResetDeviceCredentialsCompleted( |
| 488 JNIEnv* env, jobject, bool success) { | 488 JNIEnv* env, jobject, bool success) { |
| 489 base::ResetAndReturn(&reset_credentials_cb_).Run(success); | 489 base::ResetAndReturn(&reset_credentials_cb_).Run(success); |
| 490 } | 490 } |
| 491 | 491 |
| 492 } // namespace media | 492 } // namespace media |
| OLD | NEW |