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

Unified Diff: Source/core/platform/graphics/ContentDecryptionModuleSession.h

Issue 16387015: Make unprefixed EME APIs use platform and Chromium. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: "unsigned" -> "size_t" for lengths Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/platform/graphics/ContentDecryptionModuleSession.h
diff --git a/Source/core/html/ime/InputMethodContext.h b/Source/core/platform/graphics/ContentDecryptionModuleSession.h
similarity index 51%
copy from Source/core/html/ime/InputMethodContext.h
copy to Source/core/platform/graphics/ContentDecryptionModuleSession.h
index 4315ea86e45649c521952c3a7a4c71db57c44f07..65e25eca9cd64fc42a8cc64fd099707d409db567 100644
--- a/Source/core/html/ime/InputMethodContext.h
+++ b/Source/core/platform/graphics/ContentDecryptionModuleSession.h
@@ -28,44 +28,57 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef InputMethodContext_h
-#define InputMethodContext_h
+#ifndef ContentDecryptionModuleSession_h
+#define ContentDecryptionModuleSession_h
-#include "bindings/v8/ScriptWrappable.h"
-#include "core/html/HTMLElement.h"
+#include "public/platform/WebContentDecryptionModuleSession.h"
+#include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h"
-#include "wtf/RefPtr.h"
#include "wtf/text/WTFString.h"
+namespace WebKit {
+class WebContentDecryptionModule;
+}
+
+namespace WTF {
+class Uint8Array;
+}
+
namespace WebCore {
-class Composition;
-class Node;
+class KURL;
-class InputMethodContext : public ScriptWrappable {
+class ContentDecryptionModuleSessionClient {
public:
- static PassOwnPtr<InputMethodContext> create(HTMLElement*);
- ~InputMethodContext();
+ enum MediaKeyErrorCode { UnknownError = 1, ClientError };
+ virtual void keyAdded() = 0;
+ virtual void keyError(MediaKeyErrorCode, unsigned long systemCode) = 0;
+ virtual void keyMessage(const unsigned char* message, size_t messageLength, const KURL& destinationURL) = 0;
+};
- void ref() { m_element->ref(); }
- void deref() { m_element->deref(); }
+class ContentDecryptionModuleSession : private WebKit::WebContentDecryptionModuleSession::Client {
+public:
+ static PassOwnPtr<ContentDecryptionModuleSession> create(ContentDecryptionModuleSessionClient*);
- Composition* composition() const;
- bool enabled() const;
- void setEnabled(bool);
- String locale() const;
- void confirmComposition();
- void setCaretRectangle(Node* anchor, int x, int y, int w, int h);
- void setExclusionRectangle(Node* anchor, int x, int y, int w, int h);
- bool open();
+ ContentDecryptionModuleSession(WebKit::WebContentDecryptionModule&, ContentDecryptionModuleSessionClient*);
+ ~ContentDecryptionModuleSession();
+
+ WTF::String sessionId() const;
abarth-chromium 2013/06/12 23:03:51 No need for the WTF:: prefix
ddorwin 2013/06/12 23:55:54 Done.
+ void generateKeyRequest(const WTF::String& mimeType, const WTF::Uint8Array& initData);
+ void update(const WTF::Uint8Array& key);
+ void close();
private:
- InputMethodContext(HTMLElement*);
- bool m_enabled;
- RefPtr<Composition> m_composition;
- HTMLElement* m_element;
+ // WebKit::WebContentDecryptionModuleSession::Client
+ virtual void keyAdded() OVERRIDE;
+ virtual void keyError(MediaKeyErrorCode, unsigned long systemCode) OVERRIDE;
+ virtual void keyMessage(const unsigned char* message, size_t messageLength, const WebKit::WebURL& destinationURL) OVERRIDE;
+
+ OwnPtr<WebKit::WebContentDecryptionModuleSession> m_session;
+
+ ContentDecryptionModuleSessionClient* m_client;
};
} // namespace WebCore
-#endif // InputMethodContext_h
+#endif // ContentDecryptionModuleSession_h

Powered by Google App Engine
This is Rietveld 408576698