Chromium Code Reviews| Index: Source/modules/webmidi/MIDIAccessInitializer.cpp |
| diff --git a/Source/modules/webmidi/MIDIAccessInitializer.cpp b/Source/modules/webmidi/MIDIAccessInitializer.cpp |
| index 7fff2affa7b652bf8ba6a71304a0d224c7b5a4fb..ffa49a1ac4e2362eeac0240dad2b45ff1762b04f 100644 |
| --- a/Source/modules/webmidi/MIDIAccessInitializer.cpp |
| +++ b/Source/modules/webmidi/MIDIAccessInitializer.cpp |
| @@ -27,7 +27,10 @@ MIDIAccessInitializer::MIDIAccessInitializer(ScriptState* scriptState, const MID |
| MIDIAccessInitializer::~MIDIAccessInitializer() |
| { |
|
haraken
2014/12/18 14:42:46
What happens if MIDIAccessInitializer gets destruc
sof
2014/12/18 14:53:54
A permissions request will be made with the contro
haraken
2014/12/18 15:02:28
I'm wondering if it's possible that the MIDIAccess
sof
2014/12/18 15:17:57
If that's a concern, I can rephrase this to be a r
haraken
2014/12/18 15:44:02
Yeah, I guess a more straightforward approach woul
|
| - // It is safe to cancel a request which is already finished or canceld. |
| +} |
| + |
| +void MIDIAccessInitializer::cancel() |
| +{ |
| Document* document = toDocument(executionContext()); |
| ASSERT(document); |
| MIDIController* controller = MIDIController::from(document->frame()); |
| @@ -35,6 +38,13 @@ MIDIAccessInitializer::~MIDIAccessInitializer() |
| controller->cancelSysexPermissionRequest(this); |
| } |
| +void MIDIAccessInitializer::stop() |
| +{ |
| + // It is safe to cancel a request which is already finished or canceld. |
|
haraken
2014/12/18 14:42:46
canceled
|
| + cancel(); |
| + ScriptPromiseResolver::stop(); |
| +} |
| + |
| ScriptPromise MIDIAccessInitializer::start() |
| { |
| ScriptPromise promise = this->promise(); |