Index: media/blink/new_session_cdm_result_promise.h |
diff --git a/content/renderer/media/cdm_result_promise.h b/media/blink/new_session_cdm_result_promise.h |
similarity index 52% |
rename from content/renderer/media/cdm_result_promise.h |
rename to media/blink/new_session_cdm_result_promise.h |
index 13324e01f0bb07925826dde2a33c4526ee6ac9b5..8c2110a26cb15bcb0969eca9e18e2de38a4bea6a 100644 |
--- a/content/renderer/media/cdm_result_promise.h |
+++ b/media/blink/new_session_cdm_result_promise.h |
@@ -2,47 +2,18 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CONTENT_RENDERER_MEDIA_CDM_RESULT_PROMISE_H_ |
-#define CONTENT_RENDERER_MEDIA_CDM_RESULT_PROMISE_H_ |
+#ifndef MEDIA_BLINK_NEW_SESSION_CDM_RESULT_PROMISE_H_ |
+#define MEDIA_BLINK_NEW_SESSION_CDM_RESULT_PROMISE_H_ |
-#include <map> |
+#include <string> |
#include "base/basictypes.h" |
#include "media/base/cdm_promise.h" |
+#include "media/base/media_export.h" |
+#include "media/base/media_keys.h" |
#include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" |
-namespace content { |
- |
-// Used to convert a WebContentDecryptionModuleResult into a CdmPromiseTemplate |
-// so that it can be passed through Chromium. When resolve(T) is called, the |
-// appropriate complete...() method on WebContentDecryptionModuleResult will be |
-// invoked. If reject() is called instead, |
-// WebContentDecryptionModuleResult::completeWithError() is called. |
-// If constructed with a |uma_name|, CdmResultPromise will report the promise |
-// result (success or rejection code) to UMA. |
-template <typename... T> |
-class CdmResultPromise : public media::CdmPromiseTemplate<T...> { |
- public: |
- CdmResultPromise(const blink::WebContentDecryptionModuleResult& result, |
- const std::string& uma_name); |
- virtual ~CdmResultPromise(); |
- |
- // CdmPromiseTemplate<T> implementation. |
- virtual void resolve(const T&... result) override; |
- virtual void reject(media::MediaKeys::Exception exception_code, |
- uint32 system_code, |
- const std::string& error_message) override; |
- |
- private: |
- using media::CdmPromiseTemplate<T...>::MarkPromiseSettled; |
- |
- blink::WebContentDecryptionModuleResult web_cdm_result_; |
- |
- // UMA name to report result to. |
- std::string uma_name_; |
- |
- DISALLOW_COPY_AND_ASSIGN(CdmResultPromise); |
-}; |
+namespace media { |
typedef base::Callback<blink::WebContentDecryptionModuleResult::SessionStatus( |
const std::string& web_session_id)> SessionInitializedCB; |
@@ -51,7 +22,7 @@ typedef base::Callback<blink::WebContentDecryptionModuleResult::SessionStatus( |
// promise returns the session ID (as a string), but the blink promise needs |
// to get passed a SessionStatus. This class converts the session id to a |
// SessionStatus by calling |new_session_created_cb|. |
-class NewSessionCdmResultPromise |
+class MEDIA_EXPORT NewSessionCdmResultPromise |
: public media::CdmPromiseTemplate<std::string> { |
jrummell
2014/10/16 00:20:16
ditto on media::
xhwang
2014/10/16 04:25:44
Done.
|
public: |
NewSessionCdmResultPromise( |
@@ -79,6 +50,6 @@ class NewSessionCdmResultPromise |
DISALLOW_COPY_AND_ASSIGN(NewSessionCdmResultPromise); |
}; |
-} // namespace content |
+} // namespace media |
-#endif // CONTENT_RENDERER_MEDIA_CDM_RESULT_PROMISE_H_ |
+#endif // MEDIA_BLINK_NEW_SESSION_CDM_RESULT_PROMISE_H_ |