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

Unified Diff: Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp

Issue 1233173002: Have ScriptPromiseResolver on the Oilpan heap always. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix webusb ScriptPromiseResolver usage Created 5 years, 4 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/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
diff --git a/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp b/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
index 90d4cf8c4290d84d9a03f05e5715e4b004811de6..8e4990ff63a9902b151bb26b328916cfe58d4322 100644
--- a/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
+++ b/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
@@ -50,7 +50,6 @@ static void throwExceptionIfMediaKeyExceptionOccurred(const String& keySystem, c
// This class allows MediaKeys to be set asynchronously.
class SetMediaKeysHandler : public ScriptPromiseResolver {
WTF_MAKE_NONCOPYABLE(SetMediaKeysHandler);
-
public:
static ScriptPromise create(ScriptState*, HTMLMediaElement&, MediaKeys*);
~SetMediaKeysHandler() override;
@@ -72,7 +71,7 @@ private:
// Keep media element alive until promise is fulfilled
RefPtrWillBeMember<HTMLMediaElement> m_element;
- PersistentWillBeMember<MediaKeys> m_newMediaKeys;
+ Member<MediaKeys> m_newMediaKeys;
bool m_tookOwnership;
Timer<SetMediaKeysHandler> m_timer;
};
@@ -128,7 +127,7 @@ private:
ScriptPromise SetMediaKeysHandler::create(ScriptState* scriptState, HTMLMediaElement& element, MediaKeys* mediaKeys)
{
- RefPtrWillBeRawPtr<SetMediaKeysHandler> handler = adoptRefWillBeNoop(new SetMediaKeysHandler(scriptState, element, mediaKeys));
+ SetMediaKeysHandler* handler = new SetMediaKeysHandler(scriptState, element, mediaKeys);
handler->suspendIfNeeded();
handler->keepAliveWhilePending();
return handler->promise();

Powered by Google App Engine
This is Rietveld 408576698