Chromium Code Reviews| Index: Source/modules/webmidi/MIDIAccessInitializer.cpp |
| diff --git a/Source/modules/webmidi/MIDIAccessInitializer.cpp b/Source/modules/webmidi/MIDIAccessInitializer.cpp |
| index 36d4b00cfd07e27b9eaeafeb009bca442a3078a4..18fc1085ad6d6dae3576fd676a8db4a23c17ed02 100644 |
| --- a/Source/modules/webmidi/MIDIAccessInitializer.cpp |
| +++ b/Source/modules/webmidi/MIDIAccessInitializer.cpp |
| @@ -22,6 +22,10 @@ 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. |
|
haraken
2015/01/28 09:53:10
Shall we add a FIXME?
sof
2015/01/28 09:56:42
Can do that, what did you have in mind? i.e., mult
haraken
2015/01/28 10:01:36
Avoid multiple prefinalizers and add an ASSERT abo
sof
2015/01/28 10:56:38
Done.
|
| + ThreadState::current()->unregisterPreFinalizer(*this); |
|
kouhei (in TOK)
2015/01/28 09:58:04
How about
ThreadState::current()->unregisterPreFin
sof
2015/01/28 10:56:38
Done.
|
| ThreadState::current()->registerPreFinalizer(*this); |
| #endif |
| if (options.hasSysex()) |
| @@ -42,6 +46,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() |