Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_DEV_WEBSOCKET_DEV_H_ | 5 #ifndef PPAPI_CPP_DEV_WEBSOCKET_DEV_H_ |
| 6 #define PPAPI_CPP_DEV_WEBSOCKET_DEV_H_ | 6 #define PPAPI_CPP_DEV_WEBSOCKET_DEV_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/dev/ppb_websocket_dev.h" | 8 #include "ppapi/c/dev/ppb_websocket_dev.h" |
| 9 #include "ppapi/cpp/resource.h" | 9 #include "ppapi/cpp/resource.h" |
| 10 | 10 |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 169 /// | 169 /// |
| 170 /// @return Returns <code>PP_WEBSOCKETREADYSTATE_INVALID_DEV</code> if called | 170 /// @return Returns <code>PP_WEBSOCKETREADYSTATE_INVALID_DEV</code> if called |
| 171 /// before connect() is called. | 171 /// before connect() is called. |
| 172 PP_WebSocketReadyState_Dev GetReadyState(); | 172 PP_WebSocketReadyState_Dev GetReadyState(); |
| 173 | 173 |
| 174 /// GetURL() returns the URL associated with specified WebSocket connection. | 174 /// GetURL() returns the URL associated with specified WebSocket connection. |
| 175 /// | 175 /// |
| 176 /// @return Returns a <code>Var</code> of string type. If called before the | 176 /// @return Returns a <code>Var</code> of string type. If called before the |
| 177 /// connection is established, it contains the empty string. | 177 /// connection is established, it contains the empty string. |
| 178 Var GetURL(); | 178 Var GetURL(); |
| 179 | |
| 180 /// SetBinaryType() specifies the binary object type for receiving binary | |
| 181 /// frames representation. Receiving text frames are always mapped to | |
| 182 /// <PP_VARTYPE_STRING</code> var regardless of this attribute. | |
| 183 /// This function should be called before Connect() to ensure receiving all | |
| 184 /// incoming binary frames as the specified binary object type. | |
| 185 /// Default type is <code>PP_WEBSOCKETBINARYTYPE_BLOB_DEV</code>. | |
| 186 /// | |
| 187 /// Currently, Blob bindings is not supported in Pepper, so receiving binary | |
| 188 /// type is always ArrayBuffer. To ensure backward compatibility, you must | |
| 189 /// call this function with | |
| 190 /// <code>PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV</code> to use binary frames. | |
| 191 /// | |
| 192 /// @param[in] binary_type Binary object type for receibing binary frames | |
|
dmichael (off chromium)
2012/01/17 22:14:28
receibing->receiving
Takashi Toyoshima
2012/01/18 12:10:44
Done here and in api/dev/ppb_websocket_dev_idl.
| |
| 193 /// representation. | |
| 194 /// | |
| 195 /// @return Returns <code>false</code> if the specified type is not | |
| 196 /// supported. Otherwise, returns <code>true</code>. | |
| 197 /// | |
| 198 bool SetBinaryType(PP_WebSocketBinaryType_Dev binary_type); | |
| 199 | |
| 200 /// GetBinaryType() returns currently specified binary object type for | |
|
dmichael (off chromium)
2012/01/17 22:14:28
nit: returns "the" currently
Takashi Toyoshima
2012/01/18 12:10:44
Ditto.
| |
| 201 /// receiving binary frames representation. | |
|
dmichael (off chromium)
2012/01/17 22:14:28
nit: I think "representation" is redundant.
Takashi Toyoshima
2012/01/18 12:10:44
Ditto.
| |
| 202 /// | |
| 203 /// @return Returns <code>PP_WebSocketBinaryType_Dev</code> represents | |
| 204 /// current binary object type. | |
|
dmichael (off chromium)
2012/01/17 22:14:28
"the" current
Takashi Toyoshima
2012/01/18 12:10:44
Ditto.
| |
| 205 PP_WebSocketBinaryType_Dev GetBinaryType(); | |
| 179 }; | 206 }; |
| 180 | 207 |
| 181 } // namespace pp | 208 } // namespace pp |
| 182 | 209 |
| 183 #endif // PPAPI_CPP_DEV_WEBSOCKET_DEV_H_ | 210 #endif // PPAPI_CPP_DEV_WEBSOCKET_DEV_H_ |
| OLD | NEW |