| 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 #include "ppapi/c/pp_errors.h" | 5 #include "ppapi/c/pp_errors.h" |
| 6 #include "ppapi/c/pp_var.h" | 6 #include "ppapi/c/pp_var.h" |
| 7 #include "ppapi/thunk/thunk.h" | 7 #include "ppapi/thunk/thunk.h" |
| 8 #include "ppapi/thunk/enter.h" | 8 #include "ppapi/thunk/enter.h" |
| 9 #include "ppapi/thunk/ppb_websocket_api.h" | 9 #include "ppapi/thunk/ppb_websocket_api.h" |
| 10 #include "ppapi/thunk/resource_creation_api.h" | 10 #include "ppapi/thunk/resource_creation_api.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 uint32_t protocol_count, | 34 uint32_t protocol_count, |
| 35 PP_CompletionCallback callback) { | 35 PP_CompletionCallback callback) { |
| 36 EnterWebSocket enter(resource, callback, false); | 36 EnterWebSocket enter(resource, callback, false); |
| 37 if (enter.failed()) | 37 if (enter.failed()) |
| 38 return enter.retval(); | 38 return enter.retval(); |
| 39 return enter.SetResult(enter.object()->Connect( | 39 return enter.SetResult(enter.object()->Connect( |
| 40 url, protocols, protocol_count, callback)); | 40 url, protocols, protocol_count, callback)); |
| 41 } | 41 } |
| 42 | 42 |
| 43 int32_t Close(PP_Resource resource, | 43 int32_t Close(PP_Resource resource, |
| 44 uint16_t code, | 44 PP_WebSocketStatusCode code, |
| 45 PP_Var reason, | 45 PP_Var reason, |
| 46 PP_CompletionCallback callback) { | 46 PP_CompletionCallback callback) { |
| 47 EnterWebSocket enter(resource, callback, false); | 47 EnterWebSocket enter(resource, callback, false); |
| 48 if (enter.failed()) | 48 if (enter.failed()) |
| 49 return enter.retval(); | 49 return enter.retval(); |
| 50 return enter.SetResult(enter.object()->Close(code, reason, callback)); | 50 return enter.SetResult(enter.object()->Close(code, reason, callback)); |
| 51 } | 51 } |
| 52 | 52 |
| 53 int32_t ReceiveMessage(PP_Resource resource, | 53 int32_t ReceiveMessage(PP_Resource resource, |
| 54 PP_Var* message, | 54 PP_Var* message, |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 } // namespace | 142 } // namespace |
| 143 | 143 |
| 144 const PPB_WebSocket_1_0* GetPPB_WebSocket_1_0_Thunk() { | 144 const PPB_WebSocket_1_0* GetPPB_WebSocket_1_0_Thunk() { |
| 145 return &g_ppb_websocket_1_0_thunk; | 145 return &g_ppb_websocket_1_0_thunk; |
| 146 } | 146 } |
| 147 | 147 |
| 148 } // namespace thunk | 148 } // namespace thunk |
| 149 } // namespace ppapi | 149 } // namespace ppapi |
| OLD | NEW |