diff options
author | dcheng <dcheng@chromium.org> | 2014-10-29 11:31:41 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-29 18:32:00 +0000 |
commit | 561aa1d478ced47101fa8a3c9aa90c7c3f425549 (patch) | |
tree | 7564d4a8ea741ecaeb3538780da8ae9bc46b6128 /net/tools/flip_server | |
parent | 98ee835a49b59183909c730bf7d4283ea11b8281 (diff) | |
download | chromium_src-561aa1d478ced47101fa8a3c9aa90c7c3f425549.zip chromium_src-561aa1d478ced47101fa8a3c9aa90c7c3f425549.tar.gz chromium_src-561aa1d478ced47101fa8a3c9aa90c7c3f425549.tar.bz2 |
Standardize usage of virtual/override/final specifiers.
The Google C++ style guide states:
Explicitly annotate overrides of virtual functions or virtual
destructors with an override or (less frequently) final specifier.
Older (pre-C++11) code will use the virtual keyword as an inferior
alternative annotation. For clarity, use exactly one of override,
final, or virtual when declaring an override.
To better conform to these guidelines, the following constructs have
been rewritten:
- if a base class has a virtual destructor, then:
virtual ~Foo(); -> ~Foo() override;
- virtual void Foo() override; -> void Foo() override;
- virtual void Foo() override final; -> void Foo() final;
This patch was automatically generated. The clang plugin can generate
fixit hints, which are suggested edits when it is 100% sure it knows how
to fix a problem. The hints from the clang plugin were applied to the
source tree using the tool in https://codereview.chromium.org/598073004.
BUG=417463
R=szym@chromium.org
Review URL: https://codereview.chromium.org/679633004
Cr-Commit-Position: refs/heads/master@{#301884}
Diffstat (limited to 'net/tools/flip_server')
-rw-r--r-- | net/tools/flip_server/acceptor_thread.h | 18 | ||||
-rw-r--r-- | net/tools/flip_server/http_interface.h | 135 | ||||
-rw-r--r-- | net/tools/flip_server/http_interface_test.cc | 8 | ||||
-rw-r--r-- | net/tools/flip_server/mem_cache.h | 59 | ||||
-rw-r--r-- | net/tools/flip_server/mem_cache_test.cc | 5 | ||||
-rw-r--r-- | net/tools/flip_server/output_ordering.h | 12 | ||||
-rw-r--r-- | net/tools/flip_server/ring_buffer.h | 28 | ||||
-rw-r--r-- | net/tools/flip_server/sm_connection.h | 20 | ||||
-rw-r--r-- | net/tools/flip_server/spdy_interface.cc | 2 | ||||
-rw-r--r-- | net/tools/flip_server/spdy_interface.h | 145 | ||||
-rw-r--r-- | net/tools/flip_server/streamer_interface.h | 133 |
11 files changed, 274 insertions, 291 deletions
diff --git a/net/tools/flip_server/acceptor_thread.h b/net/tools/flip_server/acceptor_thread.h index ecb4316..981a089 100644 --- a/net/tools/flip_server/acceptor_thread.h +++ b/net/tools/flip_server/acceptor_thread.h @@ -47,19 +47,17 @@ class SMAcceptorThread : public base::SimpleThread, public SMConnectionPoolInterface { public: SMAcceptorThread(FlipAcceptor* acceptor, MemoryCache* memory_cache); - virtual ~SMAcceptorThread(); + ~SMAcceptorThread() override; // EpollCallbackInteface interface - virtual void OnRegistration(EpollServer* eps, - int fd, - int event_mask) override {} - virtual void OnModification(int fd, int event_mask) override {} - virtual void OnEvent(int fd, EpollEvent* event) override; - virtual void OnUnregistration(int fd, bool replaced) override {} - virtual void OnShutdown(EpollServer* eps, int fd) override {} + void OnRegistration(EpollServer* eps, int fd, int event_mask) override {} + void OnModification(int fd, int event_mask) override {} + void OnEvent(int fd, EpollEvent* event) override; + void OnUnregistration(int fd, bool replaced) override {} + void OnShutdown(EpollServer* eps, int fd) override {} // SMConnectionPool interface - virtual void SMConnectionDone(SMConnection* sc) override; + void SMConnectionDone(SMConnection* sc) override; // TODO(mbelshe): figure out if we can move these to private functions. SMConnection* NewConnection(); @@ -75,7 +73,7 @@ class SMAcceptorThread : public base::SimpleThread, // idle longer than the configured timeout. void HandleConnectionIdleTimeout(); - virtual void Run() override; + void Run() override; private: EpollServer epoll_server_; diff --git a/net/tools/flip_server/http_interface.h b/net/tools/flip_server/http_interface.h index 08a595e..c6dc978 100644 --- a/net/tools/flip_server/http_interface.h +++ b/net/tools/flip_server/http_interface.h @@ -28,86 +28,83 @@ class HttpSM : public BalsaVisitorInterface, public SMInterface { SMInterface* sm_spdy_interface, MemoryCache* memory_cache, FlipAcceptor* acceptor); - virtual ~HttpSM(); + ~HttpSM() override; private: // BalsaVisitorInterface: - virtual void ProcessBodyInput(const char* input, size_t size) override {} - virtual void ProcessBodyData(const char* input, size_t size) override; - virtual void ProcessHeaderInput(const char* input, size_t size) override {} - virtual void ProcessTrailerInput(const char* input, size_t size) override {} - virtual void ProcessHeaders(const BalsaHeaders& headers) override; - virtual void ProcessRequestFirstLine(const char* line_input, - size_t line_length, - const char* method_input, - size_t method_length, - const char* request_uri_input, - size_t request_uri_length, - const char* version_input, - size_t version_length) override {} - virtual void ProcessResponseFirstLine(const char* line_input, - size_t line_length, - const char* version_input, - size_t version_length, - const char* status_input, - size_t status_length, - const char* reason_input, - size_t reason_length) override {} - virtual void ProcessChunkLength(size_t chunk_length) override {} - virtual void ProcessChunkExtensions(const char* input, size_t size) override { - } - virtual void HeaderDone() override {} - virtual void MessageDone() override; - virtual void HandleHeaderError(BalsaFrame* framer) override; - virtual void HandleHeaderWarning(BalsaFrame* framer) override {} - virtual void HandleChunkingError(BalsaFrame* framer) override; - virtual void HandleBodyError(BalsaFrame* framer) override; + void ProcessBodyInput(const char* input, size_t size) override {} + void ProcessBodyData(const char* input, size_t size) override; + void ProcessHeaderInput(const char* input, size_t size) override {} + void ProcessTrailerInput(const char* input, size_t size) override {} + void ProcessHeaders(const BalsaHeaders& headers) override; + void ProcessRequestFirstLine(const char* line_input, + size_t line_length, + const char* method_input, + size_t method_length, + const char* request_uri_input, + size_t request_uri_length, + const char* version_input, + size_t version_length) override {} + void ProcessResponseFirstLine(const char* line_input, + size_t line_length, + const char* version_input, + size_t version_length, + const char* status_input, + size_t status_length, + const char* reason_input, + size_t reason_length) override {} + void ProcessChunkLength(size_t chunk_length) override {} + void ProcessChunkExtensions(const char* input, size_t size) override {} + void HeaderDone() override {} + void MessageDone() override; + void HandleHeaderError(BalsaFrame* framer) override; + void HandleHeaderWarning(BalsaFrame* framer) override {} + void HandleChunkingError(BalsaFrame* framer) override; + void HandleBodyError(BalsaFrame* framer) override; void HandleError(); public: void AddToOutputOrder(const MemCacheIter& mci); BalsaFrame* spdy_framer() { return http_framer_; } - virtual void set_is_request() override {} + void set_is_request() override {} const OutputOrdering& output_ordering() const { return output_ordering_; } // SMInterface: - virtual void InitSMInterface(SMInterface* sm_spdy_interface, - int32 server_idx) override; - virtual void InitSMConnection(SMConnectionPoolInterface* connection_pool, - SMInterface* sm_interface, - EpollServer* epoll_server, - int fd, - std::string server_ip, - std::string server_port, - std::string remote_ip, - bool use_ssl) override; - virtual size_t ProcessReadInput(const char* data, size_t len) override; - virtual size_t ProcessWriteInput(const char* data, size_t len) override; - virtual bool MessageFullyRead() const override; - virtual void SetStreamID(uint32 stream_id) override; - virtual bool Error() const override; - virtual const char* ErrorAsString() const override; - virtual void Reset() override; - virtual void ResetForNewInterface(int32 server_idx) override {} - virtual void ResetForNewConnection() override; - virtual void Cleanup() override; - virtual int PostAcceptHook() override; - - virtual void NewStream(uint32 stream_id, - uint32 priority, - const std::string& filename) override; - virtual void SendEOF(uint32 stream_id) override; - virtual void SendErrorNotFound(uint32 stream_id) override; - virtual size_t SendSynStream(uint32 stream_id, - const BalsaHeaders& headers) override; - virtual size_t SendSynReply(uint32 stream_id, - const BalsaHeaders& headers) override; - virtual void SendDataFrame(uint32 stream_id, - const char* data, - int64 len, - uint32 flags, - bool compress) override; + void InitSMInterface(SMInterface* sm_spdy_interface, + int32 server_idx) override; + void InitSMConnection(SMConnectionPoolInterface* connection_pool, + SMInterface* sm_interface, + EpollServer* epoll_server, + int fd, + std::string server_ip, + std::string server_port, + std::string remote_ip, + bool use_ssl) override; + size_t ProcessReadInput(const char* data, size_t len) override; + size_t ProcessWriteInput(const char* data, size_t len) override; + bool MessageFullyRead() const override; + void SetStreamID(uint32 stream_id) override; + bool Error() const override; + const char* ErrorAsString() const override; + void Reset() override; + void ResetForNewInterface(int32 server_idx) override {} + void ResetForNewConnection() override; + void Cleanup() override; + int PostAcceptHook() override; + + void NewStream(uint32 stream_id, + uint32 priority, + const std::string& filename) override; + void SendEOF(uint32 stream_id) override; + void SendErrorNotFound(uint32 stream_id) override; + size_t SendSynStream(uint32 stream_id, const BalsaHeaders& headers) override; + size_t SendSynReply(uint32 stream_id, const BalsaHeaders& headers) override; + void SendDataFrame(uint32 stream_id, + const char* data, + int64 len, + uint32 flags, + bool compress) override; private: void SendEOFImpl(uint32 stream_id); @@ -121,7 +118,7 @@ class HttpSM : public BalsaVisitorInterface, public SMInterface { uint32 flags, bool compress); void EnqueueDataFrame(DataFrame* df); - virtual void GetOutput() override; + void GetOutput() override; private: BalsaFrame* http_framer_; diff --git a/net/tools/flip_server/http_interface_test.cc b/net/tools/flip_server/http_interface_test.cc index 9e72279..6d07840 100644 --- a/net/tools/flip_server/http_interface_test.cc +++ b/net/tools/flip_server/http_interface_test.cc @@ -86,7 +86,7 @@ class FlipHttpSMTest : public ::testing::Test { acceptor_.get())); } - virtual void TearDown() override { + void TearDown() override { if (acceptor_->listen_fd_ >= 0) { epoll_server_->UnregisterFD(acceptor_->listen_fd_); close(acceptor_->listen_fd_); @@ -111,19 +111,19 @@ class FlipHttpSMTest : public ::testing::Test { class FlipHttpSMProxyTest : public FlipHttpSMTest { public: FlipHttpSMProxyTest() : FlipHttpSMTest(FLIP_HANDLER_PROXY) {} - virtual ~FlipHttpSMProxyTest() {} + ~FlipHttpSMProxyTest() override {} }; class FlipHttpSMHttpTest : public FlipHttpSMTest { public: FlipHttpSMHttpTest() : FlipHttpSMTest(FLIP_HANDLER_HTTP_SERVER) {} - virtual ~FlipHttpSMHttpTest() {} + ~FlipHttpSMHttpTest() override {} }; class FlipHttpSMSpdyTest : public FlipHttpSMTest { public: FlipHttpSMSpdyTest() : FlipHttpSMTest(FLIP_HANDLER_SPDY_SERVER) {} - virtual ~FlipHttpSMSpdyTest() {} + ~FlipHttpSMSpdyTest() override {} }; TEST_F(FlipHttpSMTest, Construct) { diff --git a/net/tools/flip_server/mem_cache.h b/net/tools/flip_server/mem_cache.h index 63befee..6d311b2 100644 --- a/net/tools/flip_server/mem_cache.h +++ b/net/tools/flip_server/mem_cache.h @@ -21,39 +21,38 @@ class StoreBodyAndHeadersVisitor : public BalsaVisitorInterface { void HandleError() { error_ = true; } // BalsaVisitorInterface: - virtual void ProcessBodyInput(const char* input, size_t size) override {} - virtual void ProcessBodyData(const char* input, size_t size) override; - virtual void ProcessHeaderInput(const char* input, size_t size) override {} - virtual void ProcessTrailerInput(const char* input, size_t size) override {} - virtual void ProcessHeaders(const BalsaHeaders& headers) override { + void ProcessBodyInput(const char* input, size_t size) override {} + void ProcessBodyData(const char* input, size_t size) override; + void ProcessHeaderInput(const char* input, size_t size) override {} + void ProcessTrailerInput(const char* input, size_t size) override {} + void ProcessHeaders(const BalsaHeaders& headers) override { // nothing to do here-- we're assuming that the BalsaFrame has // been handed our headers. } - virtual void ProcessRequestFirstLine(const char* line_input, - size_t line_length, - const char* method_input, - size_t method_length, - const char* request_uri_input, - size_t request_uri_length, - const char* version_input, - size_t version_length) override {} - virtual void ProcessResponseFirstLine(const char* line_input, - size_t line_length, - const char* version_input, - size_t version_length, - const char* status_input, - size_t status_length, - const char* reason_input, - size_t reason_length) override {} - virtual void ProcessChunkLength(size_t chunk_length) override {} - virtual void ProcessChunkExtensions(const char* input, size_t size) override { - } - virtual void HeaderDone() override {} - virtual void MessageDone() override {} - virtual void HandleHeaderError(BalsaFrame* framer) override; - virtual void HandleHeaderWarning(BalsaFrame* framer) override; - virtual void HandleChunkingError(BalsaFrame* framer) override; - virtual void HandleBodyError(BalsaFrame* framer) override; + void ProcessRequestFirstLine(const char* line_input, + size_t line_length, + const char* method_input, + size_t method_length, + const char* request_uri_input, + size_t request_uri_length, + const char* version_input, + size_t version_length) override {} + void ProcessResponseFirstLine(const char* line_input, + size_t line_length, + const char* version_input, + size_t version_length, + const char* status_input, + size_t status_length, + const char* reason_input, + size_t reason_length) override {} + void ProcessChunkLength(size_t chunk_length) override {} + void ProcessChunkExtensions(const char* input, size_t size) override {} + void HeaderDone() override {} + void MessageDone() override {} + void HandleHeaderError(BalsaFrame* framer) override; + void HandleHeaderWarning(BalsaFrame* framer) override; + void HandleChunkingError(BalsaFrame* framer) override; + void HandleBodyError(BalsaFrame* framer) override; BalsaHeaders headers; std::string body; diff --git a/net/tools/flip_server/mem_cache_test.cc b/net/tools/flip_server/mem_cache_test.cc index bb01907..87dca68 100644 --- a/net/tools/flip_server/mem_cache_test.cc +++ b/net/tools/flip_server/mem_cache_test.cc @@ -13,10 +13,9 @@ namespace { class MemoryCacheWithFakeReadToString : public MemoryCache { public: - virtual ~MemoryCacheWithFakeReadToString() {} + ~MemoryCacheWithFakeReadToString() override {} - virtual void ReadToString(const char* filename, - std::string* output) override { + void ReadToString(const char* filename, std::string* output) override { *output = data_map_[filename]; } diff --git a/net/tools/flip_server/output_ordering.h b/net/tools/flip_server/output_ordering.h index 488d2e9..82cbfd2 100644 --- a/net/tools/flip_server/output_ordering.h +++ b/net/tools/flip_server/output_ordering.h @@ -53,14 +53,14 @@ class OutputOrdering { BeginOutputtingAlarm(OutputOrdering* oo, OutputOrdering::PriorityMapPointer* pmp, const MemCacheIter& mci); - virtual ~BeginOutputtingAlarm(); + ~BeginOutputtingAlarm() override; // EpollAlarmCallbackInterface: - virtual int64 OnAlarm() override; - virtual void OnRegistration(const EpollServer::AlarmRegToken& tok, - EpollServer* eps) override; - virtual void OnUnregistration() override; - virtual void OnShutdown(EpollServer* eps) override; + int64 OnAlarm() override; + void OnRegistration(const EpollServer::AlarmRegToken& tok, + EpollServer* eps) override; + void OnUnregistration() override; + void OnShutdown(EpollServer* eps) override; private: OutputOrdering* output_ordering_; diff --git a/net/tools/flip_server/ring_buffer.h b/net/tools/flip_server/ring_buffer.h index bb3b39f..9b0edfc 100644 --- a/net/tools/flip_server/ring_buffer.h +++ b/net/tools/flip_server/ring_buffer.h @@ -26,7 +26,7 @@ namespace net { class RingBuffer : public BufferInterface { public: explicit RingBuffer(int buffer_size); - virtual ~RingBuffer(); + ~RingBuffer() override; // Resize the buffer to the size specified here. If the buffer_size passed // in here is smaller than the amount of data in the buffer, then the oldest @@ -38,32 +38,32 @@ class RingBuffer : public BufferInterface { // The following functions all override pure virtual functions // in BufferInterface. See buffer_interface.h for a description // of what they do if the function isn't documented here. - virtual int ReadableBytes() const override; - virtual int BufferSize() const override; - virtual int BytesFree() const override; + int ReadableBytes() const override; + int BufferSize() const override; + int BytesFree() const override; - virtual bool Empty() const override; - virtual bool Full() const override; + bool Empty() const override; + bool Full() const override; // returns the number of characters written. // appends up-to-'size' bytes to the ringbuffer. - virtual int Write(const char* bytes, int size) override; + int Write(const char* bytes, int size) override; // Stores a pointer into the ring buffer in *ptr, and stores the number of // characters which are allowed to be written in *size. // If there are no writable bytes available, then *size will contain 0. - virtual void GetWritablePtr(char** ptr, int* size) const override; + void GetWritablePtr(char** ptr, int* size) const override; // Stores a pointer into the ring buffer in *ptr, and stores the number of // characters which are allowed to be read in *size. // If there are no readable bytes available, then *size will contain 0. - virtual void GetReadablePtr(char** ptr, int* size) const override; + void GetReadablePtr(char** ptr, int* size) const override; // Returns the number of bytes read into 'bytes'. - virtual int Read(char* bytes, int size) override; + int Read(char* bytes, int size) override; // Removes all data from the ring buffer. - virtual void Clear() override; + void Clear() override; // Reserves contiguous writable empty space in the buffer of size bytes. // Since the point of this class is to have a fixed size buffer, be careful @@ -76,15 +76,15 @@ class RingBuffer : public BufferInterface { // to consolidate fragmented free space. If the size requested is less than // or equal to BytesFree(), it is guaranteed that the buffer size will not // change. - virtual bool Reserve(int size) override; + bool Reserve(int size) override; // Removes the oldest 'amount_to_advance' characters. // If amount_to_consume > ReadableBytes(), this performs a Clear() instead. - virtual void AdvanceReadablePtr(int amount_to_advance) override; + void AdvanceReadablePtr(int amount_to_advance) override; // Moves the internal pointers around such that the amount of data specified // here is expected to already be resident (as if it was Written). - virtual void AdvanceWritablePtr(int amount_to_advance) override; + void AdvanceWritablePtr(int amount_to_advance) override; protected: int read_idx() const { return read_idx_; } diff --git a/net/tools/flip_server/sm_connection.h b/net/tools/flip_server/sm_connection.h index 5c5a5fd..c3b7393 100644 --- a/net/tools/flip_server/sm_connection.h +++ b/net/tools/flip_server/sm_connection.h @@ -44,7 +44,7 @@ class SMConnection : public SMConnectionInterface, public EpollCallbackInterface, public NotifierInterface { public: - virtual ~SMConnection(); + ~SMConnection() override; static SMConnection* NewSMConnection(EpollServer* epoll_server, SSLState* ssl_state, @@ -57,10 +57,10 @@ class SMConnection : public SMConnectionInterface, std::string server_ip_; std::string server_port_; - virtual EpollServer* epoll_server() override; + EpollServer* epoll_server() override; OutputList* output_list() { return &output_list_; } MemoryCache* memory_cache() { return memory_cache_; } - virtual void ReadyToSend() override; + void ReadyToSend() override; void EnqueueDataFrame(DataFrame* df); int fd() const { return fd_; } @@ -82,16 +82,14 @@ class SMConnection : public SMConnectionInterface, int Send(const char* data, int len, int flags); // EpollCallbackInterface interface. - virtual void OnRegistration(EpollServer* eps, - int fd, - int event_mask) override; - virtual void OnModification(int fd, int event_mask) override {} - virtual void OnEvent(int fd, EpollEvent* event) override; - virtual void OnUnregistration(int fd, bool replaced) override; - virtual void OnShutdown(EpollServer* eps, int fd) override; + void OnRegistration(EpollServer* eps, int fd, int event_mask) override; + void OnModification(int fd, int event_mask) override {} + void OnEvent(int fd, EpollEvent* event) override; + void OnUnregistration(int fd, bool replaced) override; + void OnShutdown(EpollServer* eps, int fd) override; // NotifierInterface interface. - virtual void Notify() override {} + void Notify() override {} void Cleanup(const char* cleanup); diff --git a/net/tools/flip_server/spdy_interface.cc b/net/tools/flip_server/spdy_interface.cc index eec20c0..297045d 100644 --- a/net/tools/flip_server/spdy_interface.cc +++ b/net/tools/flip_server/spdy_interface.cc @@ -27,7 +27,7 @@ class SpdyFrameDataFrame : public DataFrame { size = spdy_frame->size(); } - virtual ~SpdyFrameDataFrame() { delete frame; } + ~SpdyFrameDataFrame() override { delete frame; } const SpdyFrame* frame; }; diff --git a/net/tools/flip_server/spdy_interface.h b/net/tools/flip_server/spdy_interface.h index 2d2437a..de53e87 100644 --- a/net/tools/flip_server/spdy_interface.h +++ b/net/tools/flip_server/spdy_interface.h @@ -32,25 +32,25 @@ class SpdySM : public BufferedSpdyFramerVisitorInterface, public SMInterface { MemoryCache* memory_cache, FlipAcceptor* acceptor, SpdyMajorVersion spdy_version); - virtual ~SpdySM(); + ~SpdySM() override; - virtual void InitSMInterface(SMInterface* sm_http_interface, - int32 server_idx) override {} + void InitSMInterface(SMInterface* sm_http_interface, + int32 server_idx) override {} - virtual void InitSMConnection(SMConnectionPoolInterface* connection_pool, - SMInterface* sm_interface, - EpollServer* epoll_server, - int fd, - std::string server_ip, - std::string server_port, - std::string remote_ip, - bool use_ssl) override; + void InitSMConnection(SMConnectionPoolInterface* connection_pool, + SMInterface* sm_interface, + EpollServer* epoll_server, + int fd, + std::string server_ip, + std::string server_port, + std::string remote_ip, + bool use_ssl) override; // Create new SPDY framer after reusing SpdySM and negotiating new version void CreateFramer(SpdyMajorVersion spdy_version); private: - virtual void set_is_request() override {} + void set_is_request() override {} SMInterface* NewConnectionInterface(); // virtual for tests virtual SMInterface* FindOrMakeNewSMConnectionInterface( @@ -63,31 +63,31 @@ class SpdySM : public BufferedSpdyFramerVisitorInterface, public SMInterface { bool* is_https_scheme); // BufferedSpdyFramerVisitorInterface: - virtual void OnError(SpdyFramer::SpdyError error_code) override {} - virtual void OnStreamError(SpdyStreamId stream_id, - const std::string& description) override {} + void OnError(SpdyFramer::SpdyError error_code) override {} + void OnStreamError(SpdyStreamId stream_id, + const std::string& description) override {} // Called after all the header data for SYN_STREAM control frame is received. - virtual void OnSynStream(SpdyStreamId stream_id, - SpdyStreamId associated_stream_id, - SpdyPriority priority, - bool fin, - bool unidirectional, - const SpdyHeaderBlock& headers) override; + void OnSynStream(SpdyStreamId stream_id, + SpdyStreamId associated_stream_id, + SpdyPriority priority, + bool fin, + bool unidirectional, + const SpdyHeaderBlock& headers) override; // Called after all the header data for SYN_REPLY control frame is received. - virtual void OnSynReply(SpdyStreamId stream_id, - bool fin, - const SpdyHeaderBlock& headers) override; + void OnSynReply(SpdyStreamId stream_id, + bool fin, + const SpdyHeaderBlock& headers) override; // Called after all the header data for HEADERS control frame is received. - virtual void OnHeaders(SpdyStreamId stream_id, - bool fin, - const SpdyHeaderBlock& headers) override; + void OnHeaders(SpdyStreamId stream_id, + bool fin, + const SpdyHeaderBlock& headers) override; // Called when data frame header is received. - virtual void OnDataFrameHeader(SpdyStreamId stream_id, - size_t length, - bool fin) override {} + void OnDataFrameHeader(SpdyStreamId stream_id, + size_t length, + bool fin) override {} // Called when data is received. // |stream_id| The stream receiving data. @@ -95,76 +95,71 @@ class SpdySM : public BufferedSpdyFramerVisitorInterface, public SMInterface { // |len| The length of the data buffer. // When the other side has finished sending data on this stream, // this method will be called with a zero-length buffer. - virtual void OnStreamFrameData(SpdyStreamId stream_id, - const char* data, - size_t len, - bool fin) override; + void OnStreamFrameData(SpdyStreamId stream_id, + const char* data, + size_t len, + bool fin) override; // Called when a SETTINGS frame is received. // |clear_persisted| True if the respective flag is set on the SETTINGS frame. - virtual void OnSettings(bool clear_persisted) override {} + void OnSettings(bool clear_persisted) override {} // Called when an individual setting within a SETTINGS frame has been parsed // and validated. - virtual void OnSetting(SpdySettingsIds id, - uint8 flags, - uint32 value) override {} + void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) override {} // Called when a PING frame has been parsed. - virtual void OnPing(SpdyPingId unique_id, bool is_ack) override {} + void OnPing(SpdyPingId unique_id, bool is_ack) override {} // Called when a RST_STREAM frame has been parsed. - virtual void OnRstStream(SpdyStreamId stream_id, - SpdyRstStreamStatus status) override; + void OnRstStream(SpdyStreamId stream_id, SpdyRstStreamStatus status) override; // Called when a GOAWAY frame has been parsed. - virtual void OnGoAway(SpdyStreamId last_accepted_stream_id, - SpdyGoAwayStatus status) override {} + void OnGoAway(SpdyStreamId last_accepted_stream_id, + SpdyGoAwayStatus status) override {} // Called when a WINDOW_UPDATE frame has been parsed. - virtual void OnWindowUpdate(SpdyStreamId stream_id, - uint32 delta_window_size) override {} + void OnWindowUpdate(SpdyStreamId stream_id, + uint32 delta_window_size) override {} // Called when a PUSH_PROMISE frame has been parsed. - virtual void OnPushPromise(SpdyStreamId stream_id, - SpdyStreamId promised_stream_id, - const SpdyHeaderBlock& headers) override {} + void OnPushPromise(SpdyStreamId stream_id, + SpdyStreamId promised_stream_id, + const SpdyHeaderBlock& headers) override {} - virtual bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override; + bool OnUnknownFrame(SpdyStreamId stream_id, int frame_type) override; public: - virtual size_t ProcessReadInput(const char* data, size_t len) override; - virtual size_t ProcessWriteInput(const char* data, size_t len) override; - virtual bool MessageFullyRead() const override; - virtual void SetStreamID(uint32 stream_id) override {} - virtual bool Error() const override; - virtual const char* ErrorAsString() const override; - virtual void Reset() override {} - virtual void ResetForNewInterface(int32 server_idx) override; - virtual void ResetForNewConnection() override; + size_t ProcessReadInput(const char* data, size_t len) override; + size_t ProcessWriteInput(const char* data, size_t len) override; + bool MessageFullyRead() const override; + void SetStreamID(uint32 stream_id) override {} + bool Error() const override; + const char* ErrorAsString() const override; + void Reset() override {} + void ResetForNewInterface(int32 server_idx) override; + void ResetForNewConnection() override; // SMInterface's Cleanup is currently only called by SMConnection after a // protocol message as been fully read. Spdy's SMInterface does not need // to do any cleanup at this time. // TODO(klindsay) This method is probably not being used properly and // some logic review and method renaming is probably in order. - virtual void Cleanup() override {} + void Cleanup() override {} // Send a settings frame - virtual int PostAcceptHook() override; - virtual void NewStream(uint32 stream_id, - uint32 priority, - const std::string& filename) override; + int PostAcceptHook() override; + void NewStream(uint32 stream_id, + uint32 priority, + const std::string& filename) override; void AddToOutputOrder(const MemCacheIter& mci); - virtual void SendEOF(uint32 stream_id) override; - virtual void SendErrorNotFound(uint32 stream_id) override; - virtual size_t SendSynStream(uint32 stream_id, - const BalsaHeaders& headers) override; - virtual size_t SendSynReply(uint32 stream_id, - const BalsaHeaders& headers) override; - virtual void SendDataFrame(uint32 stream_id, - const char* data, - int64 len, - uint32 flags, - bool compress) override; + void SendEOF(uint32 stream_id) override; + void SendErrorNotFound(uint32 stream_id) override; + size_t SendSynStream(uint32 stream_id, const BalsaHeaders& headers) override; + size_t SendSynReply(uint32 stream_id, const BalsaHeaders& headers) override; + void SendDataFrame(uint32 stream_id, + const char* data, + int64 len, + uint32 flags, + bool compress) override; BufferedSpdyFramer* spdy_framer() { return buffered_spdy_framer_.get(); } const OutputOrdering& output_ordering() const { @@ -193,7 +188,7 @@ class SpdySM : public BufferedSpdyFramerVisitorInterface, public SMInterface { SpdyDataFlags flags, bool compress); void EnqueueDataFrame(DataFrame* df); - virtual void GetOutput() override; + void GetOutput() override; private: scoped_ptr<BufferedSpdyFramer> buffered_spdy_framer_; diff --git a/net/tools/flip_server/streamer_interface.h b/net/tools/flip_server/streamer_interface.h index ca04f1e..69891f3 100644 --- a/net/tools/flip_server/streamer_interface.h +++ b/net/tools/flip_server/streamer_interface.h @@ -26,48 +26,46 @@ class StreamerSM : public BalsaVisitorInterface, public SMInterface { SMInterface* sm_other_interface, EpollServer* epoll_server, FlipAcceptor* acceptor); - virtual ~StreamerSM(); + ~StreamerSM() override; void AddToOutputOrder(const MemCacheIter& mci) {} - virtual void InitSMInterface(SMInterface* sm_other_interface, - int32 server_idx) override; - virtual void InitSMConnection(SMConnectionPoolInterface* connection_pool, - SMInterface* sm_interface, - EpollServer* epoll_server, - int fd, - std::string server_ip, - std::string server_port, - std::string remote_ip, - bool use_ssl) override; + void InitSMInterface(SMInterface* sm_other_interface, + int32 server_idx) override; + void InitSMConnection(SMConnectionPoolInterface* connection_pool, + SMInterface* sm_interface, + EpollServer* epoll_server, + int fd, + std::string server_ip, + std::string server_port, + std::string remote_ip, + bool use_ssl) override; - virtual size_t ProcessReadInput(const char* data, size_t len) override; - virtual size_t ProcessWriteInput(const char* data, size_t len) override; - virtual bool MessageFullyRead() const override; - virtual void SetStreamID(uint32 stream_id) override {} - virtual bool Error() const override; - virtual const char* ErrorAsString() const override; - virtual void Reset() override; - virtual void ResetForNewInterface(int32 server_idx) override {} - virtual void ResetForNewConnection() override; - virtual void Cleanup() override; - virtual int PostAcceptHook() override; - virtual void NewStream(uint32 stream_id, - uint32 priority, - const std::string& filename) override {} - virtual void SendEOF(uint32 stream_id) override {} - virtual void SendErrorNotFound(uint32 stream_id) override {} + size_t ProcessReadInput(const char* data, size_t len) override; + size_t ProcessWriteInput(const char* data, size_t len) override; + bool MessageFullyRead() const override; + void SetStreamID(uint32 stream_id) override {} + bool Error() const override; + const char* ErrorAsString() const override; + void Reset() override; + void ResetForNewInterface(int32 server_idx) override {} + void ResetForNewConnection() override; + void Cleanup() override; + int PostAcceptHook() override; + void NewStream(uint32 stream_id, + uint32 priority, + const std::string& filename) override {} + void SendEOF(uint32 stream_id) override {} + void SendErrorNotFound(uint32 stream_id) override {} virtual void SendOKResponse(uint32 stream_id, std::string output) {} - virtual size_t SendSynStream(uint32 stream_id, - const BalsaHeaders& headers) override; - virtual size_t SendSynReply(uint32 stream_id, - const BalsaHeaders& headers) override; - virtual void SendDataFrame(uint32 stream_id, - const char* data, - int64 len, - uint32 flags, - bool compress) override {} - virtual void set_is_request() override; + size_t SendSynStream(uint32 stream_id, const BalsaHeaders& headers) override; + size_t SendSynReply(uint32 stream_id, const BalsaHeaders& headers) override; + void SendDataFrame(uint32 stream_id, + const char* data, + int64 len, + uint32 flags, + bool compress) override {} + void set_is_request() override; static std::string forward_ip_header() { return forward_ip_header_; } static void set_forward_ip_header(std::string value) { forward_ip_header_ = value; @@ -88,38 +86,37 @@ class StreamerSM : public BalsaVisitorInterface, public SMInterface { int64 len, uint32 flags, bool compress) {} - virtual void GetOutput() override {} + void GetOutput() override {} - virtual void ProcessBodyInput(const char* input, size_t size) override; - virtual void MessageDone() override; - virtual void ProcessHeaders(const BalsaHeaders& headers) override; - virtual void ProcessBodyData(const char* input, size_t size) override {} - virtual void ProcessHeaderInput(const char* input, size_t size) override {} - virtual void ProcessTrailerInput(const char* input, size_t size) override {} - virtual void ProcessRequestFirstLine(const char* line_input, - size_t line_length, - const char* method_input, - size_t method_length, - const char* request_uri_input, - size_t request_uri_length, - const char* version_input, - size_t version_length) override {} - virtual void ProcessResponseFirstLine(const char* line_input, - size_t line_length, - const char* version_input, - size_t version_length, - const char* status_input, - size_t status_length, - const char* reason_input, - size_t reason_length) override {} - virtual void ProcessChunkLength(size_t chunk_length) override {} - virtual void ProcessChunkExtensions(const char* input, size_t size) override { - } - virtual void HeaderDone() override {} - virtual void HandleHeaderError(BalsaFrame* framer) override; - virtual void HandleHeaderWarning(BalsaFrame* framer) override {} - virtual void HandleChunkingError(BalsaFrame* framer) override; - virtual void HandleBodyError(BalsaFrame* framer) override; + void ProcessBodyInput(const char* input, size_t size) override; + void MessageDone() override; + void ProcessHeaders(const BalsaHeaders& headers) override; + void ProcessBodyData(const char* input, size_t size) override {} + void ProcessHeaderInput(const char* input, size_t size) override {} + void ProcessTrailerInput(const char* input, size_t size) override {} + void ProcessRequestFirstLine(const char* line_input, + size_t line_length, + const char* method_input, + size_t method_length, + const char* request_uri_input, + size_t request_uri_length, + const char* version_input, + size_t version_length) override {} + void ProcessResponseFirstLine(const char* line_input, + size_t line_length, + const char* version_input, + size_t version_length, + const char* status_input, + size_t status_length, + const char* reason_input, + size_t reason_length) override {} + void ProcessChunkLength(size_t chunk_length) override {} + void ProcessChunkExtensions(const char* input, size_t size) override {} + void HeaderDone() override {} + void HandleHeaderError(BalsaFrame* framer) override; + void HandleHeaderWarning(BalsaFrame* framer) override {} + void HandleChunkingError(BalsaFrame* framer) override; + void HandleBodyError(BalsaFrame* framer) override; void HandleError(); SMConnection* connection_; |