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

Side by Side Diff: sky/shell/java_service_provider.cc

Issue 962043002: Expose Android sensors to via Mojo services (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Review comments Created 5 years, 9 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 | « sky/shell/BUILD.gn ('k') | sky/shell/org/domokit/sky/shell/JavaServiceProvider.java » ('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 "sky/shell/java_service_provider.h" 5 #include "sky/shell/java_service_provider.h"
6 6
7 #include "base/android/jni_android.h"
7 #include "jni/JavaServiceProvider_jni.h" 8 #include "jni/JavaServiceProvider_jni.h"
8 9
9 namespace sky { 10 namespace sky {
10 namespace shell { 11 namespace shell {
11 12
12 bool RegisterJavaServiceProvider(JNIEnv* env) { 13 bool RegisterJavaServiceProvider(JNIEnv* env) {
13 return RegisterNativesImpl(env); 14 return RegisterNativesImpl(env);
14 } 15 }
15 16
16 mojo::ScopedMessagePipeHandle CreateJavaServiceProvider() { 17 mojo::ScopedMessagePipeHandle CreateJavaServiceProvider() {
17 JNIEnv* env = base::android::AttachCurrentThread(); 18 JNIEnv* env = base::android::AttachCurrentThread();
18 return mojo::ScopedMessagePipeHandle( 19 return mojo::ScopedMessagePipeHandle(
19 mojo::MessagePipeHandle(Java_JavaServiceProvider_create(env))); 20 mojo::MessagePipeHandle(Java_JavaServiceProvider_create(
21 env, base::android::GetApplicationContext())));
20 } 22 }
21 23
22 } // namespace shell 24 } // namespace shell
23 } // namespace sky 25 } // namespace sky
OLDNEW
« no previous file with comments | « sky/shell/BUILD.gn ('k') | sky/shell/org/domokit/sky/shell/JavaServiceProvider.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698