OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |