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

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

Issue 2253943004: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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_android.cc ('k') | media/mojo/common/media_type_converters.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/usb_midi_device_factory_android.h" 5 #include "media/midi/usb_midi_device_factory_android.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/android/context_utils.h" 9 #include "base/android/context_utils.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 callback_.Run(true, &devices_to_pass); 74 callback_.Run(true, &devices_to_pass);
75 } 75 }
76 76
77 // Called from the Java world. 77 // Called from the Java world.
78 void UsbMidiDeviceFactoryAndroid::OnUsbMidiDeviceAttached( 78 void UsbMidiDeviceFactoryAndroid::OnUsbMidiDeviceAttached(
79 JNIEnv* env, 79 JNIEnv* env,
80 const JavaParamRef<jobject>& caller, 80 const JavaParamRef<jobject>& caller,
81 const JavaParamRef<jobject>& device) { 81 const JavaParamRef<jobject>& device) {
82 delegate_->OnDeviceAttached( 82 delegate_->OnDeviceAttached(
83 base::WrapUnique(new UsbMidiDeviceAndroid(device, delegate_))); 83 base::MakeUnique<UsbMidiDeviceAndroid>(device, delegate_));
84 } 84 }
85 85
86 // Called from the Java world. 86 // Called from the Java world.
87 void UsbMidiDeviceFactoryAndroid::OnUsbMidiDeviceDetached( 87 void UsbMidiDeviceFactoryAndroid::OnUsbMidiDeviceDetached(
88 JNIEnv* env, 88 JNIEnv* env,
89 const JavaParamRef<jobject>& caller, 89 const JavaParamRef<jobject>& caller,
90 jint index) { 90 jint index) {
91 delegate_->OnDeviceDetached(index); 91 delegate_->OnDeviceDetached(index);
92 } 92 }
93 93
94 bool UsbMidiDeviceFactoryAndroid::RegisterUsbMidiDeviceFactory(JNIEnv* env) { 94 bool UsbMidiDeviceFactoryAndroid::RegisterUsbMidiDeviceFactory(JNIEnv* env) {
95 return RegisterNativesImpl(env); 95 return RegisterNativesImpl(env);
96 } 96 }
97 97
98 } // namespace midi 98 } // namespace midi
99 } // namespace media 99 } // namespace media
OLDNEW
« no previous file with comments | « media/midi/midi_manager_android.cc ('k') | media/mojo/common/media_type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698