diff options
author | xhwang <xhwang@chromium.org> | 2014-12-23 21:32:28 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-24 05:33:06 +0000 |
commit | b3fb94776e472dff5236bff822a132cc06d23d8c (patch) | |
tree | cd450e7c2177eda9a94cc27d4e21fc4ac716223f /media | |
parent | f6c45017858d62e8e0ac1ce8a1c45bfe59b17b8e (diff) | |
download | chromium_src-b3fb94776e472dff5236bff822a132cc06d23d8c.zip chromium_src-b3fb94776e472dff5236bff822a132cc06d23d8c.tar.gz chromium_src-b3fb94776e472dff5236bff822a132cc06d23d8c.tar.bz2 |
Fix MojoCdmPromise resolving.
TBR=jrummell@chromium.org
BUG=432998
TEST=Manually tested.
R=jrummell@chromium.org
Review URL: https://codereview.chromium.org/817143003
Cr-Commit-Position: refs/heads/master@{#309619}
Diffstat (limited to 'media')
-rw-r--r-- | media/mojo/services/mojo_cdm_promise.cc | 2 | ||||
-rw-r--r-- | media/mojo/services/mojo_cdm_promise.h | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/media/mojo/services/mojo_cdm_promise.cc b/media/mojo/services/mojo_cdm_promise.cc index 3257bd8..4f17f11 100644 --- a/media/mojo/services/mojo_cdm_promise.cc +++ b/media/mojo/services/mojo_cdm_promise.cc @@ -40,6 +40,7 @@ MojoCdmPromise<T...>::~MojoCdmPromise() { template <typename... T> void MojoCdmPromise<T...>::resolve(const T&... result) { + MarkPromiseSettled(); mojo::CdmPromiseResultPtr cdm_promise_result(mojo::CdmPromiseResult::New()); cdm_promise_result->success = true; callback_.Run(cdm_promise_result.Pass(), @@ -51,6 +52,7 @@ template <typename... T> void MojoCdmPromise<T...>::reject(MediaKeys::Exception exception, uint32_t system_code, const std::string& error_message) { + MarkPromiseSettled(); callback_.Run(GetRejectResult(exception, system_code, error_message), MojoTypeTrait<T>::DefaultValue()...); callback_.reset(); diff --git a/media/mojo/services/mojo_cdm_promise.h b/media/mojo/services/mojo_cdm_promise.h index ea78fef..233d5b1 100644 --- a/media/mojo/services/mojo_cdm_promise.h +++ b/media/mojo/services/mojo_cdm_promise.h @@ -31,6 +31,8 @@ class MojoCdmPromise : public CdmPromiseTemplate<T...> { const std::string& error_message) final; private: + using media::CdmPromiseTemplate<T...>::MarkPromiseSettled; + CallbackType callback_; }; |