Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Side by Side Diff: ppapi/thunk/ppb_websocket_api.h

Issue 10332138: WebSocket Pepper API: allow to close connection without code and reason (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: uint16_t -> enum Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "ppapi/c/pp_completion_callback.h" 8 #include "ppapi/c/pp_completion_callback.h"
9 #include "ppapi/c/ppb_websocket.h" 9 #include "ppapi/c/ppb_websocket.h"
10 10
(...skipping 11 matching lines...) Expand all
22 // Connects to the specified WebSocket server with |protocols| argument 22 // Connects to the specified WebSocket server with |protocols| argument
23 // defined by the WebSocket API. Returns an int32_t error code from 23 // defined by the WebSocket API. Returns an int32_t error code from
24 // pp_errors.h. 24 // pp_errors.h.
25 virtual int32_t Connect(PP_Var url, 25 virtual int32_t Connect(PP_Var url,
26 const PP_Var protocols[], 26 const PP_Var protocols[],
27 uint32_t protocol_count, 27 uint32_t protocol_count,
28 PP_CompletionCallback callback) = 0; 28 PP_CompletionCallback callback) = 0;
29 29
30 // Closes the established connection with specified |code| and |reason|. 30 // Closes the established connection with specified |code| and |reason|.
31 // Returns an int32_t error code from pp_errors.h. 31 // Returns an int32_t error code from pp_errors.h.
32 virtual int32_t Close(uint16_t code, 32 virtual int32_t Close(PP_WebSocketStatusCode code,
33 PP_Var reason, 33 PP_Var reason,
34 PP_CompletionCallback callback) = 0; 34 PP_CompletionCallback callback) = 0;
35 35
36 // Receives a message from the WebSocket server. Caller must keep specified 36 // Receives a message from the WebSocket server. Caller must keep specified
37 // |message| object as valid until completion callback is invoked. Returns an 37 // |message| object as valid until completion callback is invoked. Returns an
38 // int32_t error code from pp_errors.h. 38 // int32_t error code from pp_errors.h.
39 virtual int32_t ReceiveMessage(PP_Var* message, 39 virtual int32_t ReceiveMessage(PP_Var* message,
40 PP_CompletionCallback callback) = 0; 40 PP_CompletionCallback callback) = 0;
41 41
42 // Sends a message to the WebSocket server. Returns an int32_t error code 42 // Sends a message to the WebSocket server. Returns an int32_t error code
(...skipping 27 matching lines...) Expand all
70 virtual PP_WebSocketReadyState GetReadyState() = 0; 70 virtual PP_WebSocketReadyState GetReadyState() = 0;
71 71
72 // Returns the url attribute of The WebSocket API. 72 // Returns the url attribute of The WebSocket API.
73 virtual PP_Var GetURL() = 0; 73 virtual PP_Var GetURL() = 0;
74 }; 74 };
75 75
76 } // namespace thunk 76 } // namespace thunk
77 } // namespace ppapi 77 } // namespace ppapi
78 78
79 #endif // PPAPI_THUNK_WEBSOCKET_API_H_ 79 #endif // PPAPI_THUNK_WEBSOCKET_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698