Chromium Code Reviews| Index: webkit/plugins/ppapi/ppb_websocket_impl.cc |
| diff --git a/webkit/plugins/ppapi/ppb_websocket_impl.cc b/webkit/plugins/ppapi/ppb_websocket_impl.cc |
| index 3fd708b11abab79a2937189ef59609dd835a8c45..ea3634b876beddfc24aa48ef1007ddf3c784ea3c 100644 |
| --- a/webkit/plugins/ppapi/ppb_websocket_impl.cc |
| +++ b/webkit/plugins/ppapi/ppb_websocket_impl.cc |
| @@ -38,14 +38,14 @@ using WebKit::WebSocket; |
| using WebKit::WebSocketClient; |
| using WebKit::WebURL; |
| -namespace { |
| - |
| const uint32_t kMaxReasonSizeInBytes = 123; |
| const size_t kHybiBaseFramingOverhead = 2; |
| const size_t kHybiMaskingKeyLength = 4; |
| const size_t kMinimumPayloadSizeWithTwoByteExtendedPayloadLength = 126; |
| const size_t kMinimumPayloadSizeWithEightByteExtendedPayloadLength = 0x10000; |
| +namespace { |
| + |
|
dmichael (off chromium)
2011/12/01 16:46:08
Why did you move the namespace? It would seem bett
Takashi Toyoshima
2011/12/02 02:20:27
Yuta suggest me this change because constant varia
|
| uint64_t SaturateAdd(uint64_t a, uint64_t b) { |
| if (kuint64max - a < b) |
| return kuint64max; |
| @@ -139,9 +139,8 @@ int32_t PPB_WebSocket_Impl::Connect(PP_Var url, |
| return PP_ERROR_BADARGUMENT; |
| if (gurl.has_ref()) |
| return PP_ERROR_BADARGUMENT; |
| - // TODO(toyoshim): Must check if the port is allowed by default. |
| - // We could not just use net::IsPortAllowedByDefault() because it doesn't |
| - // be exported over the shared library. |
| + if (!net::IsPortAllowedByDefault(gurl.IntPort())) |
| + return PP_ERROR_BADARGUMENT; |
| WebURL web_url(gurl); |
| // Validate protocols and convert it to WebString. |
| @@ -236,8 +235,6 @@ int32_t PPB_WebSocket_Impl::Close(uint16_t code, |
| return PP_OK_COMPLETIONPENDING; |
| } |
| - // TODO(toyoshim): Handle bufferedAmount here. |
| - |
| state_ = PP_WEBSOCKETREADYSTATE_CLOSING_DEV; |
| WebString web_reason = WebString::fromUTF8(reason_string->value()); |
| websocket_->close(code, web_reason); |