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

Side by Side Diff: media/base/android/media_drm_bridge.cc

Issue 1831103003: media : Return after rejecting promise in MediaDrmBridge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 9 months 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 | « no previous file | 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 (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 <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 if (client) { 340 if (client) {
341 MediaDrmBridgeDelegate* delegate = 341 MediaDrmBridgeDelegate* delegate =
342 client->GetMediaDrmBridgeDelegate(scheme_uuid_); 342 client->GetMediaDrmBridgeDelegate(scheme_uuid_);
343 if (delegate) { 343 if (delegate) {
344 std::vector<uint8_t> init_data_from_delegate; 344 std::vector<uint8_t> init_data_from_delegate;
345 std::vector<std::string> optional_parameters_from_delegate; 345 std::vector<std::string> optional_parameters_from_delegate;
346 if (!delegate->OnCreateSession(init_data_type, init_data, 346 if (!delegate->OnCreateSession(init_data_type, init_data,
347 &init_data_from_delegate, 347 &init_data_from_delegate,
348 &optional_parameters_from_delegate)) { 348 &optional_parameters_from_delegate)) {
349 promise->reject(INVALID_ACCESS_ERROR, 0, "Invalid init data."); 349 promise->reject(INVALID_ACCESS_ERROR, 0, "Invalid init data.");
350 return;
350 } 351 }
351 if (!init_data_from_delegate.empty()) { 352 if (!init_data_from_delegate.empty()) {
352 j_init_data = 353 j_init_data =
353 base::android::ToJavaByteArray(env, init_data_from_delegate.data(), 354 base::android::ToJavaByteArray(env, init_data_from_delegate.data(),
354 init_data_from_delegate.size()); 355 init_data_from_delegate.size());
355 } 356 }
356 if (!optional_parameters_from_delegate.empty()) { 357 if (!optional_parameters_from_delegate.empty()) {
357 j_optional_parameters = base::android::ToJavaArrayOfStrings( 358 j_optional_parameters = base::android::ToJavaArrayOfStrings(
358 env, optional_parameters_from_delegate); 359 env, optional_parameters_from_delegate);
359 } 360 }
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 JNIEnv* env = AttachCurrentThread(); 831 JNIEnv* env = AttachCurrentThread();
831 832
832 ScopedJavaLocalRef<jbyteArray> j_response = base::android::ToJavaByteArray( 833 ScopedJavaLocalRef<jbyteArray> j_response = base::android::ToJavaByteArray(
833 env, reinterpret_cast<const uint8_t*>(response.data()), response.size()); 834 env, reinterpret_cast<const uint8_t*>(response.data()), response.size());
834 835
835 Java_MediaDrmBridge_processProvisionResponse(env, j_media_drm_.obj(), success, 836 Java_MediaDrmBridge_processProvisionResponse(env, j_media_drm_.obj(), success,
836 j_response.obj()); 837 j_response.obj());
837 } 838 }
838 839
839 } // namespace media 840 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698