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

Side by Side Diff: ppapi/proxy/websocket_resource.cc

Issue 61553006: Rename WebKit namespace to blink (part 5) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « media/base/media_keys.h ('k') | ppapi/shared_impl/ppb_gamepad_shared.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/proxy/websocket_resource.h" 5 #include "ppapi/proxy/websocket_resource.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 const PP_Var& reason, 130 const PP_Var& reason,
131 scoped_refptr<TrackedCallback> callback) { 131 scoped_refptr<TrackedCallback> callback) {
132 if (TrackedCallback::IsPending(close_callback_)) 132 if (TrackedCallback::IsPending(close_callback_))
133 return PP_ERROR_INPROGRESS; 133 return PP_ERROR_INPROGRESS;
134 if (state_ == PP_WEBSOCKETREADYSTATE_INVALID) 134 if (state_ == PP_WEBSOCKETREADYSTATE_INVALID)
135 return PP_ERROR_FAILED; 135 return PP_ERROR_FAILED;
136 136
137 // Validate |code| and |reason|. 137 // Validate |code| and |reason|.
138 scoped_refptr<StringVar> reason_string_var; 138 scoped_refptr<StringVar> reason_string_var;
139 std::string reason_string; 139 std::string reason_string;
140 WebKit::WebSocket::CloseEventCode event_code = 140 blink::WebSocket::CloseEventCode event_code =
141 static_cast<WebKit::WebSocket::CloseEventCode>(code); 141 static_cast<blink::WebSocket::CloseEventCode>(code);
142 if (code == PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED) { 142 if (code == PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED) {
143 // PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED and CloseEventCodeNotSpecified are 143 // PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED and CloseEventCodeNotSpecified are
144 // assigned to different values. A conversion is needed if 144 // assigned to different values. A conversion is needed if
145 // PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED is specified. 145 // PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED is specified.
146 event_code = WebKit::WebSocket::CloseEventCodeNotSpecified; 146 event_code = blink::WebSocket::CloseEventCodeNotSpecified;
147 } else { 147 } else {
148 if (!(code == PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE || 148 if (!(code == PP_WEBSOCKETSTATUSCODE_NORMAL_CLOSURE ||
149 (PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN <= code && 149 (PP_WEBSOCKETSTATUSCODE_USER_REGISTERED_MIN <= code &&
150 code <= PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX))) 150 code <= PP_WEBSOCKETSTATUSCODE_USER_PRIVATE_MAX)))
151 // RFC 6455 limits applications to use reserved connection close code in 151 // RFC 6455 limits applications to use reserved connection close code in
152 // section 7.4.2.. The WebSocket API (http://www.w3.org/TR/websockets/) 152 // section 7.4.2.. The WebSocket API (http://www.w3.org/TR/websockets/)
153 // defines this out of range error as InvalidAccessError in JavaScript. 153 // defines this out of range error as InvalidAccessError in JavaScript.
154 return PP_ERROR_NOACCESS; 154 return PP_ERROR_NOACCESS;
155 155
156 // |reason| must be ignored if it is PP_VARTYPE_UNDEFINED or |code| is 156 // |reason| must be ignored if it is PP_VARTYPE_UNDEFINED or |code| is
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 return PP_OK; 485 return PP_OK;
486 486
487 *receive_callback_var_ = received_messages_.front()->GetPPVar(); 487 *receive_callback_var_ = received_messages_.front()->GetPPVar();
488 received_messages_.pop(); 488 received_messages_.pop();
489 receive_callback_var_ = NULL; 489 receive_callback_var_ = NULL;
490 return PP_OK; 490 return PP_OK;
491 } 491 }
492 492
493 } // namespace proxy 493 } // namespace proxy
494 } // namespace ppapi 494 } // namespace ppapi
OLDNEW
« no previous file with comments | « media/base/media_keys.h ('k') | ppapi/shared_impl/ppb_gamepad_shared.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698