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

Side by Side Diff: ppapi/cpp/private/content_decryptor_private.cc

Issue 1102363005: Initialize the CDM asynchronously (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 5 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ppapi/cpp/private/content_decryptor_private.h" 5 #include "ppapi/cpp/private/content_decryptor_private.h"
6 6
7 #include <cstring> // memcpy 7 #include <cstring> // memcpy
8 8
9 #include "ppapi/c/ppb_var.h" 9 #include "ppapi/c/ppb_var.h"
10 #include "ppapi/c/private/ppb_content_decryptor_private.h" 10 #include "ppapi/c/private/ppb_content_decryptor_private.h"
11 #include "ppapi/c/private/ppp_content_decryptor_private.h" 11 #include "ppapi/c/private/ppp_content_decryptor_private.h"
12 #include "ppapi/cpp/instance.h" 12 #include "ppapi/cpp/instance.h"
13 #include "ppapi/cpp/instance_handle.h" 13 #include "ppapi/cpp/instance_handle.h"
14 #include "ppapi/cpp/logging.h" 14 #include "ppapi/cpp/logging.h"
15 #include "ppapi/cpp/module.h" 15 #include "ppapi/cpp/module.h"
16 #include "ppapi/cpp/module_impl.h" 16 #include "ppapi/cpp/module_impl.h"
17 #include "ppapi/cpp/var.h" 17 #include "ppapi/cpp/var.h"
18 #include "ppapi/cpp/var_array.h" 18 #include "ppapi/cpp/var_array.h"
19 19
20 namespace pp { 20 namespace pp {
21 21
22 namespace { 22 namespace {
23 23
24 static const char kPPPContentDecryptorInterface[] = 24 static const char kPPPContentDecryptorInterface[] =
25 PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE; 25 PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE;
26 26
27 void Initialize(PP_Instance instance, 27 void Initialize(PP_Instance instance,
28 uint32_t promise_id,
28 PP_Var key_system_arg, 29 PP_Var key_system_arg,
29 PP_Bool allow_distinctive_identifier, 30 PP_Bool allow_distinctive_identifier,
30 PP_Bool allow_persistent_state) { 31 PP_Bool allow_persistent_state) {
31 void* object = 32 void* object =
32 Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface); 33 Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface);
33 if (!object) 34 if (!object)
34 return; 35 return;
35 36
36 pp::Var key_system_var(pp::PASS_REF, key_system_arg); 37 pp::Var key_system_var(pp::PASS_REF, key_system_arg);
37 if (!key_system_var.is_string()) 38 if (!key_system_var.is_string())
38 return; 39 return;
39 40
40 static_cast<ContentDecryptor_Private*>(object)->Initialize( 41 static_cast<ContentDecryptor_Private*>(object)
41 key_system_var.AsString(), 42 ->Initialize(promise_id, key_system_var.AsString(),
bbudge 2015/05/05 17:40:03 Formatting is strange. Is this from clang format?
jrummell 2015/05/05 18:30:48 Yup.
42 PP_ToBool(allow_distinctive_identifier), 43 PP_ToBool(allow_distinctive_identifier),
43 PP_ToBool(allow_persistent_state)); 44 PP_ToBool(allow_persistent_state));
44 } 45 }
45 46
46 void SetServerCertificate(PP_Instance instance, 47 void SetServerCertificate(PP_Instance instance,
47 uint32_t promise_id, 48 uint32_t promise_id,
48 PP_Var server_certificate_arg) { 49 PP_Var server_certificate_arg) {
49 void* object = 50 void* object =
50 Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface); 51 Instance::GetPerInstanceObject(instance, kPPPContentDecryptorInterface);
51 if (!object) 52 if (!object)
52 return; 53 return;
53 54
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 const PP_DecryptedSampleInfo& decrypted_sample_info) { 430 const PP_DecryptedSampleInfo& decrypted_sample_info) {
430 if (has_interface<PPB_ContentDecryptor_Private>()) { 431 if (has_interface<PPB_ContentDecryptor_Private>()) {
431 get_interface<PPB_ContentDecryptor_Private>()->DeliverSamples( 432 get_interface<PPB_ContentDecryptor_Private>()->DeliverSamples(
432 associated_instance_.pp_instance(), 433 associated_instance_.pp_instance(),
433 audio_frames.pp_resource(), 434 audio_frames.pp_resource(),
434 &decrypted_sample_info); 435 &decrypted_sample_info);
435 } 436 }
436 } 437 }
437 438
438 } // namespace pp 439 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/private/content_decryptor_private.h ('k') | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698