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

Side by Side Diff: net/websockets/websocket_job.h

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_inflater.cc ('k') | net/websockets/websocket_job_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef NET_WEBSOCKETS_WEBSOCKET_JOB_H_ 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_JOB_H_
6 #define NET_WEBSOCKETS_WEBSOCKET_JOB_H_ 6 #define NET_WEBSOCKETS_WEBSOCKET_JOB_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 OPEN = 1, 43 OPEN = 1,
44 CLOSING = 2, 44 CLOSING = 2,
45 CLOSED = 3, 45 CLOSED = 3,
46 }; 46 };
47 47
48 explicit WebSocketJob(SocketStream::Delegate* delegate); 48 explicit WebSocketJob(SocketStream::Delegate* delegate);
49 49
50 static void EnsureInit(); 50 static void EnsureInit();
51 51
52 State state() const { return state_; } 52 State state() const { return state_; }
53 virtual void Connect() override; 53 void Connect() override;
54 virtual bool SendData(const char* data, int len) override; 54 bool SendData(const char* data, int len) override;
55 virtual void Close() override; 55 void Close() override;
56 virtual void RestartWithAuth(const AuthCredentials& credentials) override; 56 void RestartWithAuth(const AuthCredentials& credentials) override;
57 virtual void DetachDelegate() override; 57 void DetachDelegate() override;
58 58
59 // SocketStream::Delegate methods. 59 // SocketStream::Delegate methods.
60 virtual int OnStartOpenConnection( 60 int OnStartOpenConnection(SocketStream* socket,
61 SocketStream* socket, const CompletionCallback& callback) override; 61 const CompletionCallback& callback) override;
62 virtual void OnConnected(SocketStream* socket, 62 void OnConnected(SocketStream* socket, int max_pending_send_allowed) override;
63 int max_pending_send_allowed) override; 63 void OnSentData(SocketStream* socket, int amount_sent) override;
64 virtual void OnSentData(SocketStream* socket, int amount_sent) override; 64 void OnReceivedData(SocketStream* socket, const char* data, int len) override;
65 virtual void OnReceivedData(SocketStream* socket, 65 void OnClose(SocketStream* socket) override;
66 const char* data, 66 void OnAuthRequired(SocketStream* socket,
67 int len) override; 67 AuthChallengeInfo* auth_info) override;
68 virtual void OnClose(SocketStream* socket) override; 68 void OnSSLCertificateError(SocketStream* socket,
69 virtual void OnAuthRequired( 69 const SSLInfo& ssl_info,
70 SocketStream* socket, AuthChallengeInfo* auth_info) override; 70 bool fatal) override;
71 virtual void OnSSLCertificateError(SocketStream* socket, 71 void OnError(const SocketStream* socket, int error) override;
72 const SSLInfo& ssl_info,
73 bool fatal) override;
74 virtual void OnError(const SocketStream* socket, int error) override;
75 72
76 // SpdyWebSocketStream::Delegate methods. 73 // SpdyWebSocketStream::Delegate methods.
77 virtual void OnCreatedSpdyStream(int status) override; 74 void OnCreatedSpdyStream(int status) override;
78 virtual void OnSentSpdyHeaders() override; 75 void OnSentSpdyHeaders() override;
79 virtual void OnSpdyResponseHeadersUpdated( 76 void OnSpdyResponseHeadersUpdated(
80 const SpdyHeaderBlock& response_headers) override; 77 const SpdyHeaderBlock& response_headers) override;
81 virtual void OnSentSpdyData(size_t bytes_sent) override; 78 void OnSentSpdyData(size_t bytes_sent) override;
82 virtual void OnReceivedSpdyData(scoped_ptr<SpdyBuffer> buffer) override; 79 void OnReceivedSpdyData(scoped_ptr<SpdyBuffer> buffer) override;
83 virtual void OnCloseSpdyStream() override; 80 void OnCloseSpdyStream() override;
84 81
85 private: 82 private:
86 friend class WebSocketThrottle; 83 friend class WebSocketThrottle;
87 friend class WebSocketJobTest; 84 friend class WebSocketJobTest;
88 virtual ~WebSocketJob(); 85 ~WebSocketJob() override;
89 86
90 bool SendHandshakeRequest(const char* data, int len); 87 bool SendHandshakeRequest(const char* data, int len);
91 void AddCookieHeaderAndSend(); 88 void AddCookieHeaderAndSend();
92 void LoadCookieCallback(const std::string& cookie); 89 void LoadCookieCallback(const std::string& cookie);
93 90
94 void OnSentHandshakeRequest(SocketStream* socket, int amount_sent); 91 void OnSentHandshakeRequest(SocketStream* socket, int amount_sent);
95 // Parses received data into handshake_response_. When finished receiving the 92 // Parses received data into handshake_response_. When finished receiving the
96 // response, calls SaveCookiesAndNotifyHeadersComplete(). 93 // response, calls SaveCookiesAndNotifyHeadersComplete().
97 void OnReceivedHandshakeResponse( 94 void OnReceivedHandshakeResponse(
98 SocketStream* socket, const char* data, int len); 95 SocketStream* socket, const char* data, int len);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 145
149 base::WeakPtrFactory<WebSocketJob> weak_ptr_factory_; 146 base::WeakPtrFactory<WebSocketJob> weak_ptr_factory_;
150 base::WeakPtrFactory<WebSocketJob> weak_ptr_factory_for_send_pending_; 147 base::WeakPtrFactory<WebSocketJob> weak_ptr_factory_for_send_pending_;
151 148
152 DISALLOW_COPY_AND_ASSIGN(WebSocketJob); 149 DISALLOW_COPY_AND_ASSIGN(WebSocketJob);
153 }; 150 };
154 151
155 } // namespace 152 } // namespace
156 153
157 #endif // NET_WEBSOCKETS_WEBSOCKET_JOB_H_ 154 #endif // NET_WEBSOCKETS_WEBSOCKET_JOB_H_
OLDNEW
« no previous file with comments | « net/websockets/websocket_inflater.cc ('k') | net/websockets/websocket_job_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698