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

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

Issue 2237943002: Remove now-unnecessary .obj() in Java method calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@switch-context
Patch Set: Rebase *again* :( 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/midi/usb_midi_device_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_output_port_android.h" 5 #include "media/midi/midi_output_port_android.h"
6 6
7 #include "base/android/jni_array.h" 7 #include "base/android/jni_array.h"
8 #include "jni/MidiOutputPortAndroid_jni.h" 8 #include "jni/MidiOutputPortAndroid_jni.h"
9 9
10 using base::android::ScopedJavaLocalRef; 10 using base::android::ScopedJavaLocalRef;
11 11
12 namespace media { 12 namespace media {
13 namespace midi { 13 namespace midi {
14 14
15 MidiOutputPortAndroid::MidiOutputPortAndroid(JNIEnv* env, jobject raw) 15 MidiOutputPortAndroid::MidiOutputPortAndroid(JNIEnv* env, jobject raw)
16 : raw_port_(env, raw) {} 16 : raw_port_(env, raw) {}
17 MidiOutputPortAndroid::~MidiOutputPortAndroid() { 17 MidiOutputPortAndroid::~MidiOutputPortAndroid() {
18 Close(); 18 Close();
19 } 19 }
20 20
21 bool MidiOutputPortAndroid::Open() { 21 bool MidiOutputPortAndroid::Open() {
22 JNIEnv* env = base::android::AttachCurrentThread(); 22 JNIEnv* env = base::android::AttachCurrentThread();
23 return Java_MidiOutputPortAndroid_open(env, raw_port_.obj()); 23 return Java_MidiOutputPortAndroid_open(env, raw_port_);
24 } 24 }
25 25
26 void MidiOutputPortAndroid::Close() { 26 void MidiOutputPortAndroid::Close() {
27 JNIEnv* env = base::android::AttachCurrentThread(); 27 JNIEnv* env = base::android::AttachCurrentThread();
28 Java_MidiOutputPortAndroid_close(env, raw_port_.obj()); 28 Java_MidiOutputPortAndroid_close(env, raw_port_);
29 } 29 }
30 30
31 void MidiOutputPortAndroid::Send(const std::vector<uint8_t>& data) { 31 void MidiOutputPortAndroid::Send(const std::vector<uint8_t>& data) {
32 if (data.size() == 0) { 32 if (data.size() == 0) {
33 return; 33 return;
34 } 34 }
35 35
36 JNIEnv* env = base::android::AttachCurrentThread(); 36 JNIEnv* env = base::android::AttachCurrentThread();
37 ScopedJavaLocalRef<jbyteArray> data_to_pass = 37 ScopedJavaLocalRef<jbyteArray> data_to_pass =
38 base::android::ToJavaByteArray(env, &data[0], data.size()); 38 base::android::ToJavaByteArray(env, &data[0], data.size());
39 39
40 Java_MidiOutputPortAndroid_send(env, raw_port_.obj(), data_to_pass.obj()); 40 Java_MidiOutputPortAndroid_send(env, raw_port_, data_to_pass);
41 } 41 }
42 42
43 } // namespace midi 43 } // namespace midi
44 } // namespace media 44 } // namespace media
OLDNEW
« no previous file with comments | « media/midi/midi_manager_android.cc ('k') | media/midi/usb_midi_device_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698