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

Unified Diff: third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp

Issue 1964183004: Revert of Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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: third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp
index 540b4489bd8a134771d55ff36dd5cae01f50b7fe..c00c1968d992da965f41af455b7746bfb77b698e 100644
--- a/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp
+++ b/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp
@@ -49,12 +49,12 @@
return m_result;
}
- DOMArrayBuffer* data() const
+ const RefPtr<DOMArrayBuffer> data() const
{
return m_data;
}
- static PendingAction* CreatePendingSetServerCertificate(ContentDecryptionModuleResult* result, DOMArrayBuffer* serverCertificate)
+ static PendingAction* CreatePendingSetServerCertificate(ContentDecryptionModuleResult* result, PassRefPtr<DOMArrayBuffer> serverCertificate)
{
ASSERT(result);
ASSERT(serverCertificate);
@@ -68,18 +68,17 @@
DEFINE_INLINE_TRACE()
{
visitor->trace(m_result);
- visitor->trace(m_data);
}
private:
- PendingAction(ContentDecryptionModuleResult* result, DOMArrayBuffer* data)
+ PendingAction(ContentDecryptionModuleResult* result, PassRefPtr<DOMArrayBuffer> data)
: m_result(result)
, m_data(data)
{
}
const Member<ContentDecryptionModuleResult> m_result;
- const Member<DOMArrayBuffer> m_data;
+ const RefPtr<DOMArrayBuffer> m_data;
};
MediaKeys* MediaKeys::create(ExecutionContext* context, const WebVector<WebEncryptedMediaSessionType>& supportedSessionTypes, PassOwnPtr<WebContentDecryptionModule> cdm)
@@ -154,14 +153,14 @@
// 3. Let certificate be a copy of the contents of the serverCertificate
// parameter.
- DOMArrayBuffer* serverCertificateBuffer = DOMArrayBuffer::create(serverCertificate.data(), serverCertificate.byteLength());
+ RefPtr<DOMArrayBuffer> serverCertificateBuffer = DOMArrayBuffer::create(serverCertificate.data(), serverCertificate.byteLength());
// 4. Let promise be a new promise.
SimpleContentDecryptionModuleResultPromise* result = new SimpleContentDecryptionModuleResultPromise(scriptState);
ScriptPromise promise = result->promise();
// 5. Run the following steps asynchronously (documented in timerFired()).
- m_pendingActions.append(PendingAction::CreatePendingSetServerCertificate(result, serverCertificateBuffer));
+ m_pendingActions.append(PendingAction::CreatePendingSetServerCertificate(result, serverCertificateBuffer.release()));
if (!m_timer.isActive())
m_timer.startOneShot(0, BLINK_FROM_HERE);

Powered by Google App Engine
This is Rietveld 408576698