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

Side by Side Diff: content/browser/android/app_web_message_port.h

Issue 2422793002: HTML MessagePort as mojo::MessagePipeHandle (Closed)
Patch Set: Add missing ScopedAsyncTaskScheduler instance for the new unit tests; required by a recent change t… Created 3 years, 10 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 | « content/browser/android/DEPS ('k') | content/browser/android/app_web_message_port.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_ANDROID_APP_WEB_MESSAGE_PORT_H_
6 #define CONTENT_BROWSER_ANDROID_APP_WEB_MESSAGE_PORT_H_
7
8 #include "base/android/jni_weak_ref.h"
9 #include "content/common/message_port.h"
10
11 namespace content {
12
13 class AppWebMessagePort {
14 public:
15 static void CreateAndBindToJavaObject(
16 JNIEnv* env,
17 mojo::ScopedMessagePipeHandle handle,
18 const base::android::JavaRef<jobject>& jobject);
19
20 static std::vector<MessagePort> UnwrapJavaArray(
21 JNIEnv* env,
22 const base::android::JavaRef<jobjectArray>& jports);
23
24 // Methods called from Java.
25 void CloseMessagePort(
26 JNIEnv* env,
27 const base::android::JavaParamRef<jobject>& jcaller);
28 void PostMessage(
29 JNIEnv* env,
30 const base::android::JavaParamRef<jobject>& jcaller,
31 const base::android::JavaParamRef<jstring>& jmessage,
32 const base::android::JavaParamRef<jobjectArray>& jports);
33 jboolean DispatchNextMessage(
34 JNIEnv* env,
35 const base::android::JavaParamRef<jobject>& jcaller);
36 void StartReceivingMessages(
37 JNIEnv* env,
38 const base::android::JavaParamRef<jobject>& jcaller);
39
40 private:
41 explicit AppWebMessagePort(
42 JNIEnv* env,
43 mojo::ScopedMessagePipeHandle handle,
44 const base::android::JavaRef<jobject>& jobject);
45 ~AppWebMessagePort();
46
47 void OnMessagesAvailable();
48
49 MessagePort port_;
50 JavaObjectWeakGlobalRef java_ref_;
51
52 DISALLOW_COPY_AND_ASSIGN(AppWebMessagePort);
53 };
54
55 bool RegisterAppWebMessagePort(JNIEnv* env);
56
57 } // namespace content
58
59 #endif // CONTENT_BROWSER_ANDROID_APP_WEB_MESSAGE_PORT_H_
OLDNEW
« no previous file with comments | « content/browser/android/DEPS ('k') | content/browser/android/app_web_message_port.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698