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

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
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 void WebSocketDispatcherHost::SendFlowControl(int routing_id, int64 quota) { 102 void WebSocketDispatcherHost::SendFlowControl(int routing_id, int64 quota) {
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 bool fail,
111 uint16 code, 112 uint16 code,
112 const std::string& reason) { 113 const std::string& reason) {
113 SendOrDrop(new WebSocketMsg_DropChannel(routing_id, code, reason)); 114 SendOrDrop(new WebSocketMsg_DropChannel(routing_id, fail, code, reason));
114 DeleteWebSocketHost(routing_id); 115 DeleteWebSocketHost(routing_id);
115 } 116 }
116 117
117 WebSocketDispatcherHost::~WebSocketDispatcherHost() { 118 WebSocketDispatcherHost::~WebSocketDispatcherHost() {
118 STLDeleteContainerPairSecondPointers(hosts_.begin(), hosts_.end()); 119 STLDeleteContainerPairSecondPointers(hosts_.begin(), hosts_.end());
119 } 120 }
120 121
121 void WebSocketDispatcherHost::DeleteWebSocketHost(int routing_id) { 122 void WebSocketDispatcherHost::DeleteWebSocketHost(int routing_id) {
122 WebSocketHostTable::iterator it = hosts_.find(routing_id); 123 WebSocketHostTable::iterator it = hosts_.find(routing_id);
123 if (it != hosts_.end()) { 124 if (it != hosts_.end()) {
124 delete it->second; 125 delete it->second;
125 hosts_.erase(it); 126 hosts_.erase(it);
126 } 127 }
127 } 128 }
128 129
129 } // namespace content 130 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698