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

Side by Side Diff: media/base/cdm_initialized_promise.cc

Issue 2444683002: Move MediaKeys::Exception to CdmPromise::Exception (Closed)
Patch Set: include "media/base/media_keys.h" Created 4 years, 1 month 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 | « media/base/cdm_initialized_promise.h ('k') | media/base/cdm_promise.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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/cdm_initialized_promise.h" 5 #include "media/base/cdm_initialized_promise.h"
6 6
7 namespace media { 7 namespace media {
8 8
9 CdmInitializedPromise::CdmInitializedPromise( 9 CdmInitializedPromise::CdmInitializedPromise(
10 const CdmCreatedCB& cdm_created_cb, 10 const CdmCreatedCB& cdm_created_cb,
11 const scoped_refptr<MediaKeys>& cdm) 11 const scoped_refptr<MediaKeys>& cdm)
12 : cdm_created_cb_(cdm_created_cb), cdm_(cdm) {} 12 : cdm_created_cb_(cdm_created_cb), cdm_(cdm) {}
13 13
14 CdmInitializedPromise::~CdmInitializedPromise() { 14 CdmInitializedPromise::~CdmInitializedPromise() {
15 } 15 }
16 16
17 void CdmInitializedPromise::resolve() { 17 void CdmInitializedPromise::resolve() {
18 MarkPromiseSettled(); 18 MarkPromiseSettled();
19 cdm_created_cb_.Run(cdm_, ""); 19 cdm_created_cb_.Run(cdm_, "");
20 } 20 }
21 21
22 void CdmInitializedPromise::reject(MediaKeys::Exception exception_code, 22 void CdmInitializedPromise::reject(CdmPromise::Exception exception_code,
23 uint32_t system_code, 23 uint32_t system_code,
24 const std::string& error_message) { 24 const std::string& error_message) {
25 MarkPromiseSettled(); 25 MarkPromiseSettled();
26 cdm_created_cb_.Run(nullptr, error_message); 26 cdm_created_cb_.Run(nullptr, error_message);
27 // Usually after this |this| (and the |cdm_| within it) will be destroyed. 27 // Usually after this |this| (and the |cdm_| within it) will be destroyed.
28 } 28 }
29 29
30 } // namespace media 30 } // namespace media
OLDNEW
« no previous file with comments | « media/base/cdm_initialized_promise.h ('k') | media/base/cdm_promise.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698