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

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

Issue 2209993003: Add missing using statements for JNI types. (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_output_port_android.cc ('k') | media/midi/usb_midi_device_factory_android.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_android.h" 5 #include "media/midi/usb_midi_device_android.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/android/jni_array.h" 9 #include "base/android/jni_array.h"
10 #include "base/i18n/icu_string_conversions.h" 10 #include "base/i18n/icu_string_conversions.h"
11 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "jni/UsbMidiDeviceAndroid_jni.h" 13 #include "jni/UsbMidiDeviceAndroid_jni.h"
14 #include "media/midi/usb_midi_descriptor_parser.h" 14 #include "media/midi/usb_midi_descriptor_parser.h"
15 15
16 using base::android::JavaParamRef;
17 using base::android::ScopedJavaLocalRef;
18
16 namespace media { 19 namespace media {
17 namespace midi { 20 namespace midi {
18 21
19 UsbMidiDeviceAndroid::UsbMidiDeviceAndroid( 22 UsbMidiDeviceAndroid::UsbMidiDeviceAndroid(
20 const base::android::JavaRef<jobject>& raw_device, 23 const base::android::JavaRef<jobject>& raw_device,
21 UsbMidiDeviceDelegate* delegate) 24 UsbMidiDeviceDelegate* delegate)
22 : raw_device_(raw_device), delegate_(delegate) { 25 : raw_device_(raw_device), delegate_(delegate) {
23 JNIEnv* env = base::android::AttachCurrentThread(); 26 JNIEnv* env = base::android::AttachCurrentThread();
24 Java_UsbMidiDeviceAndroid_registerSelf(env, raw_device_.obj(), 27 Java_UsbMidiDeviceAndroid_registerSelf(env, raw_device_.obj(),
25 reinterpret_cast<jlong>(this)); 28 reinterpret_cast<jlong>(this));
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 std::string encoded(reinterpret_cast<char*>(&descriptor[0]) + 2, size - 2); 141 std::string encoded(reinterpret_cast<char*>(&descriptor[0]) + 2, size - 2);
139 std::string result; 142 std::string result;
140 // Unicode ECN specifies that the string is encoded in UTF-16LE. 143 // Unicode ECN specifies that the string is encoded in UTF-16LE.
141 if (!base::ConvertToUtf8AndNormalize(encoded, "utf-16le", &result)) 144 if (!base::ConvertToUtf8AndNormalize(encoded, "utf-16le", &result))
142 return backup; 145 return backup;
143 return result; 146 return result;
144 } 147 }
145 148
146 } // namespace midi 149 } // namespace midi
147 } // namespace media 150 } // namespace media
OLDNEW
« no previous file with comments | « media/midi/midi_output_port_android.cc ('k') | media/midi/usb_midi_device_factory_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698