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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 // Provides an interface to a Message Port Channel implementation. The object ow
ns itself and | 44 // Provides an interface to a Message Port Channel implementation. The object ow
ns itself and |
45 // is signalled that its not needed anymore with the destroy() call. | 45 // is signalled that its not needed anymore with the destroy() call. |
46 class WebMessagePortChannel { | 46 class WebMessagePortChannel { |
47 public: | 47 public: |
48 virtual void setClient(WebMessagePortChannelClient*) = 0; | 48 virtual void setClient(WebMessagePortChannelClient*) = 0; |
49 virtual void destroy() = 0; | 49 virtual void destroy() = 0; |
50 // WebKit versions of WebCore::MessagePortChannel. | 50 // WebKit versions of WebCore::MessagePortChannel. |
51 virtual void entangle(WebMessagePortChannel*) = 0; | 51 virtual void entangle(WebMessagePortChannel*) = 0; |
52 // Callee receives ownership of the passed vector. | 52 // Callee receives ownership of the passed vector. |
| 53 // FIXME: Blob refs should be passed to maintain ref counts. crbug.com/35175
3 |
53 virtual void postMessage(const WebString&, WebMessagePortChannelArray*) = 0; | 54 virtual void postMessage(const WebString&, WebMessagePortChannelArray*) = 0; |
54 virtual bool tryGetMessage(WebString*, WebMessagePortChannelArray&) = 0; | 55 virtual bool tryGetMessage(WebString*, WebMessagePortChannelArray&) = 0; |
55 | 56 |
56 protected: | 57 protected: |
57 ~WebMessagePortChannel() { } | 58 ~WebMessagePortChannel() { } |
58 }; | 59 }; |
59 | 60 |
60 } // namespace blink | 61 } // namespace blink |
61 | 62 |
62 #if INSIDE_BLINK | 63 #if INSIDE_BLINK |
63 | 64 |
64 namespace WTF { | 65 namespace WTF { |
65 | 66 |
66 template<typename T> struct OwnedPtrDeleter; | 67 template<typename T> struct OwnedPtrDeleter; |
67 template<> struct OwnedPtrDeleter<blink::WebMessagePortChannel> { | 68 template<> struct OwnedPtrDeleter<blink::WebMessagePortChannel> { |
68 static void deletePtr(blink::WebMessagePortChannel* channel) | 69 static void deletePtr(blink::WebMessagePortChannel* channel) |
69 { | 70 { |
70 if (channel) | 71 if (channel) |
71 channel->destroy(); | 72 channel->destroy(); |
72 } | 73 } |
73 }; | 74 }; |
74 | 75 |
75 } // namespace WTF | 76 } // namespace WTF |
76 | 77 |
77 #endif // INSIDE_BLINK | 78 #endif // INSIDE_BLINK |
78 | 79 |
79 #endif // WebMessagePortChannel_h | 80 #endif // WebMessagePortChannel_h |
OLD | NEW |