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

Side by Side Diff: content/browser/renderer_host/websocket_dispatcher_host.cc

Issue 34753008: Notify WebSocket connection failure, chromium side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
« no previous file with comments | « no previous file | content/browser/renderer_host/websocket_host.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 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_dispatcher_host.h" 5 #include "content/browser/renderer_host/websocket_dispatcher_host.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 WebSocketHostState WebSocketDispatcherHost::SendClosing(int routing_id) { 124 WebSocketHostState WebSocketDispatcherHost::SendClosing(int routing_id) {
125 // TODO(ricea): Implement the SendClosing IPC. 125 // TODO(ricea): Implement the SendClosing IPC.
126 return WEBSOCKET_HOST_ALIVE; 126 return WEBSOCKET_HOST_ALIVE;
127 } 127 }
128 128
129 WebSocketHostState WebSocketDispatcherHost::DoDropChannel( 129 WebSocketHostState WebSocketDispatcherHost::DoDropChannel(
130 int routing_id, 130 int routing_id,
131 uint16 code, 131 uint16 code,
132 const std::string& reason) { 132 const std::string& reason) {
133 if (SendOrDrop(new WebSocketMsg_DropChannel(routing_id, code, reason)) == 133 bool was_clean = true;
134 if (SendOrDrop(
135 new WebSocketMsg_DropChannel(routing_id, was_clean, code, reason)) ==
134 WEBSOCKET_HOST_DELETED) 136 WEBSOCKET_HOST_DELETED)
135 return WEBSOCKET_HOST_DELETED; 137 return WEBSOCKET_HOST_DELETED;
136 DeleteWebSocketHost(routing_id); 138 DeleteWebSocketHost(routing_id);
137 return WEBSOCKET_HOST_DELETED; 139 return WEBSOCKET_HOST_DELETED;
138 } 140 }
139 141
140 WebSocketDispatcherHost::~WebSocketDispatcherHost() { 142 WebSocketDispatcherHost::~WebSocketDispatcherHost() {
141 STLDeleteContainerPairSecondPointers(hosts_.begin(), hosts_.end()); 143 STLDeleteContainerPairSecondPointers(hosts_.begin(), hosts_.end());
142 } 144 }
143 145
144 void WebSocketDispatcherHost::DeleteWebSocketHost(int routing_id) { 146 void WebSocketDispatcherHost::DeleteWebSocketHost(int routing_id) {
145 WebSocketHostTable::iterator it = hosts_.find(routing_id); 147 WebSocketHostTable::iterator it = hosts_.find(routing_id);
146 DCHECK(it != hosts_.end()); 148 DCHECK(it != hosts_.end());
147 delete it->second; 149 delete it->second;
148 hosts_.erase(it); 150 hosts_.erase(it);
149 } 151 }
150 152
151 } // namespace content 153 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/websocket_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698