OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 14 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef PlatformMessagePortChannelChromium_h | 31 #ifndef PlatformMessagePortChannelChromium_h |
32 #define PlatformMessagePortChannelChromium_h | 32 #define PlatformMessagePortChannelChromium_h |
33 | 33 |
34 | 34 |
35 #include "MessagePortChannel.h" | 35 #include "core/dom/MessagePortChannel.h" |
36 #include <public/WebMessagePortChannelClient.h> | 36 #include <public/WebMessagePortChannelClient.h> |
37 #include <wtf/PassRefPtr.h> | 37 #include <wtf/PassRefPtr.h> |
38 #include <wtf/Threading.h> | 38 #include <wtf/Threading.h> |
39 | 39 |
40 namespace WebKit { | 40 namespace WebKit { |
41 class WebMessagePortChannel; | 41 class WebMessagePortChannel; |
42 } | 42 } |
43 | 43 |
44 namespace WebCore { | 44 namespace WebCore { |
45 | 45 |
46 class MessagePort; | 46 class MessagePort; |
47 | 47 |
48 // PlatformMessagePortChannel is a platform-dependent interface to the remote si
de of a message channel. | 48 // PlatformMessagePortChannel is a platform-dependent interface to the remote si
de of a message channel. |
49 class PlatformMessagePortChannel : public ThreadSafeRefCounted<PlatformMessagePo
rtChannel>, | 49 class PlatformMessagePortChannel : public ThreadSafeRefCounted<PlatformMessagePo
rtChannel>, |
50 public WebKit::WebMessagePortChannelClient { | 50 public WebKit::WebMessagePortChannelClient { |
51 public: | 51 public: |
52 static void createChannel(PassRefPtr<MessagePort>, PassRefPtr<MessagePort>); | 52 static void createChannel(PassRefPtr<MessagePort>, PassRefPtr<MessagePort>); |
53 static PassRefPtr<PlatformMessagePortChannel> create(); | 53 static PassRefPtr<PlatformMessagePortChannel> create(); |
54 static PassRefPtr<PlatformMessagePortChannel> create(WebKit::WebMessagePortC
hannel*); | 54 static PassRefPtr<PlatformMessagePortChannel> create(WebKit::WebMessagePortC
hannel*); |
55 | 55 |
56 // APIs delegated from MessagePortChannel.h | 56 // APIs delegated from core/dom/MessagePortChannel.h |
57 bool entangleIfOpen(MessagePort*); | 57 bool entangleIfOpen(MessagePort*); |
58 void disentangle(); | 58 void disentangle(); |
59 void postMessageToRemote(PassRefPtr<SerializedScriptValue>, PassOwnPtr<Messa
gePortChannelArray>); | 59 void postMessageToRemote(PassRefPtr<SerializedScriptValue>, PassOwnPtr<Messa
gePortChannelArray>); |
60 bool tryGetMessageFromRemote(RefPtr<SerializedScriptValue>&, OwnPtr<MessageP
ortChannelArray>&); | 60 bool tryGetMessageFromRemote(RefPtr<SerializedScriptValue>&, OwnPtr<MessageP
ortChannelArray>&); |
61 void close(); | 61 void close(); |
62 bool isConnectedTo(MessagePort*); | 62 bool isConnectedTo(MessagePort*); |
63 bool hasPendingActivity(); | 63 bool hasPendingActivity(); |
64 | 64 |
65 // Releases ownership of the contained web channel. | 65 // Releases ownership of the contained web channel. |
66 WebKit::WebMessagePortChannel* webChannelRelease(); | 66 WebKit::WebMessagePortChannel* webChannelRelease(); |
(...skipping 17 matching lines...) Expand all Loading... |
84 | 84 |
85 // The port we are connected to - this is the port that is notified when new
messages arrive. | 85 // The port we are connected to - this is the port that is notified when new
messages arrive. |
86 MessagePort* m_localPort; | 86 MessagePort* m_localPort; |
87 | 87 |
88 WebKit::WebMessagePortChannel* m_webChannel; | 88 WebKit::WebMessagePortChannel* m_webChannel; |
89 }; | 89 }; |
90 | 90 |
91 } // namespace WebCore | 91 } // namespace WebCore |
92 | 92 |
93 #endif // PlatformMessagePortChannelChromium_h | 93 #endif // PlatformMessagePortChannelChromium_h |
OLD | NEW |