| 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 PPAPI_CPP_WEBSOCKET_H_ | 5 #ifndef PPAPI_CPP_WEBSOCKET_H_ |
| 6 #define PPAPI_CPP_WEBSOCKET_H_ | 6 #define PPAPI_CPP_WEBSOCKET_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/ppb_websocket.h" | 8 #include "ppapi/c/ppb_websocket.h" |
| 9 #include "ppapi/cpp/resource.h" | 9 #include "ppapi/cpp/resource.h" |
| 10 | 10 |
| 11 /// @file | 11 /// @file |
| 12 /// This file defines the WebSocket interface. | 12 /// This file defines the WebSocket interface. |
| 13 | 13 |
| 14 namespace pp { | 14 namespace pp { |
| 15 | 15 |
| 16 class CompletionCallback; | 16 class CompletionCallback; |
| 17 class Instance; | 17 class InstanceHandle; |
| 18 class Var; | 18 class Var; |
| 19 | 19 |
| 20 /// The <code>WebSocket</code> class | 20 /// The <code>WebSocket</code> class |
| 21 class WebSocket : public Resource { | 21 class WebSocket : public Resource { |
| 22 public: | 22 public: |
| 23 /// Constructs a WebSocket object. | 23 /// Constructs a WebSocket object. |
| 24 WebSocket(Instance* instance); | 24 /// |
| 25 /// @param[in] instance The instance with which this resource will be |
| 26 /// associated. |
| 27 explicit WebSocket(const InstanceHandle& instance); |
| 25 | 28 |
| 26 /// Destructs a WebSocket object. | 29 /// Destructs a WebSocket object. |
| 27 virtual ~WebSocket(); | 30 virtual ~WebSocket(); |
| 28 | 31 |
| 29 /// Connect() connects to the specified WebSocket server. Caller can call | 32 /// Connect() connects to the specified WebSocket server. Caller can call |
| 30 /// this method at most once. | 33 /// this method at most once. |
| 31 /// | 34 /// |
| 32 /// @param[in] url A <code>Var</code> of string type representing a WebSocket | 35 /// @param[in] url A <code>Var</code> of string type representing a WebSocket |
| 33 /// server URL. | 36 /// server URL. |
| 34 /// @param[in] protocols A pointer to an array of string type | 37 /// @param[in] protocols A pointer to an array of string type |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 /// GetURL() returns the URL associated with specified WebSocket connection. | 179 /// GetURL() returns the URL associated with specified WebSocket connection. |
| 177 /// | 180 /// |
| 178 /// @return Returns a <code>Var</code> of string type. If called before the | 181 /// @return Returns a <code>Var</code> of string type. If called before the |
| 179 /// connection is established, it contains the empty string. | 182 /// connection is established, it contains the empty string. |
| 180 Var GetURL(); | 183 Var GetURL(); |
| 181 }; | 184 }; |
| 182 | 185 |
| 183 } // namespace pp | 186 } // namespace pp |
| 184 | 187 |
| 185 #endif // PPAPI_CPP_WEBSOCKET_H_ | 188 #endif // PPAPI_CPP_WEBSOCKET_H_ |
| OLD | NEW |