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

Side by Side Diff: sync/test/fake_server/android/fake_server_helper_android.cc

Issue 1312153003: jni_generator: Pass object parameters as JavaParamRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 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 | « sync/android/model_type_helper.cc ('k') | testing/android/native_test/native_test_launcher.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 "sync/test/fake_server/android/fake_server_helper_android.h" 5 #include "sync/test/fake_server/android/fake_server_helper_android.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 8
9 #include "base/android/jni_array.h" 9 #include "base/android/jni_array.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 12 matching lines...) Expand all
23 #include "sync/test/fake_server/tombstone_entity.h" 23 #include "sync/test/fake_server/tombstone_entity.h"
24 #include "sync/test/fake_server/unique_client_entity.h" 24 #include "sync/test/fake_server/unique_client_entity.h"
25 #include "testing/gtest/include/gtest/gtest.h" 25 #include "testing/gtest/include/gtest/gtest.h"
26 #include "url/gurl.h" 26 #include "url/gurl.h"
27 27
28 FakeServerHelperAndroid::FakeServerHelperAndroid(JNIEnv* env, jobject obj) { 28 FakeServerHelperAndroid::FakeServerHelperAndroid(JNIEnv* env, jobject obj) {
29 } 29 }
30 30
31 FakeServerHelperAndroid::~FakeServerHelperAndroid() { } 31 FakeServerHelperAndroid::~FakeServerHelperAndroid() { }
32 32
33 static jlong Init(JNIEnv* env, jobject obj) { 33 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) {
34 FakeServerHelperAndroid* fake_server_android = 34 FakeServerHelperAndroid* fake_server_android =
35 new FakeServerHelperAndroid(env, obj); 35 new FakeServerHelperAndroid(env, obj);
36 return reinterpret_cast<intptr_t>(fake_server_android); 36 return reinterpret_cast<intptr_t>(fake_server_android);
37 } 37 }
38 38
39 jlong FakeServerHelperAndroid::CreateFakeServer(JNIEnv* env, jobject obj) { 39 jlong FakeServerHelperAndroid::CreateFakeServer(JNIEnv* env, jobject obj) {
40 fake_server::FakeServer* fake_server = new fake_server::FakeServer(); 40 fake_server::FakeServer* fake_server = new fake_server::FakeServer();
41 return reinterpret_cast<intptr_t>(fake_server); 41 return reinterpret_cast<intptr_t>(fake_server);
42 } 42 }
43 43
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 reinterpret_cast<fake_server::FakeServer*>(fake_server); 291 reinterpret_cast<fake_server::FakeServer*>(fake_server);
292 std::string native_id = base::android::ConvertJavaStringToUTF8(env, id); 292 std::string native_id = base::android::ConvertJavaStringToUTF8(env, id);
293 fake_server_ptr->InjectEntity( 293 fake_server_ptr->InjectEntity(
294 fake_server::TombstoneEntity::Create(native_id)); 294 fake_server::TombstoneEntity::Create(native_id));
295 } 295 }
296 296
297 // static 297 // static
298 bool FakeServerHelperAndroid::Register(JNIEnv* env) { 298 bool FakeServerHelperAndroid::Register(JNIEnv* env) {
299 return RegisterNativesImpl(env); 299 return RegisterNativesImpl(env);
300 } 300 }
OLDNEW
« no previous file with comments | « sync/android/model_type_helper.cc ('k') | testing/android/native_test/native_test_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698