| 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/common.h" | 7 #include "ppapi/thunk/common.h" |
| 8 #include "ppapi/thunk/thunk.h" | 8 #include "ppapi/thunk/thunk.h" |
| 9 #include "ppapi/thunk/enter.h" | 9 #include "ppapi/thunk/enter.h" |
| 10 #include "ppapi/thunk/ppb_websocket_api.h" | 10 #include "ppapi/thunk/ppb_websocket_api.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 return enter.object()->GetExtensions(); | 103 return enter.object()->GetExtensions(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 PP_Var GetProtocol(PP_Resource resource) { | 106 PP_Var GetProtocol(PP_Resource resource) { |
| 107 EnterResource<PPB_WebSocket_API> enter(resource, false); | 107 EnterResource<PPB_WebSocket_API> enter(resource, false); |
| 108 if (enter.failed()) | 108 if (enter.failed()) |
| 109 return PP_MakeUndefined(); | 109 return PP_MakeUndefined(); |
| 110 return enter.object()->GetProtocol(); | 110 return enter.object()->GetProtocol(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 PP_WebSocketReadyState_Dev GetReadyState(PP_Resource resource) { | 113 PP_WebSocketReadyState GetReadyState(PP_Resource resource) { |
| 114 EnterResource<PPB_WebSocket_API> enter(resource, false); | 114 EnterResource<PPB_WebSocket_API> enter(resource, false); |
| 115 if (enter.failed()) | 115 if (enter.failed()) |
| 116 return PP_WEBSOCKETREADYSTATE_INVALID_DEV; | 116 return PP_WEBSOCKETREADYSTATE_INVALID; |
| 117 return enter.object()->GetReadyState(); | 117 return enter.object()->GetReadyState(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 PP_Var GetURL(PP_Resource resource) { | 120 PP_Var GetURL(PP_Resource resource) { |
| 121 EnterResource<PPB_WebSocket_API> enter(resource, false); | 121 EnterResource<PPB_WebSocket_API> enter(resource, false); |
| 122 if (enter.failed()) | 122 if (enter.failed()) |
| 123 return PP_MakeUndefined(); | 123 return PP_MakeUndefined(); |
| 124 return enter.object()->GetURL(); | 124 return enter.object()->GetURL(); |
| 125 } | 125 } |
| 126 | 126 |
| 127 const PPB_WebSocket_Dev_0_1 g_ppb_websocket_0_1_thunk = { | 127 const PPB_WebSocket_1_0 g_ppb_websocket_1_0_thunk = { |
| 128 &Create, | 128 &Create, |
| 129 &IsWebSocket, | 129 &IsWebSocket, |
| 130 &Connect, | 130 &Connect, |
| 131 &Close, | 131 &Close, |
| 132 &ReceiveMessage, | 132 &ReceiveMessage, |
| 133 &SendMessage, | 133 &SendMessage, |
| 134 &GetBufferedAmount, | 134 &GetBufferedAmount, |
| 135 &GetCloseCode, | 135 &GetCloseCode, |
| 136 &GetCloseReason, | 136 &GetCloseReason, |
| 137 &GetCloseWasClean, | 137 &GetCloseWasClean, |
| 138 &GetExtensions, | 138 &GetExtensions, |
| 139 &GetProtocol, | 139 &GetProtocol, |
| 140 &GetReadyState, | 140 &GetReadyState, |
| 141 &GetURL | 141 &GetURL |
| 142 }; | 142 }; |
| 143 | 143 |
| 144 } // namespace | 144 } // namespace |
| 145 | 145 |
| 146 const PPB_WebSocket_Dev_0_1* GetPPB_WebSocket_Dev_0_1_Thunk() { | 146 const PPB_WebSocket_1_0* GetPPB_WebSocket_1_0_Thunk() { |
| 147 return &g_ppb_websocket_0_1_thunk; | 147 return &g_ppb_websocket_1_0_thunk; |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace thunk | 150 } // namespace thunk |
| 151 } // namespace ppapi | 151 } // namespace ppapi |
| OLD | NEW |