Chromium Code Reviews| Index: ppapi/proxy/websocket_resource.cc |
| diff --git a/ppapi/proxy/websocket_resource.cc b/ppapi/proxy/websocket_resource.cc |
| index c998cd94b7206868cfa96ceb3d1566e823502482..a0a44c8233914b16acd1d8026bb9de708804c4d5 100644 |
| --- a/ppapi/proxy/websocket_resource.cc |
| +++ b/ppapi/proxy/websocket_resource.cc |
| @@ -15,7 +15,6 @@ |
| #include "ppapi/shared_impl/ppapi_globals.h" |
| #include "ppapi/shared_impl/var.h" |
| #include "ppapi/shared_impl/var_tracker.h" |
| -#include "third_party/WebKit/public/web/WebSocket.h" |
| namespace { |
| @@ -137,17 +136,10 @@ int32_t WebSocketResource::Close(uint16_t code, |
| // Validate |code| and |reason|. |
| scoped_refptr<StringVar> reason_string_var; |
| std::string reason_string; |
| - blink::WebSocket::CloseEventCode event_code = |
| - static_cast<blink::WebSocket::CloseEventCode>(code); |
| - if (code == PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED) { |
| - // PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED and CloseEventCodeNotSpecified are |
| - // assigned to different values. A conversion is needed if |
| - // PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED is specified. |
| - event_code = blink::WebSocket::CloseEventCodeNotSpecified; |
| - } else { |
| - if (!(code == PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE || |
| - (PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN <= code && |
| - code <= PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX))) |
| + if (code != PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED) { |
| + if ((code != PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE && |
|
dmichael (off chromium)
2014/03/18 18:02:30
nit: I think you have an extra set of enclosing pa
bbudge
2014/03/18 20:23:31
Done.
|
| + (PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN > code || |
|
dmichael (off chromium)
2014/03/18 18:02:30
nit: now that you negated this, I think it would b
bbudge
2014/03/18 20:23:31
Done. (Just reversed the first, is that what you m
dmichael (off chromium)
2014/03/18 20:38:53
Yes, that's exactly what I meant, thanks!
|
| + code > PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX))) |
| // RFC 6455 limits applications to use reserved connection close code in |
| // section 7.4.2.. The WebSocket API (http://www.w3.org/TR/websockets/) |
| // defines this out of range error as InvalidAccessError in JavaScript. |
| @@ -195,7 +187,7 @@ int32_t WebSocketResource::Close(uint16_t code, |
| // Close connection. |
| state_ = PP_WEBSOCKETREADYSTATE_CLOSING; |
| - PpapiHostMsg_WebSocket_Close msg(static_cast<int32_t>(event_code), |
| + PpapiHostMsg_WebSocket_Close msg(static_cast<int32_t>(code), |
| reason_string); |
| Call<PpapiPluginMsg_WebSocket_CloseReply>(RENDERER, msg, |
| base::Bind(&WebSocketResource::OnPluginMsgCloseReply, this)); |