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

Side by Side Diff: sky/shell/android/platform_service_provider_android.cc

Issue 1169983005: sky/shell updates for Android and iOS (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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
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/android/platform_service_provider.h" 5 #include "sky/shell/android/platform_service_provider_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "jni/PlatformServiceProvider_jni.h" 10 #include "jni/PlatformServiceProvider_jni.h"
11 #include "mojo/public/cpp/bindings/interface_request.h" 11 #include "mojo/public/cpp/bindings/interface_request.h"
12 #include "sky/shell/service_provider.h" 12 #include "sky/shell/service_provider.h"
13 13
14 namespace sky { 14 namespace sky {
15 namespace shell { 15 namespace shell {
16 namespace { 16 namespace {
17 17
18 void CreatePlatformServiceProvider( 18 void CreatePlatformServiceProvider(
19 mojo::InterfaceRequest<mojo::ServiceProvider> request) { 19 mojo::InterfaceRequest<mojo::ServiceProvider> request) {
20 Java_PlatformServiceProvider_create( 20 Java_PlatformServiceProvider_create(
21 base::android::AttachCurrentThread(), 21 base::android::AttachCurrentThread(),
22 base::android::GetApplicationContext(), 22 base::android::GetApplicationContext(),
23 request.PassMessagePipe().release().value()); 23 request.PassMessagePipe().release().value());
24 } 24 }
25 25
26 } // namespace 26 } // namespace
27 27
28 bool RegisterPlatformServiceProvider(JNIEnv* env) { 28 bool RegisterPlatformServiceProvider(JNIEnv* env) {
29 return RegisterNativesImpl(env); 29 return RegisterNativesImpl(env);
30 } 30 }
31 31
32 mojo::ServiceProviderPtr CreateServiceProvider( 32 mojo::ServiceProviderPtr CreateServiceProvider(
33 ServiceProviderContext* context) { 33 ServiceProviderContext* context) {
34 mojo::MessagePipe pipe; 34 mojo::MessagePipe pipe;
35 context->java_task_runner->PostTask( 35 context->platform_task_runner->PostTask(
36 FROM_HERE, 36 FROM_HERE,
37 base::Bind(CreatePlatformServiceProvider, 37 base::Bind(CreatePlatformServiceProvider,
38 base::Passed(mojo::MakeRequest<mojo::ServiceProvider>( 38 base::Passed(mojo::MakeRequest<mojo::ServiceProvider>(
39 pipe.handle1.Pass())))); 39 pipe.handle1.Pass()))));
40 return mojo::MakeProxy( 40 return mojo::MakeProxy(
41 mojo::InterfacePtrInfo<mojo::ServiceProvider>(pipe.handle0.Pass(), 0u)); 41 mojo::InterfacePtrInfo<mojo::ServiceProvider>(pipe.handle0.Pass(), 0u));
42 } 42 }
43 43
44 } // namespace shell 44 } // namespace shell
45 } // namespace sky 45 } // namespace sky
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698