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

Side by Side Diff: media/midi/midi_manager_win.cc

Issue 1915443003: Replace scoped_ptr with std::unique_ptr in //media. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptr-media-base
Patch Set: scopedptr-media: rebase Created 4 years, 7 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
« no previous file with comments | « media/midi/midi_manager_win.h ('k') | media/midi/usb_midi_device.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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/midi/midi_manager_win.h" 5 #include "media/midi/midi_manager_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <ks.h> 8 #include <ks.h>
9 #include <ksmedia.h> 9 #include <ksmedia.h>
10 #include <mmreg.h> 10 #include <mmreg.h>
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 void operator()(MIDIHDR* header) { 87 void operator()(MIDIHDR* header) {
88 if (!header) 88 if (!header)
89 return; 89 return;
90 delete[] static_cast<char*>(header->lpData); 90 delete[] static_cast<char*>(header->lpData);
91 header->lpData = NULL; 91 header->lpData = NULL;
92 header->dwBufferLength = 0; 92 header->dwBufferLength = 0;
93 delete header; 93 delete header;
94 } 94 }
95 }; 95 };
96 96
97 typedef scoped_ptr<MIDIHDR, MIDIHDRDeleter> ScopedMIDIHDR; 97 using ScopedMIDIHDR = std::unique_ptr<MIDIHDR, MIDIHDRDeleter>;
98 98
99 ScopedMIDIHDR CreateMIDIHDR(size_t size) { 99 ScopedMIDIHDR CreateMIDIHDR(size_t size) {
100 ScopedMIDIHDR header(new MIDIHDR); 100 ScopedMIDIHDR header(new MIDIHDR);
101 ZeroMemory(header.get(), sizeof(*header)); 101 ZeroMemory(header.get(), sizeof(*header));
102 header->lpData = new char[size]; 102 header->lpData = new char[size];
103 header->dwBufferLength = static_cast<DWORD>(size); 103 header->dwBufferLength = static_cast<DWORD>(size);
104 return header; 104 return header;
105 } 105 }
106 106
107 void SendShortMidiMessageInternal(HMIDIOUT midi_out_handle, 107 void SendShortMidiMessageInternal(HMIDIOUT midi_out_handle,
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 base::TimeTicks time) { 1186 base::TimeTicks time) {
1187 ReceiveMidiData(port_index, &data[0], data.size(), time); 1187 ReceiveMidiData(port_index, &data[0], data.size(), time);
1188 } 1188 }
1189 1189
1190 MidiManager* MidiManager::Create() { 1190 MidiManager* MidiManager::Create() {
1191 return new MidiManagerWin(); 1191 return new MidiManagerWin();
1192 } 1192 }
1193 1193
1194 } // namespace midi 1194 } // namespace midi
1195 } // namespace media 1195 } // namespace media
OLDNEW
« no previous file with comments | « media/midi/midi_manager_win.h ('k') | media/midi/usb_midi_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698