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

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

Issue 24469004: Amusingly deprecate the generic version of 'ExceptionState::throwDOMException'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 m_access->sendMIDIData(m_portIndex, data, length, timestamp); 74 m_access->sendMIDIData(m_portIndex, data, length, timestamp);
75 } 75 }
76 76
77 void MIDIOutput::send(Vector<unsigned> unsignedData, double timestamp, Exception State& es) 77 void MIDIOutput::send(Vector<unsigned> unsignedData, double timestamp, Exception State& es)
78 { 78 {
79 RefPtr<Uint8Array> array = Uint8Array::create(unsignedData.size()); 79 RefPtr<Uint8Array> array = Uint8Array::create(unsignedData.size());
80 80
81 for (size_t i = 0; i < unsignedData.size(); ++i) { 81 for (size_t i = 0; i < unsignedData.size(); ++i) {
82 if (unsignedData[i] > 0xff) { 82 if (unsignedData[i] > 0xff) {
83 es.throwDOMException(InvalidStateError); 83 es.throwUninformativeAndGenericDOMException(InvalidStateError);
84 return; 84 return;
85 } 85 }
86 unsigned char value = unsignedData[i] & 0xff; 86 unsigned char value = unsignedData[i] & 0xff;
87 array->set(i, value); 87 array->set(i, value);
88 } 88 }
89 89
90 send(array.get(), timestamp, es); 90 send(array.get(), timestamp, es);
91 } 91 }
92 92
93 void MIDIOutput::send(Uint8Array* data, ExceptionState& es) 93 void MIDIOutput::send(Uint8Array* data, ExceptionState& es)
94 { 94 {
95 send(data, 0, es); 95 send(data, 0, es);
96 } 96 }
97 97
98 void MIDIOutput::send(Vector<unsigned> unsignedData, ExceptionState& es) 98 void MIDIOutput::send(Vector<unsigned> unsignedData, ExceptionState& es)
99 { 99 {
100 send(unsignedData, 0, es); 100 send(unsignedData, 0, es);
101 } 101 }
102 102
103 } // namespace WebCore 103 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.cpp ('k') | Source/web/SharedWorkerRepository.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698