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

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

Issue 667943003: Standardize usage of virtual/override/final in content/browser/ (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
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_host.h" 5 #include "content/browser/renderer_host/websocket_host.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "content/browser/renderer_host/websocket_dispatcher_host.h" 10 #include "content/browser/renderer_host/websocket_dispatcher_host.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 82
83 // Implementation of net::WebSocketEventInterface. Receives events from our 83 // Implementation of net::WebSocketEventInterface. Receives events from our
84 // WebSocketChannel object. Each event is translated to an IPC and sent to the 84 // WebSocketChannel object. Each event is translated to an IPC and sent to the
85 // renderer or child process via WebSocketDispatcherHost. 85 // renderer or child process via WebSocketDispatcherHost.
86 class WebSocketEventHandler : public net::WebSocketEventInterface { 86 class WebSocketEventHandler : public net::WebSocketEventInterface {
87 public: 87 public:
88 WebSocketEventHandler(WebSocketDispatcherHost* dispatcher, 88 WebSocketEventHandler(WebSocketDispatcherHost* dispatcher,
89 int routing_id, 89 int routing_id,
90 int render_frame_id); 90 int render_frame_id);
91 virtual ~WebSocketEventHandler(); 91 ~WebSocketEventHandler() override;
92 92
93 // net::WebSocketEventInterface implementation 93 // net::WebSocketEventInterface implementation
94 94
95 virtual ChannelState OnAddChannelResponse( 95 ChannelState OnAddChannelResponse(bool fail,
96 bool fail, 96 const std::string& selected_subprotocol,
97 const std::string& selected_subprotocol, 97 const std::string& extensions) override;
98 const std::string& extensions) override; 98 ChannelState OnDataFrame(bool fin,
99 virtual ChannelState OnDataFrame(bool fin, 99 WebSocketMessageType type,
100 WebSocketMessageType type, 100 const std::vector<char>& data) override;
101 const std::vector<char>& data) override; 101 ChannelState OnClosingHandshake() override;
102 virtual ChannelState OnClosingHandshake() override; 102 ChannelState OnFlowControl(int64 quota) override;
103 virtual ChannelState OnFlowControl(int64 quota) override; 103 ChannelState OnDropChannel(bool was_clean,
104 virtual ChannelState OnDropChannel(bool was_clean, 104 uint16 code,
105 uint16 code, 105 const std::string& reason) override;
106 const std::string& reason) override; 106 ChannelState OnFailChannel(const std::string& message) override;
107 virtual ChannelState OnFailChannel(const std::string& message) override; 107 ChannelState OnStartOpeningHandshake(
108 virtual ChannelState OnStartOpeningHandshake(
109 scoped_ptr<net::WebSocketHandshakeRequestInfo> request) override; 108 scoped_ptr<net::WebSocketHandshakeRequestInfo> request) override;
110 virtual ChannelState OnFinishOpeningHandshake( 109 ChannelState OnFinishOpeningHandshake(
111 scoped_ptr<net::WebSocketHandshakeResponseInfo> response) override; 110 scoped_ptr<net::WebSocketHandshakeResponseInfo> response) override;
112 virtual ChannelState OnSSLCertificateError( 111 ChannelState OnSSLCertificateError(
113 scoped_ptr<net::WebSocketEventInterface::SSLErrorCallbacks> callbacks, 112 scoped_ptr<net::WebSocketEventInterface::SSLErrorCallbacks> callbacks,
114 const GURL& url, 113 const GURL& url,
115 const net::SSLInfo& ssl_info, 114 const net::SSLInfo& ssl_info,
116 bool fatal) override; 115 bool fatal) override;
117 116
118 private: 117 private:
119 class SSLErrorHandlerDelegate : public SSLErrorHandler::Delegate { 118 class SSLErrorHandlerDelegate : public SSLErrorHandler::Delegate {
120 public: 119 public:
121 SSLErrorHandlerDelegate( 120 SSLErrorHandlerDelegate(
122 scoped_ptr<net::WebSocketEventInterface::SSLErrorCallbacks> callbacks); 121 scoped_ptr<net::WebSocketEventInterface::SSLErrorCallbacks> callbacks);
123 virtual ~SSLErrorHandlerDelegate(); 122 ~SSLErrorHandlerDelegate() override;
124 123
125 base::WeakPtr<SSLErrorHandler::Delegate> GetWeakPtr(); 124 base::WeakPtr<SSLErrorHandler::Delegate> GetWeakPtr();
126 125
127 // SSLErrorHandler::Delegate methods 126 // SSLErrorHandler::Delegate methods
128 virtual void CancelSSLRequest(int error, 127 void CancelSSLRequest(int error, const net::SSLInfo* ssl_info) override;
129 const net::SSLInfo* ssl_info) override; 128 void ContinueSSLRequest() override;
130 virtual void ContinueSSLRequest() override;
131 129
132 private: 130 private:
133 scoped_ptr<net::WebSocketEventInterface::SSLErrorCallbacks> callbacks_; 131 scoped_ptr<net::WebSocketEventInterface::SSLErrorCallbacks> callbacks_;
134 base::WeakPtrFactory<SSLErrorHandlerDelegate> weak_ptr_factory_; 132 base::WeakPtrFactory<SSLErrorHandlerDelegate> weak_ptr_factory_;
135 133
136 DISALLOW_COPY_AND_ASSIGN(SSLErrorHandlerDelegate); 134 DISALLOW_COPY_AND_ASSIGN(SSLErrorHandlerDelegate);
137 }; 135 };
138 136
139 WebSocketDispatcherHost* const dispatcher_; 137 WebSocketDispatcherHost* const dispatcher_;
140 const int routing_id_; 138 const int routing_id_;
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 DVLOG(3) << "WebSocketHost::OnDropChannel" 383 DVLOG(3) << "WebSocketHost::OnDropChannel"
386 << " routing_id=" << routing_id_ << " was_clean=" << was_clean 384 << " routing_id=" << routing_id_ << " was_clean=" << was_clean
387 << " code=" << code << " reason=\"" << reason << "\""; 385 << " code=" << code << " reason=\"" << reason << "\"";
388 386
389 DCHECK(channel_); 387 DCHECK(channel_);
390 // TODO(yhirano): Handle |was_clean| appropriately. 388 // TODO(yhirano): Handle |was_clean| appropriately.
391 channel_->StartClosingHandshake(code, reason); 389 channel_->StartClosingHandshake(code, reason);
392 } 390 }
393 391
394 } // namespace content 392 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/websocket_dispatcher_host_unittest.cc ('k') | content/browser/resolve_proxy_msg_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698