| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "modules/webmidi/NavigatorWebMIDI.h" | 31 #include "modules/webmidi/NavigatorWebMIDI.h" |
| 32 | 32 |
| 33 #include "bindings/core/v8/ScriptPromise.h" | 33 #include "bindings/core/v8/ScriptPromise.h" |
| 34 #include "bindings/core/v8/ScriptPromiseResolver.h" | 34 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 35 #include "core/dom/DOMException.h" | 35 #include "core/dom/DOMException.h" |
| 36 #include "core/dom/Document.h" | 36 #include "core/dom/Document.h" |
| 37 #include "core/dom/ExecutionContext.h" | |
| 38 #include "core/frame/LocalFrame.h" | 37 #include "core/frame/LocalFrame.h" |
| 39 #include "core/frame/Navigator.h" | 38 #include "core/frame/Navigator.h" |
| 40 #include "core/frame/UseCounter.h" | 39 #include "core/frame/UseCounter.h" |
| 41 #include "modules/webmidi/MIDIAccessInitializer.h" | 40 #include "modules/webmidi/MIDIAccessInitializer.h" |
| 42 #include "modules/webmidi/MIDIOptions.h" | 41 #include "modules/webmidi/MIDIOptions.h" |
| 43 | 42 |
| 44 namespace blink { | 43 namespace blink { |
| 45 | 44 |
| 46 NavigatorWebMIDI::NavigatorWebMIDI(Navigator& navigator) | 45 NavigatorWebMIDI::NavigatorWebMIDI(Navigator& navigator) |
| 47 : Supplement<Navigator>(navigator) {} | 46 : Supplement<Navigator>(navigator) {} |
| (...skipping 25 matching lines...) Expand all Loading... |
| 73 | 72 |
| 74 ScriptPromise NavigatorWebMIDI::requestMIDIAccess(ScriptState* script_state, | 73 ScriptPromise NavigatorWebMIDI::requestMIDIAccess(ScriptState* script_state, |
| 75 const MIDIOptions& options) { | 74 const MIDIOptions& options) { |
| 76 if (!script_state->ContextIsValid()) { | 75 if (!script_state->ContextIsValid()) { |
| 77 return ScriptPromise::RejectWithDOMException( | 76 return ScriptPromise::RejectWithDOMException( |
| 78 script_state, | 77 script_state, |
| 79 DOMException::Create(kAbortError, "The frame is not working.")); | 78 DOMException::Create(kAbortError, "The frame is not working.")); |
| 80 } | 79 } |
| 81 | 80 |
| 82 UseCounter::CountCrossOriginIframe( | 81 UseCounter::CountCrossOriginIframe( |
| 83 *ToDocument(ExecutionContext::From(script_state)), | 82 *ToDocument(script_state->GetExecutionContext()), |
| 84 UseCounter::kRequestMIDIAccessIframe); | 83 UseCounter::kRequestMIDIAccessIframe); |
| 85 return MIDIAccessInitializer::Start(script_state, options); | 84 return MIDIAccessInitializer::Start(script_state, options); |
| 86 } | 85 } |
| 87 | 86 |
| 88 } // namespace blink | 87 } // namespace blink |
| OLD | NEW |