OLD | NEW |
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/browser/renderer_host/websocket_host.h" | 5 #include "content/browser/renderer_host/websocket_host.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 DVLOG(3) << "WebSocketEventHandler::OnFinishOpeningHandshake " | 247 DVLOG(3) << "WebSocketEventHandler::OnFinishOpeningHandshake " |
248 << "should_send=" << should_send; | 248 << "should_send=" << should_send; |
249 | 249 |
250 if (!should_send) | 250 if (!should_send) |
251 return WebSocketEventInterface::CHANNEL_ALIVE; | 251 return WebSocketEventInterface::CHANNEL_ALIVE; |
252 | 252 |
253 WebSocketHandshakeResponse response_to_pass; | 253 WebSocketHandshakeResponse response_to_pass; |
254 response_to_pass.url.Swap(&response->url); | 254 response_to_pass.url.Swap(&response->url); |
255 response_to_pass.status_code = response->status_code; | 255 response_to_pass.status_code = response->status_code; |
256 response_to_pass.status_text.swap(response->status_text); | 256 response_to_pass.status_text.swap(response->status_text); |
257 void* iter = NULL; | 257 size_t iter = 0; |
258 std::string name, value; | 258 std::string name, value; |
259 while (response->headers->EnumerateHeaderLines(&iter, &name, &value)) | 259 while (response->headers->EnumerateHeaderLines(&iter, &name, &value)) |
260 response_to_pass.headers.push_back(std::make_pair(name, value)); | 260 response_to_pass.headers.push_back(std::make_pair(name, value)); |
261 response_to_pass.headers_text = | 261 response_to_pass.headers_text = |
262 net::HttpUtil::ConvertHeadersBackToHTTPResponse( | 262 net::HttpUtil::ConvertHeadersBackToHTTPResponse( |
263 response->headers->raw_headers()); | 263 response->headers->raw_headers()); |
264 response_to_pass.response_time = response->response_time; | 264 response_to_pass.response_time = response->response_time; |
265 | 265 |
266 return StateCast(dispatcher_->NotifyFinishOpeningHandshake(routing_id_, | 266 return StateCast(dispatcher_->NotifyFinishOpeningHandshake(routing_id_, |
267 response_to_pass)); | 267 response_to_pass)); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 ""); | 447 ""); |
448 DCHECK_EQ(WebSocketDispatcherHost::WEBSOCKET_HOST_DELETED, result); | 448 DCHECK_EQ(WebSocketDispatcherHost::WEBSOCKET_HOST_DELETED, result); |
449 return; | 449 return; |
450 } | 450 } |
451 | 451 |
452 // TODO(yhirano): Handle |was_clean| appropriately. | 452 // TODO(yhirano): Handle |was_clean| appropriately. |
453 channel_->StartClosingHandshake(code, reason); | 453 channel_->StartClosingHandshake(code, reason); |
454 } | 454 } |
455 | 455 |
456 } // namespace content | 456 } // namespace content |
OLD | NEW |