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

Side by Side Diff: net/websockets/websocket_channel.cc

Issue 667923003: Standardize usage of virtual/override/final in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « net/websockets/websocket_basic_stream_test.cc ('k') | net/websockets/websocket_channel_test.cc » ('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 "net/websockets/websocket_channel.h" 5 #include "net/websockets/websocket_channel.h"
6 6
7 #include <limits.h> // for INT_MAX 7 #include <limits.h> // for INT_MAX
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <deque> 10 #include <deque>
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 frames_.push_back(frame.release()); 146 frames_.push_back(frame.release());
147 } 147 }
148 148
149 // Implementation of WebSocketStream::ConnectDelegate that simply forwards the 149 // Implementation of WebSocketStream::ConnectDelegate that simply forwards the
150 // calls on to the WebSocketChannel that created it. 150 // calls on to the WebSocketChannel that created it.
151 class WebSocketChannel::ConnectDelegate 151 class WebSocketChannel::ConnectDelegate
152 : public WebSocketStream::ConnectDelegate { 152 : public WebSocketStream::ConnectDelegate {
153 public: 153 public:
154 explicit ConnectDelegate(WebSocketChannel* creator) : creator_(creator) {} 154 explicit ConnectDelegate(WebSocketChannel* creator) : creator_(creator) {}
155 155
156 virtual void OnSuccess(scoped_ptr<WebSocketStream> stream) override { 156 void OnSuccess(scoped_ptr<WebSocketStream> stream) override {
157 creator_->OnConnectSuccess(stream.Pass()); 157 creator_->OnConnectSuccess(stream.Pass());
158 // |this| may have been deleted. 158 // |this| may have been deleted.
159 } 159 }
160 160
161 virtual void OnFailure(const std::string& message) override { 161 void OnFailure(const std::string& message) override {
162 creator_->OnConnectFailure(message); 162 creator_->OnConnectFailure(message);
163 // |this| has been deleted. 163 // |this| has been deleted.
164 } 164 }
165 165
166 virtual void OnStartOpeningHandshake( 166 void OnStartOpeningHandshake(
167 scoped_ptr<WebSocketHandshakeRequestInfo> request) override { 167 scoped_ptr<WebSocketHandshakeRequestInfo> request) override {
168 creator_->OnStartOpeningHandshake(request.Pass()); 168 creator_->OnStartOpeningHandshake(request.Pass());
169 } 169 }
170 170
171 virtual void OnFinishOpeningHandshake( 171 void OnFinishOpeningHandshake(
172 scoped_ptr<WebSocketHandshakeResponseInfo> response) override { 172 scoped_ptr<WebSocketHandshakeResponseInfo> response) override {
173 creator_->OnFinishOpeningHandshake(response.Pass()); 173 creator_->OnFinishOpeningHandshake(response.Pass());
174 } 174 }
175 175
176 virtual void OnSSLCertificateError( 176 void OnSSLCertificateError(
177 scoped_ptr<WebSocketEventInterface::SSLErrorCallbacks> 177 scoped_ptr<WebSocketEventInterface::SSLErrorCallbacks>
178 ssl_error_callbacks, 178 ssl_error_callbacks,
179 const SSLInfo& ssl_info, 179 const SSLInfo& ssl_info,
180 bool fatal) override { 180 bool fatal) override {
181 creator_->OnSSLCertificateError( 181 creator_->OnSSLCertificateError(
182 ssl_error_callbacks.Pass(), ssl_info, fatal); 182 ssl_error_callbacks.Pass(), ssl_info, fatal);
183 } 183 }
184 184
185 private: 185 private:
186 // A pointer to the WebSocketChannel that created this object. There is no 186 // A pointer to the WebSocketChannel that created this object. There is no
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 } 1100 }
1101 1101
1102 void WebSocketChannel::CloseTimeout() { 1102 void WebSocketChannel::CloseTimeout() {
1103 stream_->Close(); 1103 stream_->Close();
1104 SetState(CLOSED); 1104 SetState(CLOSED);
1105 DoDropChannel(false, kWebSocketErrorAbnormalClosure, ""); 1105 DoDropChannel(false, kWebSocketErrorAbnormalClosure, "");
1106 // |this| has been deleted. 1106 // |this| has been deleted.
1107 } 1107 }
1108 1108
1109 } // namespace net 1109 } // namespace net
OLDNEW
« no previous file with comments | « net/websockets/websocket_basic_stream_test.cc ('k') | net/websockets/websocket_channel_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698