OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 void connect(const WebURL&, const WebString& protocol) override; | 59 void connect(const WebURL&, const WebString& protocol) override; |
60 WebString subprotocol() override; | 60 WebString subprotocol() override; |
61 WebString extensions() override; | 61 WebString extensions() override; |
62 bool sendText(const WebString&) override; | 62 bool sendText(const WebString&) override; |
63 bool sendArrayBuffer(const WebArrayBuffer&) override; | 63 bool sendArrayBuffer(const WebArrayBuffer&) override; |
64 unsigned long bufferedAmount() const override; | 64 unsigned long bufferedAmount() const override; |
65 void close(int code, const WebString& reason) override; | 65 void close(int code, const WebString& reason) override; |
66 void fail(const WebString& reason) override; | 66 void fail(const WebString& reason) override; |
67 void disconnect() override; | 67 void disconnect() override; |
68 | 68 |
69 // WebSocketChannelClient methods proxied by WebPepperSocketChannelClientProxy
. | 69 // WebSocketChannelClient methods proxied by |
| 70 // WebPepperSocketChannelClientProxy. |
70 void didConnect(const String& subprotocol, const String& extensions); | 71 void didConnect(const String& subprotocol, const String& extensions); |
71 void didReceiveTextMessage(const String& payload); | 72 void didReceiveTextMessage(const String& payload); |
72 void didReceiveBinaryMessage(std::unique_ptr<Vector<char>> payload); | 73 void didReceiveBinaryMessage(std::unique_ptr<Vector<char>> payload); |
73 void didError(); | 74 void didError(); |
74 void didConsumeBufferedAmount(unsigned long consumed); | 75 void didConsumeBufferedAmount(unsigned long consumed); |
75 void didStartClosingHandshake(); | 76 void didStartClosingHandshake(); |
76 void didClose(WebSocketChannelClient::ClosingHandshakeCompletionStatus, | 77 void didClose(WebSocketChannelClient::ClosingHandshakeCompletionStatus, |
77 unsigned short code, | 78 unsigned short code, |
78 const String& reason); | 79 const String& reason); |
79 | 80 |
80 private: | 81 private: |
81 Persistent<WebSocketChannel> m_private; | 82 Persistent<WebSocketChannel> m_private; |
82 WebPepperSocketClient* m_client; | 83 WebPepperSocketClient* m_client; |
83 Persistent<WebPepperSocketChannelClientProxy> m_channelProxy; | 84 Persistent<WebPepperSocketChannelClientProxy> m_channelProxy; |
84 BinaryType m_binaryType; | 85 BinaryType m_binaryType; |
85 WebString m_subprotocol; | 86 WebString m_subprotocol; |
86 WebString m_extensions; | 87 WebString m_extensions; |
87 bool m_isClosingOrClosed; | 88 bool m_isClosingOrClosed; |
88 // m_bufferedAmount includes m_bufferedAmountAfterClose. | 89 // m_bufferedAmount includes m_bufferedAmountAfterClose. |
89 unsigned long m_bufferedAmount; | 90 unsigned long m_bufferedAmount; |
90 unsigned long m_bufferedAmountAfterClose; | 91 unsigned long m_bufferedAmountAfterClose; |
91 }; | 92 }; |
92 | 93 |
93 } // namespace blink | 94 } // namespace blink |
94 | 95 |
95 #endif // WebPepperSocketImpl_h | 96 #endif // WebPepperSocketImpl_h |
OLD | NEW |