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

Unified Diff: ppapi/proxy/websocket_resource.cc

Issue 202143007: Move Blink dependency out of plugin proxy code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments. Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/pepper/pepper_websocket_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/websocket_resource.cc
diff --git a/ppapi/proxy/websocket_resource.cc b/ppapi/proxy/websocket_resource.cc
index c998cd94b7206868cfa96ceb3d1566e823502482..938f28e26efd47a3c06e3c00fca86d221cc5df54 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 &&
+ (code < PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN ||
+ 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));
« no previous file with comments | « content/renderer/pepper/pepper_websocket_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698