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

Side by Side Diff: ppapi/thunk/ppb_websocket_thunk.cc

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 #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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698