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_RENDERER_JAVA_JAVA_BRIDGE_CHANNEL_H_ | 5 #ifndef CONTENT_RENDERER_JAVA_JAVA_BRIDGE_CHANNEL_H_ |
6 #define CONTENT_RENDERER_JAVA_JAVA_BRIDGE_CHANNEL_H_ | 6 #define CONTENT_RENDERER_JAVA_JAVA_BRIDGE_CHANNEL_H_ |
7 #pragma once | |
8 | 7 |
9 #include "content/common/np_channel_base.h" | 8 #include "content/common/np_channel_base.h" |
10 #include "ipc/ipc_channel_handle.h" | 9 #include "ipc/ipc_channel_handle.h" |
11 | 10 |
12 class JavaBridgeChannel : public NPChannelBase { | 11 class JavaBridgeChannel : public NPChannelBase { |
13 public: | 12 public: |
14 static JavaBridgeChannel* GetJavaBridgeChannel( | 13 static JavaBridgeChannel* GetJavaBridgeChannel( |
15 const IPC::ChannelHandle& channel_handle, | 14 const IPC::ChannelHandle& channel_handle, |
16 base::MessageLoopProxy* ipc_message_loop); | 15 base::MessageLoopProxy* ipc_message_loop); |
17 | 16 |
18 // NPChannelBase implementation: | 17 // NPChannelBase implementation: |
19 virtual int GenerateRouteID() OVERRIDE; | 18 virtual int GenerateRouteID() OVERRIDE; |
20 | 19 |
21 // NPChannelBase override: | 20 // NPChannelBase override: |
22 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; | 21 virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE; |
23 | 22 |
24 private: | 23 private: |
25 JavaBridgeChannel(); | 24 JavaBridgeChannel(); |
26 // This class is ref-counted. | 25 // This class is ref-counted. |
27 virtual ~JavaBridgeChannel(); | 26 virtual ~JavaBridgeChannel(); |
28 | 27 |
29 static NPChannelBase* ClassFactory() { return new JavaBridgeChannel(); } | 28 static NPChannelBase* ClassFactory() { return new JavaBridgeChannel(); } |
30 | 29 |
31 DISALLOW_COPY_AND_ASSIGN(JavaBridgeChannel); | 30 DISALLOW_COPY_AND_ASSIGN(JavaBridgeChannel); |
32 }; | 31 }; |
33 | 32 |
34 #endif // CONTENT_RENDERER_JAVA_JAVA_BRIDGE_CHANNEL_H_ | 33 #endif // CONTENT_RENDERER_JAVA_JAVA_BRIDGE_CHANNEL_H_ |
OLD | NEW |