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

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

Issue 1823413003: media : Return after rejecting promise in MediaDrmBridge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 if (client) { 383 if (client) {
384 MediaDrmBridgeDelegate* delegate = 384 MediaDrmBridgeDelegate* delegate =
385 client->GetMediaDrmBridgeDelegate(scheme_uuid_); 385 client->GetMediaDrmBridgeDelegate(scheme_uuid_);
386 if (delegate) { 386 if (delegate) {
387 std::vector<uint8_t> init_data_from_delegate; 387 std::vector<uint8_t> init_data_from_delegate;
388 std::vector<std::string> optional_parameters_from_delegate; 388 std::vector<std::string> optional_parameters_from_delegate;
389 if (!delegate->OnCreateSession(init_data_type, init_data, 389 if (!delegate->OnCreateSession(init_data_type, init_data,
390 &init_data_from_delegate, 390 &init_data_from_delegate,
391 &optional_parameters_from_delegate)) { 391 &optional_parameters_from_delegate)) {
392 promise->reject(INVALID_ACCESS_ERROR, 0, "Invalid init data."); 392 promise->reject(INVALID_ACCESS_ERROR, 0, "Invalid init data.");
393 return;
393 } 394 }
394 if (!init_data_from_delegate.empty()) { 395 if (!init_data_from_delegate.empty()) {
395 j_init_data = 396 j_init_data =
396 base::android::ToJavaByteArray(env, init_data_from_delegate.data(), 397 base::android::ToJavaByteArray(env, init_data_from_delegate.data(),
397 init_data_from_delegate.size()); 398 init_data_from_delegate.size());
398 } 399 }
399 if (!optional_parameters_from_delegate.empty()) { 400 if (!optional_parameters_from_delegate.empty()) {
400 j_optional_parameters = base::android::ToJavaArrayOfStrings( 401 j_optional_parameters = base::android::ToJavaArrayOfStrings(
401 env, optional_parameters_from_delegate); 402 env, optional_parameters_from_delegate);
402 } 403 }
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 JNIEnv* env = AttachCurrentThread(); 881 JNIEnv* env = AttachCurrentThread();
881 882
882 ScopedJavaLocalRef<jbyteArray> j_response = base::android::ToJavaByteArray( 883 ScopedJavaLocalRef<jbyteArray> j_response = base::android::ToJavaByteArray(
883 env, reinterpret_cast<const uint8_t*>(response.data()), response.size()); 884 env, reinterpret_cast<const uint8_t*>(response.data()), response.size());
884 885
885 Java_MediaDrmBridge_processProvisionResponse(env, j_media_drm_.obj(), success, 886 Java_MediaDrmBridge_processProvisionResponse(env, j_media_drm_.obj(), success,
886 j_response.obj()); 887 j_response.obj());
887 } 888 }
888 889
889 } // namespace media 890 } // 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