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

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

Issue 1138163002: Passing scoped_ptr into ScopedVector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed file as suggested Created 5 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/cast/sender/external_video_encoder.cc ('k') | media/midi/midi_manager_usb_unittest.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_usb.h" 5 #include "media/midi/midi_manager_usb.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 return; 69 return;
70 input_stream_->OnReceivedData(device, 70 input_stream_->OnReceivedData(device,
71 endpoint_number, 71 endpoint_number,
72 data, 72 data,
73 size, 73 size,
74 time); 74 time);
75 } 75 }
76 76
77 void MidiManagerUsb::OnDeviceAttached(scoped_ptr<UsbMidiDevice> device) { 77 void MidiManagerUsb::OnDeviceAttached(scoped_ptr<UsbMidiDevice> device) {
78 int device_id = static_cast<int>(devices_.size()); 78 int device_id = static_cast<int>(devices_.size());
79 devices_.push_back(device.release()); 79 devices_.push_back(device.Pass());
80 AddPorts(devices_.back(), device_id); 80 AddPorts(devices_.back(), device_id);
81 } 81 }
82 82
83 void MidiManagerUsb::OnDeviceDetached(size_t index) { 83 void MidiManagerUsb::OnDeviceDetached(size_t index) {
84 if (index >= devices_.size()) { 84 if (index >= devices_.size()) {
85 return; 85 return;
86 } 86 }
87 UsbMidiDevice* device = devices_[index]; 87 UsbMidiDevice* device = devices_[index];
88 for (size_t i = 0; i < output_streams_.size(); ++i) { 88 for (size_t i = 0; i < output_streams_.size(); ++i) {
89 if (output_streams_[i]->jack().device == device) { 89 if (output_streams_[i]->jack().device == device) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 input_stream_->Add(jacks[j]); 154 input_stream_->Add(jacks[j]);
155 AddInputPort(MidiPortInfo(id, manufacturer, product_name, version, 155 AddInputPort(MidiPortInfo(id, manufacturer, product_name, version,
156 MIDI_PORT_OPENED)); 156 MIDI_PORT_OPENED));
157 } 157 }
158 } 158 }
159 return true; 159 return true;
160 } 160 }
161 161
162 } // namespace midi 162 } // namespace midi
163 } // namespace media 163 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/sender/external_video_encoder.cc ('k') | media/midi/midi_manager_usb_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698