Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULERESULT_HELPER_H_ | |
| 6 #define CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULERESULT_HELPER_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/memory/weak_ptr.h" | |
|
ddorwin
2014/09/23 18:57:31
not used
jrummell
2014/09/23 22:36:35
Done.
| |
| 13 #include "media/base/media_keys.h" | |
|
ddorwin
2014/09/23 18:57:31
used?
jrummell
2014/09/23 22:36:35
Needed for SimpleCdmPromise, NewSessionCdmPromise,
| |
| 14 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" | |
| 15 | |
| 16 namespace content { | |
| 17 | |
| 18 typedef base::Callback<blink::WebContentDecryptionModuleResult::SessionStatus( | |
| 19 const std::string& web_session_id)> NewSessionCreatedCB; | |
| 20 | |
| 21 class WebContentDecryptionModuleResultHelper { | |
| 22 public: | |
| 23 // Take a copy of |result| and keep it around until needed. Returns a | |
|
ddorwin
2014/09/23 18:57:31
s/Take/Make/
ddorwin
2014/09/23 18:57:31
The copy is an impl detail. The first sentence sho
jrummell
2014/09/23 22:36:35
Done.
jrummell
2014/09/23 22:36:35
Done.
| |
| 24 // SimpleCdmPromise that can be passed to the other methods to complete the | |
| 25 // WebContentDecryptionModuleResult. When SimpleCdmPromise is resolved, | |
| 26 // Complete() is called. If the SimpleCdmPromise is rejected, | |
| 27 // CompleteWithError() is called. | |
| 28 static scoped_ptr<media::SimpleCdmPromise> CreateSimpleCdmPromise( | |
| 29 blink::WebContentDecryptionModuleResult result); | |
| 30 | |
| 31 // Returns a NewSessionCdmPromise that can be passed to the other methods to | |
| 32 // complete the WebContentDecryptionModuleResult. When NewSessionCdmPromise is | |
| 33 // resolved, |new_session_created_cb| is called, and then the return value | |
| 34 // passed to CompleteWithSession(). If the NewSessionCdmPromise is rejected, | |
| 35 // CompleteWithError() is called, and |new_session_created_cb| is not called. | |
| 36 // |uma_name| is the name of a CdmPromiseResult UMA, and is used to report | |
| 37 // the promise result (success or rejection code). | |
| 38 static scoped_ptr<media::NewSessionCdmPromise> CreateNewSessionCdmPromise( | |
| 39 blink::WebContentDecryptionModuleResult result, | |
| 40 const NewSessionCreatedCB& new_session_created_cb, | |
|
ddorwin
2014/09/23 18:57:31
Is it a goal to eliminate this CB someday?
jrummell
2014/09/23 22:36:35
Somebody has to decide if this is a new session, a
| |
| 41 std::string uma_name); | |
|
ddorwin
2014/09/23 18:57:31
Why does only this one have a UMA? Do we not repor
jrummell
2014/09/23 22:36:35
UMA is only done for CreateSession. However, all C
| |
| 42 | |
| 43 // Take a copy of |result| and keep it around until needed. Returns a | |
| 44 // KeyIdsPromise that can be passed to the other methods to complete the | |
| 45 // WebContentDecryptionModuleResult. When KeyIdsPromise is resolved, | |
| 46 // CompleteWithKeyIds() is called. If the KeyIdsPromise is rejected, | |
| 47 // CompleteWithError() is called. | |
| 48 static scoped_ptr<media::KeyIdsPromise> CreateKeyIdsPromise( | |
| 49 blink::WebContentDecryptionModuleResult result); | |
| 50 | |
| 51 private: | |
| 52 DISALLOW_COPY_AND_ASSIGN(WebContentDecryptionModuleResultHelper); | |
|
ddorwin
2014/09/23 18:57:31
DISALLOW_IMPLICIT_CONSTRUCTORS - it should never b
jrummell
2014/09/23 22:36:35
Done.
| |
| 53 }; | |
| 54 | |
| 55 } // namespace content | |
| 56 | |
| 57 #endif // CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULERESULT_HELPER_H_ | |
| OLD | NEW |