OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_CHANNEL_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_CHANNEL_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_CHANNEL_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_CHANNEL_HOST_H_ |
7 | 7 |
8 #include "content/common/np_channel_base.h" | 8 #include "content/common/np_channel_base.h" |
9 | 9 |
10 class JavaBridgeChannelHost : public content::NPChannelBase { | 10 namespace content { |
| 11 |
| 12 class JavaBridgeChannelHost : public NPChannelBase { |
11 public: | 13 public: |
12 static JavaBridgeChannelHost* GetJavaBridgeChannelHost( | 14 static JavaBridgeChannelHost* GetJavaBridgeChannelHost( |
13 int renderer_id, | 15 int renderer_id, |
14 base::MessageLoopProxy* ipc_message_loop); | 16 base::MessageLoopProxy* ipc_message_loop); |
15 | 17 |
16 // A threadsafe function to generate a unique route ID. Used by the | 18 // A threadsafe function to generate a unique route ID. Used by the |
17 // JavaBridgeDispatcherHost on the UI thread and this class on the Java | 19 // JavaBridgeDispatcherHost on the UI thread and this class on the Java |
18 // Bridge's background thread. | 20 // Bridge's background thread. |
19 static int ThreadsafeGenerateRouteID(); | 21 static int ThreadsafeGenerateRouteID(); |
20 | 22 |
(...skipping 17 matching lines...) Expand all Loading... |
38 static NPChannelBase* ClassFactory() { | 40 static NPChannelBase* ClassFactory() { |
39 return new JavaBridgeChannelHost(); | 41 return new JavaBridgeChannelHost(); |
40 } | 42 } |
41 | 43 |
42 // Message handlers | 44 // Message handlers |
43 void OnGenerateRouteID(int* route_id); | 45 void OnGenerateRouteID(int* route_id); |
44 | 46 |
45 DISALLOW_COPY_AND_ASSIGN(JavaBridgeChannelHost); | 47 DISALLOW_COPY_AND_ASSIGN(JavaBridgeChannelHost); |
46 }; | 48 }; |
47 | 49 |
| 50 } // namespace content |
| 51 |
48 #endif // CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_CHANNEL_HOST_H_ | 52 #endif // CONTENT_BROWSER_RENDERER_HOST_JAVA_JAVA_BRIDGE_CHANNEL_HOST_H_ |
OLD | NEW |