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

Unified Diff: Source/core/platform/graphics/ContentDecryptionModule.cpp

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/ContentDecryptionModule.cpp
diff --git a/Source/core/html/ime/InputMethodContext.cpp b/Source/core/platform/graphics/ContentDecryptionModule.cpp
similarity index 51%
copy from Source/core/html/ime/InputMethodContext.cpp
copy to Source/core/platform/graphics/ContentDecryptionModule.cpp
index 6723fbba788423b047956834c49e474ba01ca299..be34049b7478fa15975281ab26210345a419df7a 100644
--- a/Source/core/html/ime/InputMethodContext.cpp
+++ b/Source/core/platform/graphics/ContentDecryptionModule.cpp
@@ -29,74 +29,56 @@
*/
#include "config.h"
-#include "core/html/ime/InputMethodContext.h"
+#include "core/platform/graphics/ContentDecryptionModule.h"
-#include "core/html/ime/Composition.h"
+#include "core/platform/NotImplemented.h"
+#include "core/platform/graphics/ContentDecryptionModuleSession.h"
+#include "public/platform/Platform.h"
namespace WebCore {
-PassOwnPtr<InputMethodContext> InputMethodContext::create(HTMLElement* element)
+bool ContentDecryptionModule::supportsKeySystem(const String& keySystem)
{
- return adoptPtr(new InputMethodContext(element));
-}
-
-InputMethodContext::InputMethodContext(HTMLElement* element)
- : m_enabled(false)
- , m_composition(0)
- , m_element(element)
-{
- ScriptWrappable::init(this);
-}
-
-InputMethodContext::~InputMethodContext()
-{
-}
-
-Composition* InputMethodContext::composition() const
-{
- // FIXME: Implement this. This should lazily update the composition object
- // here.
- return m_composition.get();
-}
-
-bool InputMethodContext::enabled() const
-{
- // FIXME: Implement this. Enabled state may change between calls from user
- // action and the status should be retrieved here.
- return m_enabled;
-}
+ // FIXME: Chromium should handle this, possibly using
+ // MIMETypeRegistry::isSupportedEncryptedMediaMIMEType().
+ notImplemented();
+ if (keySystem == "org.w3.clearkey")
+ return true;
-void InputMethodContext::setEnabled(bool enabled)
-{
- // FIXME: Implement this. The enabled state should propagate to IME.
- m_enabled = enabled;
+ return false;
abarth-chromium 2013/06/12 23:03:51 You can just write: return keySystem == "org.w3.c
ddorwin 2013/06/12 23:55:54 Done.
}
-String InputMethodContext::locale() const
+// Factory method: Chromium-implementation
abarth-chromium 2013/06/12 23:03:51 No need for this comment.
ddorwin 2013/06/12 23:55:54 Done.
+PassOwnPtr<ContentDecryptionModule> ContentDecryptionModule::create(const String& keySystem)
{
- // FIXME: Implement this.
- return emptyString();
+ ASSERT(!keySystem.isNull() && !keySystem.isEmpty());
abarth-chromium 2013/06/12 23:03:51 isEmpty is a superset of isNull. You can just writ
ddorwin 2013/06/12 23:55:54 Done here and in MediaKeys.cpp.
+ OwnPtr<WebKit::WebContentDecryptionModule> cdm = adoptPtr(WebKit::Platform::current()->createContentDecryptionModule(keySystem));
+ if (!cdm)
+ return nullptr;
+ return adoptPtr(new ContentDecryptionModule(cdm.release()));
abarth-chromium 2013/06/12 23:03:51 No need to call adoptPtr here. You've already ado
abarth-chromium 2013/06/12 23:26:38 Oops, sorry. I misread the code. You're right.
}
-void InputMethodContext::confirmComposition()
+ContentDecryptionModule::ContentDecryptionModule(PassOwnPtr<WebKit::WebContentDecryptionModule> cdm)
+ : m_cdm(cdm)
{
- // FIXME: Implement this.
+ ASSERT(m_cdm);
}
-void InputMethodContext::setCaretRectangle(Node* anchor, int x, int y, int w, int h)
+ContentDecryptionModule::~ContentDecryptionModule()
{
- // FIXME: Implement this.
}
-void InputMethodContext::setExclusionRectangle(Node* anchor, int x, int y, int w, int h)
+bool ContentDecryptionModule::supportsMIMEType(const String& mimeType)
{
- // FIXME: Implement this.
+ // FIXME: Chromium should handle this, possibly using
+ // MIMETypeRegistry::isSupportedEncryptedMediaMIMEType().
+ notImplemented();
+ return mimeType == "video/webm";
}
-bool InputMethodContext::open()
+PassOwnPtr<ContentDecryptionModuleSession> ContentDecryptionModule::createSession(ContentDecryptionModuleSessionClient* client)
{
- // FIXME: Implement this.
- return false;
+ return adoptPtr(new ContentDecryptionModuleSession(*m_cdm, client));
}
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698