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

Side by Side Diff: media/blink/new_session_cdm_result_promise.h

Issue 651113002: Move CdmResultPromise to media/blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 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
« no previous file with comments | « media/blink/media_blink.gyp ('k') | media/blink/new_session_cdm_result_promise.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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 #ifndef MEDIA_BLINK_NEW_SESSION_CDM_RESULT_PROMISE_H_
6 #define MEDIA_BLINK_NEW_SESSION_CDM_RESULT_PROMISE_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "media/base/cdm_promise.h"
12 #include "media/base/media_export.h"
13 #include "media/base/media_keys.h"
14 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h"
15
16 namespace media {
17
18 typedef base::Callback<blink::WebContentDecryptionModuleResult::SessionStatus(
19 const std::string& web_session_id)> SessionInitializedCB;
20
21 // Special class for resolving a new session promise. Resolving a new session
22 // promise returns the session ID (as a string), but the blink promise needs
23 // to get passed a SessionStatus. This class converts the session id to a
24 // SessionStatus by calling |new_session_created_cb|.
25 class MEDIA_EXPORT NewSessionCdmResultPromise
26 : public CdmPromiseTemplate<std::string> {
27 public:
28 NewSessionCdmResultPromise(
29 const blink::WebContentDecryptionModuleResult& result,
30 const std::string& uma_name,
31 const SessionInitializedCB& new_session_created_cb);
32 virtual ~NewSessionCdmResultPromise();
33
34 // CdmPromiseTemplate<T> implementation.
35 virtual void resolve(const std::string& web_session_id) override;
36 virtual void reject(MediaKeys::Exception exception_code,
37 uint32 system_code,
38 const std::string& error_message) override;
39
40 private:
41 blink::WebContentDecryptionModuleResult web_cdm_result_;
42
43 // UMA name to report result to.
44 std::string uma_name_;
45
46 // Called on resolve() to convert the session ID into a SessionStatus to
47 // be reported to blink.
48 SessionInitializedCB new_session_created_cb_;
49
50 DISALLOW_COPY_AND_ASSIGN(NewSessionCdmResultPromise);
51 };
52
53 } // namespace media
54
55 #endif // MEDIA_BLINK_NEW_SESSION_CDM_RESULT_PROMISE_H_
OLDNEW
« no previous file with comments | « media/blink/media_blink.gyp ('k') | media/blink/new_session_cdm_result_promise.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698