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

Side by Side Diff: Source/modules/webmidi/MIDIAccess.cpp

Issue 24070002: Web MIDI: MIDIInput/MIDIOutput should not have reference to MIDIAccess (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: (rebase) Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/bindings/v8/custom/V8MIDIOutputCustom.cpp ('k') | Source/modules/webmidi/MIDIInput.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 if (enable) 75 if (enable)
76 m_accessor->startSession(); 76 m_accessor->startSession();
77 else 77 else
78 permissionDenied(); 78 permissionDenied();
79 } 79 }
80 80
81 void MIDIAccess::didAddInputPort(const String& id, const String& manufacturer, c onst String& name, const String& version) 81 void MIDIAccess::didAddInputPort(const String& id, const String& manufacturer, c onst String& name, const String& version)
82 { 82 {
83 ASSERT(isMainThread()); 83 ASSERT(isMainThread());
84 84
85 // FIXME: Pass in |this| to create() method so we can filter system exclusiv e messages correctly. 85 m_inputs.append(MIDIInput::create(this, scriptExecutionContext(), id, manufa cturer, name, version));
86 m_inputs.append(MIDIInput::create(scriptExecutionContext(), id, manufacturer , name, version));
87 } 86 }
88 87
89 void MIDIAccess::didAddOutputPort(const String& id, const String& manufacturer, const String& name, const String& version) 88 void MIDIAccess::didAddOutputPort(const String& id, const String& manufacturer, const String& name, const String& version)
90 { 89 {
91 ASSERT(isMainThread()); 90 ASSERT(isMainThread());
92 91
93 unsigned portIndex = m_outputs.size(); 92 unsigned portIndex = m_outputs.size();
94 m_outputs.append(MIDIOutput::create(this, portIndex, scriptExecutionContext( ), id, manufacturer, name, version)); 93 m_outputs.append(MIDIOutput::create(this, portIndex, scriptExecutionContext( ), id, manufacturer, name, version));
95 } 94 }
96 95
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 177
179 void MIDIAccess::permissionDenied() 178 void MIDIAccess::permissionDenied()
180 { 179 {
181 ASSERT(isMainThread()); 180 ASSERT(isMainThread());
182 181
183 m_hasAccess = false; 182 m_hasAccess = false;
184 m_promise->reject(DOMError::create("SecurityError")); 183 m_promise->reject(DOMError::create("SecurityError"));
185 } 184 }
186 185
187 } // namespace WebCore 186 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/custom/V8MIDIOutputCustom.cpp ('k') | Source/modules/webmidi/MIDIInput.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698