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

Side by Side Diff: net/dns/mock_mdns_socket_factory.h

Issue 21534003: avoid char+'\xHH' as it's too easy to use values > 127 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: corresponding change in chrome unit tests Created 7 years, 4 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/dns/mdns_client_unittest.cc ('k') | net/dns/mock_mdns_socket_factory.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 #ifndef NET_DNS_MOCK_MDNS_SOCKET_FACTORY_H_ 5 #ifndef NET_DNS_MOCK_MDNS_SOCKET_FACTORY_H_
6 #define NET_DNS_MOCK_MDNS_SOCKET_FACTORY_H_ 6 #define NET_DNS_MOCK_MDNS_SOCKET_FACTORY_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "net/dns/mdns_client_impl.h" 10 #include "net/dns/mdns_client_impl.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 }; 70 };
71 71
72 class MockMDnsSocketFactory : public MDnsConnection::SocketFactory { 72 class MockMDnsSocketFactory : public MDnsConnection::SocketFactory {
73 public: 73 public:
74 MockMDnsSocketFactory(); 74 MockMDnsSocketFactory();
75 75
76 virtual ~MockMDnsSocketFactory(); 76 virtual ~MockMDnsSocketFactory();
77 77
78 virtual scoped_ptr<DatagramServerSocket> CreateSocket() OVERRIDE; 78 virtual scoped_ptr<DatagramServerSocket> CreateSocket() OVERRIDE;
79 79
80 void SimulateReceive(const char* packet, int size); 80 void SimulateReceive(const uint8* packet, int size);
81 81
82 MOCK_METHOD1(OnSendTo, void(const std::string&)); 82 MOCK_METHOD1(OnSendTo, void(const std::string&));
83 83
84 private: 84 private:
85 int SendToInternal(const std::string& packet, const std::string& address, 85 int SendToInternal(const std::string& packet, const std::string& address,
86 const CompletionCallback& callback); 86 const CompletionCallback& callback);
87 87
88 // The latest receive callback is always saved, since the MDnsConnection 88 // The latest receive callback is always saved, since the MDnsConnection
89 // does not care which socket a packet is received on. 89 // does not care which socket a packet is received on.
90 int RecvFromInternal(IOBuffer* buffer, int size, 90 int RecvFromInternal(IOBuffer* buffer, int size,
91 IPEndPoint* address, 91 IPEndPoint* address,
92 const CompletionCallback& callback); 92 const CompletionCallback& callback);
93 93
94 scoped_refptr<IOBuffer> recv_buffer_; 94 scoped_refptr<IOBuffer> recv_buffer_;
95 int recv_buffer_size_; 95 int recv_buffer_size_;
96 CompletionCallback recv_callback_; 96 CompletionCallback recv_callback_;
97 }; 97 };
98 98
99 } // namespace net 99 } // namespace net
100 100
101 #endif // NET_DNS_MOCK_MDNS_SOCKET_FACTORY_H_ 101 #endif // NET_DNS_MOCK_MDNS_SOCKET_FACTORY_H_
OLDNEW
« no previous file with comments | « net/dns/mdns_client_unittest.cc ('k') | net/dns/mock_mdns_socket_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698