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

Side by Side Diff: mojo/android/javatests/validation_test_util.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/usb_midi_device_factory_android.cc ('k') | mojo/android/system/base_run_loop.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 "mojo/android/javatests/validation_test_util.h" 5 #include "mojo/android/javatests/validation_test_util.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 19 matching lines...) Expand all
30 const JavaParamRef<jstring>& data_as_string) { 30 const JavaParamRef<jstring>& data_as_string) {
31 std::string input = 31 std::string input =
32 base::android::ConvertJavaStringToUTF8(env, data_as_string); 32 base::android::ConvertJavaStringToUTF8(env, data_as_string);
33 std::vector<uint8_t> data; 33 std::vector<uint8_t> data;
34 size_t num_handles; 34 size_t num_handles;
35 std::string error_message; 35 std::string error_message;
36 if (!test::ParseValidationTestInput( 36 if (!test::ParseValidationTestInput(
37 input, &data, &num_handles, &error_message)) { 37 input, &data, &num_handles, &error_message)) {
38 ScopedJavaLocalRef<jstring> j_error_message = 38 ScopedJavaLocalRef<jstring> j_error_message =
39 base::android::ConvertUTF8ToJavaString(env, error_message); 39 base::android::ConvertUTF8ToJavaString(env, error_message);
40 return Java_ValidationTestUtil_buildData(env, nullptr, 0, 40 return Java_ValidationTestUtil_buildData(env, nullptr, 0, j_error_message);
41 j_error_message.obj());
42 } 41 }
43 void* data_ptr = &data[0]; 42 void* data_ptr = &data[0];
44 if (!data_ptr) { 43 if (!data_ptr) {
45 DCHECK(!data.size()); 44 DCHECK(!data.size());
46 data_ptr = &data; 45 data_ptr = &data;
47 } 46 }
48 jobject byte_buffer = 47 jobject byte_buffer =
49 env->NewDirectByteBuffer(data_ptr, data.size()); 48 env->NewDirectByteBuffer(data_ptr, data.size());
50 return Java_ValidationTestUtil_buildData(env, byte_buffer, num_handles, 49 return Java_ValidationTestUtil_buildData(env, byte_buffer, num_handles,
51 nullptr); 50 nullptr);
52 } 51 }
53 52
54 } // namespace android 53 } // namespace android
55 } // namespace mojo 54 } // namespace mojo
OLDNEW
« no previous file with comments | « media/midi/usb_midi_device_factory_android.cc ('k') | mojo/android/system/base_run_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698