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

Unified Diff: third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp

Issue 2707243006: [SharedArrayBuffer] Prevent SharedArrayBuffer being used in Web APIs (Closed)
Patch Set: remove unused checks Created 3 years, 8 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
Index: third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp b/third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp
index 576b0adc19411c9eca911e46b2ddb62fa9a50a3c..8c8fdd27ddf6b9fa0be0bb4751cdfd231c39e893 100644
--- a/third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp
+++ b/third_party/WebKit/Source/modules/webmidi/MIDIOutput.cpp
@@ -221,10 +221,10 @@ MIDIOutput::MIDIOutput(MIDIAccess* access,
MIDIOutput::~MIDIOutput() {}
-void MIDIOutput::send(DOMUint8Array* array,
+void MIDIOutput::send(const NotShared<DOMUint8Array>& array,
double timestamp,
ExceptionState& exceptionState) {
- DCHECK(array);
+ DCHECK(array.view());
if (timestamp == 0.0)
timestamp = now(getExecutionContext());
@@ -233,10 +233,11 @@ void MIDIOutput::send(DOMUint8Array* array,
// This should be performed even if |array| is invalid.
open();
- if (MessageValidator::validate(array, exceptionState,
- midiAccess()->sysexEnabled()))
- midiAccess()->sendMIDIData(m_portIndex, array->data(), array->length(),
- timestamp);
+ if (MessageValidator::validate(array.view(), exceptionState,
+ midiAccess()->sysexEnabled())) {
+ midiAccess()->sendMIDIData(m_portIndex, array.view()->data(),
+ array.view()->length(), timestamp);
+ }
}
void MIDIOutput::send(Vector<unsigned> unsignedData,
@@ -260,11 +261,12 @@ void MIDIOutput::send(Vector<unsigned> unsignedData,
arrayData[i] = unsignedData[i] & 0xff;
}
- send(array, timestamp, exceptionState);
+ send(NotShared<DOMUint8Array>(array), timestamp, exceptionState);
}
-void MIDIOutput::send(DOMUint8Array* data, ExceptionState& exceptionState) {
- DCHECK(data);
+void MIDIOutput::send(const NotShared<DOMUint8Array>& data,
+ ExceptionState& exceptionState) {
+ DCHECK(data.view());
send(data, 0.0, exceptionState);
}

Powered by Google App Engine
This is Rietveld 408576698