OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 WebSocketChannelClientProxy_h | 5 #ifndef WebSocketChannelClientProxy_h |
6 #define WebSocketChannelClientProxy_h | 6 #define WebSocketChannelClientProxy_h |
7 | 7 |
8 #include "modules/websockets/WebSocketChannelClient.h" | 8 #include "modules/websockets/WebSocketChannelClient.h" |
9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
10 #include "web/WebSocketImpl.h" | 10 #include "web/WebSocketImpl.h" |
11 #include "wtf/PassOwnPtr.h" | 11 #include "wtf/PassOwnPtr.h" |
12 #include "wtf/Vector.h" | 12 #include "wtf/Vector.h" |
13 #include "wtf/text/WTFString.h" | 13 #include "wtf/text/WTFString.h" |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 // Ideally we want to simply make WebSocketImpl inherit from | 17 // Ideally we want to simply make WebSocketImpl inherit from |
18 // WebSocketChannelClient, but we cannot do that because WebSocketChannelClient | 18 // WebSocketChannelClient, but we cannot do that because WebSocketChannelClient |
19 // needs to be on Oilpan's heap whereas WebSocketImpl cannot be on Oilpan's | 19 // needs to be on Oilpan's heap whereas WebSocketImpl cannot be on Oilpan's |
20 // heap. Thus we need to introduce a proxy class to decouple WebSocketImpl | 20 // heap. Thus we need to introduce a proxy class to decouple WebSocketImpl |
21 // from WebSocketChannelClient. | 21 // from WebSocketChannelClient. |
22 class WebSocketChannelClientProxy FINAL : public GarbageCollectedFinalized<WebSo
cketChannelClientProxy>, public blink::WebSocketChannelClient { | 22 class WebSocketChannelClientProxy FINAL : public GarbageCollectedFinalized<WebSo
cketChannelClientProxy>, public WebSocketChannelClient { |
23 USING_GARBAGE_COLLECTED_MIXIN(WebSocketChannelClientProxy) | 23 USING_GARBAGE_COLLECTED_MIXIN(WebSocketChannelClientProxy) |
24 public: | 24 public: |
25 static WebSocketChannelClientProxy* create(WebSocketImpl* impl) | 25 static WebSocketChannelClientProxy* create(WebSocketImpl* impl) |
26 { | 26 { |
27 return new WebSocketChannelClientProxy(impl); | 27 return new WebSocketChannelClientProxy(impl); |
28 } | 28 } |
29 | 29 |
30 virtual void didConnect(const String& subprotocol, const String& extensions)
OVERRIDE | 30 virtual void didConnect(const String& subprotocol, const String& extensions)
OVERRIDE |
31 { | 31 { |
32 m_impl->didConnect(subprotocol, extensions); | 32 m_impl->didConnect(subprotocol, extensions); |
(...skipping 30 matching lines...) Expand all Loading... |
63 : m_impl(impl) | 63 : m_impl(impl) |
64 { | 64 { |
65 } | 65 } |
66 | 66 |
67 WebSocketImpl* m_impl; | 67 WebSocketImpl* m_impl; |
68 }; | 68 }; |
69 | 69 |
70 } // namespace blink | 70 } // namespace blink |
71 | 71 |
72 #endif // WebSocketChannelClientProxy_h | 72 #endif // WebSocketChannelClientProxy_h |
OLD | NEW |