| 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/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> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 namespace content { | 38 namespace content { |
| 39 | 39 |
| 40 namespace { | 40 namespace { |
| 41 | 41 |
| 42 const unsigned short kAbnormalShutdownOpCode = 1006; | 42 const unsigned short kAbnormalShutdownOpCode = 1006; |
| 43 | 43 |
| 44 } // namespace | 44 } // namespace |
| 45 | 45 |
| 46 WebSocketBridge::WebSocketBridge() | 46 WebSocketBridge::WebSocketBridge() |
| 47 : channel_id_(kInvalidChannelId), client_(NULL) {} | 47 : channel_id_(kInvalidChannelId), |
| 48 render_frame_id_(MSG_ROUTING_NONE), |
| 49 client_(NULL) {} |
| 48 | 50 |
| 49 WebSocketBridge::~WebSocketBridge() { | 51 WebSocketBridge::~WebSocketBridge() { |
| 50 if (channel_id_ != kInvalidChannelId) { | 52 if (channel_id_ != kInvalidChannelId) { |
| 51 // The connection is abruptly disconnected by the renderer without | 53 // The connection is abruptly disconnected by the renderer without |
| 52 // closing handshake. | 54 // closing handshake. |
| 53 ChildThread::current()->Send( | 55 ChildThread::current()->Send( |
| 54 new WebSocketMsg_DropChannel(channel_id_, | 56 new WebSocketMsg_DropChannel(channel_id_, |
| 55 false, | 57 false, |
| 56 kAbnormalShutdownOpCode, | 58 kAbnormalShutdownOpCode, |
| 57 std::string())); | 59 std::string())); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 return; | 293 return; |
| 292 WebSocketDispatcher* dispatcher = | 294 WebSocketDispatcher* dispatcher = |
| 293 ChildThread::current()->websocket_dispatcher(); | 295 ChildThread::current()->websocket_dispatcher(); |
| 294 dispatcher->RemoveBridge(channel_id_); | 296 dispatcher->RemoveBridge(channel_id_); |
| 295 | 297 |
| 296 channel_id_ = kInvalidChannelId; | 298 channel_id_ = kInvalidChannelId; |
| 297 client_ = NULL; | 299 client_ = NULL; |
| 298 } | 300 } |
| 299 | 301 |
| 300 } // namespace content | 302 } // namespace content |
| OLD | NEW |