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

Side by Side Diff: content/child/websocket_bridge.cc

Issue 1229783005: Remove 'blink::WebSerializedOrigin' (4/5) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years, 5 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
« no previous file with comments | « content/child/websocket_bridge.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/child/websocket_bridge.h" 5 #include "content/child/websocket_bridge.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "content/child/child_thread_impl.h" 14 #include "content/child/child_thread_impl.h"
15 #include "content/child/websocket_dispatcher.h" 15 #include "content/child/websocket_dispatcher.h"
16 #include "content/common/websocket.h" 16 #include "content/common/websocket.h"
17 #include "content/common/websocket_messages.h" 17 #include "content/common/websocket_messages.h"
18 #include "ipc/ipc_message.h" 18 #include "ipc/ipc_message.h"
19 #include "ipc/ipc_message_macros.h" 19 #include "ipc/ipc_message_macros.h"
20 #include "third_party/WebKit/public/platform/WebSerializedOrigin.h" 20 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h"
21 #include "third_party/WebKit/public/platform/WebSocketHandle.h" 21 #include "third_party/WebKit/public/platform/WebSocketHandle.h"
22 #include "third_party/WebKit/public/platform/WebSocketHandleClient.h" 22 #include "third_party/WebKit/public/platform/WebSocketHandleClient.h"
23 #include "third_party/WebKit/public/platform/WebSocketHandshakeRequestInfo.h" 23 #include "third_party/WebKit/public/platform/WebSocketHandshakeRequestInfo.h"
24 #include "third_party/WebKit/public/platform/WebSocketHandshakeResponseInfo.h" 24 #include "third_party/WebKit/public/platform/WebSocketHandshakeResponseInfo.h"
25 #include "third_party/WebKit/public/platform/WebString.h" 25 #include "third_party/WebKit/public/platform/WebString.h"
26 #include "third_party/WebKit/public/platform/WebURL.h" 26 #include "third_party/WebKit/public/platform/WebURL.h"
27 #include "third_party/WebKit/public/platform/WebVector.h" 27 #include "third_party/WebKit/public/platform/WebVector.h"
28 #include "url/deprecated_serialized_origin.h" 28 #include "url/deprecated_serialized_origin.h"
29 #include "url/gurl.h" 29 #include "url/gurl.h"
30 30
31 using blink::WebSerializedOrigin; 31 using blink::WebSecurityOrigin;
32 using blink::WebSocketHandle; 32 using blink::WebSocketHandle;
33 using blink::WebSocketHandleClient; 33 using blink::WebSocketHandleClient;
34 using blink::WebString; 34 using blink::WebString;
35 using blink::WebURL; 35 using blink::WebURL;
36 using blink::WebVector; 36 using blink::WebVector;
37 37
38 namespace content { 38 namespace content {
39 39
40 namespace { 40 namespace {
41 41
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 196
197 void WebSocketBridge::DidStartClosingHandshake() { 197 void WebSocketBridge::DidStartClosingHandshake() {
198 DVLOG(1) << "WebSocketBridge::DidStartClosingHandshake()"; 198 DVLOG(1) << "WebSocketBridge::DidStartClosingHandshake()";
199 if (!client_) 199 if (!client_)
200 return; 200 return;
201 201
202 client_->didStartClosingHandshake(this); 202 client_->didStartClosingHandshake(this);
203 // |this| can be deleted here. 203 // |this| can be deleted here.
204 } 204 }
205 205
206 void WebSocketBridge::connect( 206 void WebSocketBridge::connect(const WebURL& url,
207 const WebURL& url, 207 const WebVector<WebString>& protocols,
208 const WebVector<WebString>& protocols, 208 const WebSecurityOrigin& origin,
209 const WebSerializedOrigin& origin, 209 WebSocketHandleClient* client) {
210 WebSocketHandleClient* client) {
211 DCHECK_EQ(kInvalidChannelId, channel_id_); 210 DCHECK_EQ(kInvalidChannelId, channel_id_);
212 WebSocketDispatcher* dispatcher = 211 WebSocketDispatcher* dispatcher =
213 ChildThreadImpl::current()->websocket_dispatcher(); 212 ChildThreadImpl::current()->websocket_dispatcher();
214 channel_id_ = dispatcher->AddBridge(this); 213 channel_id_ = dispatcher->AddBridge(this);
215 client_ = client; 214 client_ = client;
216 215
217 std::vector<std::string> protocols_to_pass; 216 std::vector<std::string> protocols_to_pass;
218 for (size_t i = 0; i < protocols.size(); ++i) 217 for (size_t i = 0; i < protocols.size(); ++i)
219 protocols_to_pass.push_back(protocols[i].utf8()); 218 protocols_to_pass.push_back(protocols[i].utf8());
220 url::DeprecatedSerializedOrigin origin_to_pass(origin); 219 url::DeprecatedSerializedOrigin origin_to_pass(origin.toString().utf8());
221 220
222 DVLOG(1) << "Bridge#" << channel_id_ << " Connect(" << url << ", (" 221 DVLOG(1) << "Bridge#" << channel_id_ << " Connect(" << url << ", ("
223 << base::JoinString(protocols_to_pass, ", ") << "), " 222 << base::JoinString(protocols_to_pass, ", ") << "), "
224 << origin_to_pass.string() << ")"; 223 << origin_to_pass.string() << ")";
225 224
226 ChildThreadImpl::current()->Send(new WebSocketHostMsg_AddChannelRequest( 225 ChildThreadImpl::current()->Send(new WebSocketHostMsg_AddChannelRequest(
227 channel_id_, url, protocols_to_pass, origin_to_pass, render_frame_id_)); 226 channel_id_, url, protocols_to_pass, origin_to_pass, render_frame_id_));
228 } 227 }
229 228
230 void WebSocketBridge::send(bool fin, 229 void WebSocketBridge::send(bool fin,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 return; 285 return;
287 WebSocketDispatcher* dispatcher = 286 WebSocketDispatcher* dispatcher =
288 ChildThreadImpl::current()->websocket_dispatcher(); 287 ChildThreadImpl::current()->websocket_dispatcher();
289 dispatcher->RemoveBridge(channel_id_); 288 dispatcher->RemoveBridge(channel_id_);
290 289
291 channel_id_ = kInvalidChannelId; 290 channel_id_ = kInvalidChannelId;
292 client_ = NULL; 291 client_ = NULL;
293 } 292 }
294 293
295 } // namespace content 294 } // namespace content
OLDNEW
« no previous file with comments | « content/child/websocket_bridge.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698