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

Side by Side Diff: content/renderer/media/crypto/cdm_initialized_promise.cc

Issue 1102363005: Initialize the CDM asynchronously (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + Android compile changes 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
(Empty)
1 // Copyright 2015 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 "content/renderer/media/crypto/cdm_initialized_promise.h"
6
7 namespace content {
8
9 CdmInitializedPromise::CdmInitializedPromise(
10 const media::CdmCreatedCB& cdm_created_cb,
11 scoped_ptr<media::MediaKeys> cdm)
12 : cdm_created_cb_(cdm_created_cb), cdm_(cdm.Pass()) {
13 }
14
15 CdmInitializedPromise::~CdmInitializedPromise() {
16 }
17
18 void CdmInitializedPromise::resolve() {
19 MarkPromiseSettled();
20 cdm_created_cb_.Run(cdm_.Pass());
21 }
22
23 void CdmInitializedPromise::reject(media::MediaKeys::Exception exception_code,
24 uint32 system_code,
25 const std::string& error_message) {
26 MarkPromiseSettled();
27 cdm_created_cb_.Run(nullptr);
28 }
29
30 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/crypto/cdm_initialized_promise.h ('k') | content/renderer/media/crypto/ppapi_decryptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698