Chromium Code Reviews| Index: Source/core/platform/graphics/ContentDecryptionModuleSession.cpp |
| diff --git a/Source/core/platform/network/BlobRegistryProxy.cpp b/Source/core/platform/graphics/ContentDecryptionModuleSession.cpp |
| similarity index 51% |
| copy from Source/core/platform/network/BlobRegistryProxy.cpp |
| copy to Source/core/platform/graphics/ContentDecryptionModuleSession.cpp |
| index 6cce6f997554bd3a08c60e258ec74e22ca1b95f2..e33a2130739704e25f0fefec05d448cd0384a17e 100644 |
| --- a/Source/core/platform/network/BlobRegistryProxy.cpp |
| +++ b/Source/core/platform/graphics/ContentDecryptionModuleSession.cpp |
| @@ -1,5 +1,5 @@ |
| /* |
| - * Copyright (C) 2010 Google Inc. All rights reserved. |
| + * Copyright (C) 2013 Google Inc. All rights reserved. |
| * |
| * Redistribution and use in source and binary forms, with or without |
| * modification, are permitted provided that the following conditions are |
| @@ -29,50 +29,61 @@ |
| */ |
| #include "config.h" |
| - |
| -#include "core/platform/network/BlobRegistryProxy.h" |
| +#include "core/platform/graphics/ContentDecryptionModuleSession.h" |
| #include "core/platform/KURL.h" |
| -#include "core/platform/network/BlobData.h" |
| +#include "core/platform/NotImplemented.h" |
| #include "public/platform/Platform.h" |
| -#include "public/platform/WebBlobData.h" |
| -#include "public/platform/WebBlobRegistry.h" |
| +#include "public/platform/WebContentDecryptionModule.h" |
| #include "public/platform/WebURL.h" |
| -#include <wtf/MainThread.h> |
| -#include <wtf/StdLibExtras.h> |
| +#include "wtf/Uint8Array.h" |
| namespace WebCore { |
| -BlobRegistry& blobRegistry() |
| +ContentDecryptionModuleSession::ContentDecryptionModuleSession(WebKit::WebContentDecryptionModule& ContentDecryptionModule, ContentDecryptionModuleSessionClient* client) |
|
abarth-chromium
2013/06/12 23:03:51
WebKit::WebContentDecryptionModule& -> WebKit:
ddorwin
2013/06/12 23:55:54
Done. I was trying to avoid calling leakPtr() at t
|
| + : m_client(client) |
| +{ |
| + m_session = adoptPtr(ContentDecryptionModule.createSession(this)); |
| + ASSERT(m_session); |
| +} |
| + |
| +ContentDecryptionModuleSession::~ContentDecryptionModuleSession() |
| +{ |
| +} |
| + |
| +String ContentDecryptionModuleSession::sessionId() const |
| +{ |
| + return m_session->sessionId(); |
| +} |
| + |
| +void ContentDecryptionModuleSession::generateKeyRequest(const String& mimeType, const Uint8Array& initData) |
| +{ |
| + m_session->generateKeyRequest(mimeType, initData.data(), initData.length()); |
| +} |
| + |
| +void ContentDecryptionModuleSession::update(const Uint8Array& key) |
| { |
| - ASSERT(isMainThread()); |
| - DEFINE_STATIC_LOCAL(BlobRegistryProxy, instance, ()); |
| - return instance; |
| + m_session->update(key.data(), key.length()); |
| } |
| -BlobRegistryProxy::BlobRegistryProxy() |
| - : m_webBlobRegistry(WebKit::Platform::current()->blobRegistry()) |
| +void ContentDecryptionModuleSession::close() |
| { |
| + m_session->close(); |
| } |
| -void BlobRegistryProxy::registerBlobURL(const KURL& url, PassOwnPtr<BlobData> blobData) |
| +void ContentDecryptionModuleSession::keyAdded() |
| { |
| - if (m_webBlobRegistry) { |
| - WebKit::WebBlobData webBlobData(blobData); |
| - m_webBlobRegistry->registerBlobURL(url, webBlobData); |
| - } |
| + m_client->keyAdded(); |
| } |
| -void BlobRegistryProxy::registerBlobURL(const KURL& url, const KURL& srcURL) |
| +void ContentDecryptionModuleSession::keyError(MediaKeyErrorCode errorCode, unsigned long systemCode) |
| { |
| - if (m_webBlobRegistry) |
| - m_webBlobRegistry->registerBlobURL(url, srcURL); |
| + m_client->keyError(static_cast<ContentDecryptionModuleSessionClient::MediaKeyErrorCode>(errorCode), systemCode); |
| } |
| -void BlobRegistryProxy::unregisterBlobURL(const KURL& url) |
| +void ContentDecryptionModuleSession::keyMessage(const unsigned char* message, size_t messageLength, const WebKit::WebURL& destinationURL) |
| { |
| - if (m_webBlobRegistry) |
| - m_webBlobRegistry->unregisterBlobURL(url); |
| + m_client->keyMessage(message, messageLength, destinationURL); |
| } |
| } // namespace WebCore |