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

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

Issue 1006253002: Oilpan: have LifetimeNotifier<T> track its observers weakly. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 5 years, 9 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 | « Source/core/dom/ActiveDOMObject.cpp ('k') | Source/platform/LifecycleNotifier.h » ('j') | 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 ab06279ec9ca7922917f6431fef44fc8e3c76812..5352b3baa419df5f024dbd52e45bc7455525fde6 100644
--- a/Source/modules/webmidi/MIDIAccessInitializer.cpp
+++ b/Source/modules/webmidi/MIDIAccessInitializer.cpp
@@ -27,14 +27,12 @@ MIDIAccessInitializer::MIDIAccessInitializer(ScriptState* scriptState, const MID
, m_sysexPermissionResolved(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
+#if ENABLE(ASSERT)
+ // A prefinalizer has already been registered for ScriptPromiseResolver;
+ // 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()->unregisterPreFinalizer(*static_cast<ScriptPromiseResolver*>(this));
+#endif
ThreadState::current()->registerPreFinalizer(*this);
#endif
if (options.hasSysex())
@@ -51,6 +49,7 @@ MIDIAccessInitializer::~MIDIAccessInitializer()
void MIDIAccessInitializer::contextDestroyed()
{
dispose();
+ LifecycleObserver::contextDestroyed();
}
void MIDIAccessInitializer::dispose()
@@ -70,10 +69,8 @@ void MIDIAccessInitializer::dispose()
}
m_hasBeenDisposed = true;
-
-#if ENABLE(OILPAN)
- // Delegate to LifecycleObserver's prefinalizer.
- LifecycleObserver::dispose();
+#if ENABLE(OILPAN) && ENABLE(ASSERT)
+ ScriptPromiseResolver::dispose();
#endif
}
« no previous file with comments | « Source/core/dom/ActiveDOMObject.cpp ('k') | Source/platform/LifecycleNotifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698