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_THUNK_WEBSOCKET_API_H_ | 5 #ifndef PPAPI_THUNK_WEBSOCKET_API_H_ |
6 #define PPAPI_THUNK_WEBSOCKET_API_H_ | 6 #define PPAPI_THUNK_WEBSOCKET_API_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "ppapi/c/pp_completion_callback.h" | 9 #include "ppapi/c/pp_completion_callback.h" |
10 #include "ppapi/c/ppb_websocket.h" | 10 #include "ppapi/c/ppb_websocket.h" |
| 11 #include "ppapi/thunk/ppapi_thunk_export.h" |
11 | 12 |
12 namespace ppapi { | 13 namespace ppapi { |
13 | 14 |
14 class TrackedCallback; | 15 class TrackedCallback; |
15 | 16 |
16 namespace thunk { | 17 namespace thunk { |
17 | 18 |
18 // Some arguments and attributes are based on The WebSocket Protocol and The | 19 // Some arguments and attributes are based on The WebSocket Protocol and The |
19 // WebSocket API. See also following official specifications. | 20 // WebSocket API. See also following official specifications. |
20 // - The WebSocket Protocol http://tools.ietf.org/html/rfc6455 | 21 // - The WebSocket Protocol http://tools.ietf.org/html/rfc6455 |
21 // - The WebSocket API http://dev.w3.org/html5/websockets/ | 22 // - The WebSocket API http://dev.w3.org/html5/websockets/ |
22 class PPB_WebSocket_API { | 23 class PPAPI_THUNK_EXPORT PPB_WebSocket_API { |
23 public: | 24 public: |
24 virtual ~PPB_WebSocket_API() {} | 25 virtual ~PPB_WebSocket_API() {} |
25 | 26 |
26 // Connects to the specified WebSocket server with |protocols| argument | 27 // Connects to the specified WebSocket server with |protocols| argument |
27 // defined by the WebSocket API. Returns an int32_t error code from | 28 // defined by the WebSocket API. Returns an int32_t error code from |
28 // pp_errors.h. | 29 // pp_errors.h. |
29 virtual int32_t Connect(PP_Var url, | 30 virtual int32_t Connect(PP_Var url, |
30 const PP_Var protocols[], | 31 const PP_Var protocols[], |
31 uint32_t protocol_count, | 32 uint32_t protocol_count, |
32 scoped_refptr<TrackedCallback> callback) = 0; | 33 scoped_refptr<TrackedCallback> callback) = 0; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 virtual PP_WebSocketReadyState GetReadyState() = 0; | 75 virtual PP_WebSocketReadyState GetReadyState() = 0; |
75 | 76 |
76 // Returns the url attribute of The WebSocket API. | 77 // Returns the url attribute of The WebSocket API. |
77 virtual PP_Var GetURL() = 0; | 78 virtual PP_Var GetURL() = 0; |
78 }; | 79 }; |
79 | 80 |
80 } // namespace thunk | 81 } // namespace thunk |
81 } // namespace ppapi | 82 } // namespace ppapi |
82 | 83 |
83 #endif // PPAPI_THUNK_WEBSOCKET_API_H_ | 84 #endif // PPAPI_THUNK_WEBSOCKET_API_H_ |
OLD | NEW |