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

Side by Side Diff: mojo/android/javatests/init_library.cc

Issue 1351293002: Convert remaining scoped_ptr -> std::unique_ptr in //mojo/edk (minus js). (Closed) Base URL: https://github.com/domokit/mojo.git@edk_unique_ptr_5
Patch Set: oops, forgot to fix android 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 | « no previous file | mojo/dart/dart_snapshotter/main.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 "base/android/base_jni_onload.h" 5 #include "base/android/base_jni_onload.h"
6 #include "base/android/base_jni_registrar.h" 6 #include "base/android/base_jni_registrar.h"
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_registrar.h" 8 #include "base/android/jni_registrar.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "mojo/android/javatests/mojo_test_case.h" 10 #include "mojo/android/javatests/mojo_test_case.h"
(...skipping 10 matching lines...) Expand all
21 { "ValidationTestUtil", mojo::android::RegisterValidationTestUtil }, 21 { "ValidationTestUtil", mojo::android::RegisterValidationTestUtil },
22 }; 22 };
23 23
24 bool RegisterJNI(JNIEnv* env) { 24 bool RegisterJNI(JNIEnv* env) {
25 return base::android::RegisterJni(env) && 25 return base::android::RegisterJni(env) &&
26 RegisterNativeMethods(env, kMojoRegisteredMethods, 26 RegisterNativeMethods(env, kMojoRegisteredMethods,
27 arraysize(kMojoRegisteredMethods)); 27 arraysize(kMojoRegisteredMethods));
28 } 28 }
29 29
30 bool Init() { 30 bool Init() {
31 mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>( 31 // TODO(vtl): Use make_unique when C++14 is available.
32 mojo::embedder::Init(std::unique_ptr<mojo::embedder::PlatformSupport>(
32 new mojo::embedder::SimplePlatformSupport())); 33 new mojo::embedder::SimplePlatformSupport()));
33 return true; 34 return true;
34 } 35 }
35 36
36 } // namespace 37 } // namespace
37 38
38 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { 39 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
39 std::vector<base::android::RegisterCallback> register_callbacks; 40 std::vector<base::android::RegisterCallback> register_callbacks;
40 register_callbacks.push_back(base::Bind(&RegisterJNI)); 41 register_callbacks.push_back(base::Bind(&RegisterJNI));
41 std::vector<base::android::InitCallback> init_callbacks; 42 std::vector<base::android::InitCallback> init_callbacks;
42 init_callbacks.push_back(base::Bind(&Init)); 43 init_callbacks.push_back(base::Bind(&Init));
43 if (!base::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks) || 44 if (!base::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks) ||
44 !base::android::OnJNIOnLoadInit(init_callbacks)) 45 !base::android::OnJNIOnLoadInit(init_callbacks))
45 return -1; 46 return -1;
46 47
47 return JNI_VERSION_1_4; 48 return JNI_VERSION_1_4;
48 } 49 }
OLDNEW
« no previous file with comments | « no previous file | mojo/dart/dart_snapshotter/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698