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

Unified Diff: Source/modules/webmidi/MIDIAccessInitializer.cpp

Issue 873573005: Oilpan: merge MIDIAccessInitializer's prefinalizers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add cast to expected type + fixme Created 5 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webmidi/MIDIAccessInitializer.cpp
diff --git a/Source/modules/webmidi/MIDIAccessInitializer.cpp b/Source/modules/webmidi/MIDIAccessInitializer.cpp
index 36d4b00cfd07e27b9eaeafeb009bca442a3078a4..b1fda8518b9de403711e7e3cf868bc9992bff26a 100644
--- a/Source/modules/webmidi/MIDIAccessInitializer.cpp
+++ b/Source/modules/webmidi/MIDIAccessInitializer.cpp
@@ -22,6 +22,14 @@ MIDIAccessInitializer::MIDIAccessInitializer(ScriptState* scriptState, const MID
, m_requestSysex(false)
{
#if ENABLE(OILPAN)
+ // A prefinalizer has already been registered (as a LifecycleObserver);
+ // remove it and register a combined one, as the infrastructure doesn't
+ // support multiple prefinalizers for an object.
+ //
+ // FIXME: Oilpan: remove LifecycleObserver's need for a prefinalizer,
+ // and as a consequence, this unregistration step. If the former is independently
+ // removed, the unregisterPreFinalizer() call will assert.
+ ThreadState::current()->unregisterPreFinalizer(*static_cast<LifecycleObserver*>(this));
ThreadState::current()->registerPreFinalizer(*this);
#endif
if (options.hasSysex())
@@ -42,6 +50,11 @@ void MIDIAccessInitializer::dispose()
ASSERT(document);
if (MIDIController* controller = MIDIController::from(document->frame()))
controller->cancelSysexPermissionRequest(this);
+
+#if ENABLE(OILPAN)
+ // Delegate to LifecycleObserver's prefinalizer.
+ LifecycleObserver::dispose();
+#endif
}
ScriptPromise MIDIAccessInitializer::start()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698