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

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, 2 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
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 SendOrDrop(new WebSocketMsg_FlowControl(routing_id, quota)); 103 SendOrDrop(new WebSocketMsg_FlowControl(routing_id, quota));
104 } 104 }
105 105
106 void WebSocketDispatcherHost::SendClosing(int routing_id) { 106 void WebSocketDispatcherHost::SendClosing(int routing_id) {
107 // TODO(ricea): Implement the SendClosing IPC. 107 // TODO(ricea): Implement the SendClosing IPC.
108 } 108 }
109 109
110 void WebSocketDispatcherHost::DoDropChannel(int routing_id, 110 void WebSocketDispatcherHost::DoDropChannel(int routing_id,
111 uint16 code, 111 uint16 code,
112 const std::string& reason) { 112 const std::string& reason) {
113 SendOrDrop(new WebSocketMsg_DropChannel(routing_id, code, reason)); 113 // TODO(yhirano): Set |was_clean| appropriately.
114 bool was_clean = true;
115 SendOrDrop(new WebSocketMsg_DropChannel(routing_id, was_clean, code, reason));
114 DeleteWebSocketHost(routing_id); 116 DeleteWebSocketHost(routing_id);
115 } 117 }
116 118
117 WebSocketDispatcherHost::~WebSocketDispatcherHost() { 119 WebSocketDispatcherHost::~WebSocketDispatcherHost() {
118 STLDeleteContainerPairSecondPointers(hosts_.begin(), hosts_.end()); 120 STLDeleteContainerPairSecondPointers(hosts_.begin(), hosts_.end());
119 } 121 }
120 122
121 void WebSocketDispatcherHost::DeleteWebSocketHost(int routing_id) { 123 void WebSocketDispatcherHost::DeleteWebSocketHost(int routing_id) {
122 WebSocketHostTable::iterator it = hosts_.find(routing_id); 124 WebSocketHostTable::iterator it = hosts_.find(routing_id);
123 if (it != hosts_.end()) { 125 if (it != hosts_.end()) {
124 delete it->second; 126 delete it->second;
125 hosts_.erase(it); 127 hosts_.erase(it);
126 } 128 }
127 } 129 }
128 130
129 } // namespace content 131 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/websocket_host.h » ('j') | content/common/websocket_messages.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698