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

Side by Side Diff: content/browser/renderer_host/p2p/socket_host_test_utils.h

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 (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 CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "content/common/p2p_messages.h" 10 #include "content/common/p2p_messages.h"
(...skipping 13 matching lines...) Expand all
24 public: 24 public:
25 MockIPCSender(); 25 MockIPCSender();
26 virtual ~MockIPCSender(); 26 virtual ~MockIPCSender();
27 27
28 MOCK_METHOD1(Send, bool(IPC::Message* msg)); 28 MOCK_METHOD1(Send, bool(IPC::Message* msg));
29 }; 29 };
30 30
31 class FakeSocket : public net::StreamSocket { 31 class FakeSocket : public net::StreamSocket {
32 public: 32 public:
33 FakeSocket(std::string* written_data); 33 FakeSocket(std::string* written_data);
34 virtual ~FakeSocket(); 34 ~FakeSocket() override;
35 35
36 void set_async_write(bool async_write) { async_write_ = async_write; } 36 void set_async_write(bool async_write) { async_write_ = async_write; }
37 void AppendInputData(const char* data, int data_size); 37 void AppendInputData(const char* data, int data_size);
38 int input_pos() const { return input_pos_; } 38 int input_pos() const { return input_pos_; }
39 bool read_pending() const { return read_pending_; } 39 bool read_pending() const { return read_pending_; }
40 void SetPeerAddress(const net::IPEndPoint& peer_address); 40 void SetPeerAddress(const net::IPEndPoint& peer_address);
41 void SetLocalAddress(const net::IPEndPoint& local_address); 41 void SetLocalAddress(const net::IPEndPoint& local_address);
42 42
43 // net::Socket implementation. 43 // net::Socket implementation.
44 virtual int Read(net::IOBuffer* buf, int buf_len, 44 int Read(net::IOBuffer* buf,
45 const net::CompletionCallback& callback) override; 45 int buf_len,
46 virtual int Write(net::IOBuffer* buf, int buf_len, 46 const net::CompletionCallback& callback) override;
47 const net::CompletionCallback& callback) override; 47 int Write(net::IOBuffer* buf,
48 virtual int SetReceiveBufferSize(int32 size) override; 48 int buf_len,
49 virtual int SetSendBufferSize(int32 size) override; 49 const net::CompletionCallback& callback) override;
50 virtual int Connect(const net::CompletionCallback& callback) override; 50 int SetReceiveBufferSize(int32 size) override;
51 virtual void Disconnect() override; 51 int SetSendBufferSize(int32 size) override;
52 virtual bool IsConnected() const override; 52 int Connect(const net::CompletionCallback& callback) override;
53 virtual bool IsConnectedAndIdle() const override; 53 void Disconnect() override;
54 virtual int GetPeerAddress(net::IPEndPoint* address) const override; 54 bool IsConnected() const override;
55 virtual int GetLocalAddress(net::IPEndPoint* address) const override; 55 bool IsConnectedAndIdle() const override;
56 virtual const net::BoundNetLog& NetLog() const override; 56 int GetPeerAddress(net::IPEndPoint* address) const override;
57 virtual void SetSubresourceSpeculation() override; 57 int GetLocalAddress(net::IPEndPoint* address) const override;
58 virtual void SetOmniboxSpeculation() override; 58 const net::BoundNetLog& NetLog() const override;
59 virtual bool WasEverUsed() const override; 59 void SetSubresourceSpeculation() override;
60 virtual bool UsingTCPFastOpen() const override; 60 void SetOmniboxSpeculation() override;
61 virtual bool WasNpnNegotiated() const override; 61 bool WasEverUsed() const override;
62 virtual net::NextProto GetNegotiatedProtocol() const override; 62 bool UsingTCPFastOpen() const override;
63 virtual bool GetSSLInfo(net::SSLInfo* ssl_info) override; 63 bool WasNpnNegotiated() const override;
64 net::NextProto GetNegotiatedProtocol() const override;
65 bool GetSSLInfo(net::SSLInfo* ssl_info) override;
64 66
65 private: 67 private:
66 void DoAsyncWrite(scoped_refptr<net::IOBuffer> buf, int buf_len, 68 void DoAsyncWrite(scoped_refptr<net::IOBuffer> buf, int buf_len,
67 const net::CompletionCallback& callback); 69 const net::CompletionCallback& callback);
68 70
69 bool read_pending_; 71 bool read_pending_;
70 scoped_refptr<net::IOBuffer> read_buffer_; 72 scoped_refptr<net::IOBuffer> read_buffer_;
71 int read_buffer_size_; 73 int read_buffer_size_;
72 net::CompletionCallback read_callback_; 74 net::CompletionCallback read_callback_;
73 75
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 MATCHER_P(MatchIncomingSocketMessage, address, "") { 108 MATCHER_P(MatchIncomingSocketMessage, address, "") {
107 if (arg->type() != P2PMsg_OnIncomingTcpConnection::ID) 109 if (arg->type() != P2PMsg_OnIncomingTcpConnection::ID)
108 return false; 110 return false;
109 P2PMsg_OnIncomingTcpConnection::Param params; 111 P2PMsg_OnIncomingTcpConnection::Param params;
110 P2PMsg_OnIncomingTcpConnection::Read( 112 P2PMsg_OnIncomingTcpConnection::Read(
111 arg, &params); 113 arg, &params);
112 return params.b == address; 114 return params.b == address;
113 } 115 }
114 116
115 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ 117 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698