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

Side by Side Diff: net/socket/socket_test_util.h

Issue 835623003: Add a delay when unlocking WebSocket endpoints. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit-pick fixes. Created 5 years, 11 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 | « no previous file | net/socket/socket_test_util.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_SOCKET_SOCKET_TEST_UTIL_H_ 5 #ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_
6 #define NET_SOCKET_SOCKET_TEST_UTIL_H_ 6 #define NET_SOCKET_SOCKET_TEST_UTIL_H_
7 7
8 #include <cstring> 8 #include <cstring>
9 #include <deque> 9 #include <deque>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/callback.h" 14 #include "base/callback.h"
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/memory/scoped_ptr.h" 17 #include "base/memory/scoped_ptr.h"
18 #include "base/memory/scoped_vector.h" 18 #include "base/memory/scoped_vector.h"
19 #include "base/memory/weak_ptr.h" 19 #include "base/memory/weak_ptr.h"
20 #include "base/strings/string16.h" 20 #include "base/strings/string16.h"
21 #include "base/time/time.h"
21 #include "net/base/address_list.h" 22 #include "net/base/address_list.h"
22 #include "net/base/io_buffer.h" 23 #include "net/base/io_buffer.h"
23 #include "net/base/net_errors.h" 24 #include "net/base/net_errors.h"
24 #include "net/base/net_log.h" 25 #include "net/base/net_log.h"
25 #include "net/base/test_completion_callback.h" 26 #include "net/base/test_completion_callback.h"
26 #include "net/http/http_auth_controller.h" 27 #include "net/http/http_auth_controller.h"
27 #include "net/http/http_proxy_client_socket_pool.h" 28 #include "net/http/http_proxy_client_socket_pool.h"
28 #include "net/socket/client_socket_factory.h" 29 #include "net/socket/client_socket_factory.h"
29 #include "net/socket/client_socket_handle.h" 30 #include "net/socket/client_socket_handle.h"
30 #include "net/socket/socks_client_socket_pool.h" 31 #include "net/socket/socks_client_socket_pool.h"
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 void ReleaseSocket(const std::string& group_name, 1312 void ReleaseSocket(const std::string& group_name,
1312 scoped_ptr<StreamSocket> socket, 1313 scoped_ptr<StreamSocket> socket,
1313 int id) override; 1314 int id) override;
1314 1315
1315 private: 1316 private:
1316 TransportClientSocketPool* const transport_pool_; 1317 TransportClientSocketPool* const transport_pool_;
1317 1318
1318 DISALLOW_COPY_AND_ASSIGN(MockSOCKSClientSocketPool); 1319 DISALLOW_COPY_AND_ASSIGN(MockSOCKSClientSocketPool);
1319 }; 1320 };
1320 1321
1322 // Convenience class to temporarily set the WebSocketEndpointLockManager unlock
1323 // delay to zero for testing purposes. Automatically restores the original value
1324 // when destroyed.
1325 class WebSocketEndpointZeroUnlockDelay {
tyoshino (SeeGerritForStatus) 2015/01/20 07:22:07 [optional] add a prefix "Scoped"?
Adam Rice 2015/01/20 07:33:54 Done.
1326 public:
1327 WebSocketEndpointZeroUnlockDelay();
1328 ~WebSocketEndpointZeroUnlockDelay();
1329
1330 private:
1331 base::TimeDelta old_delay_;
1332 };
1333
1321 // Constants for a successful SOCKS v5 handshake. 1334 // Constants for a successful SOCKS v5 handshake.
1322 extern const char kSOCKS5GreetRequest[]; 1335 extern const char kSOCKS5GreetRequest[];
1323 extern const int kSOCKS5GreetRequestLength; 1336 extern const int kSOCKS5GreetRequestLength;
1324 1337
1325 extern const char kSOCKS5GreetResponse[]; 1338 extern const char kSOCKS5GreetResponse[];
1326 extern const int kSOCKS5GreetResponseLength; 1339 extern const int kSOCKS5GreetResponseLength;
1327 1340
1328 extern const char kSOCKS5OkRequest[]; 1341 extern const char kSOCKS5OkRequest[];
1329 extern const int kSOCKS5OkRequestLength; 1342 extern const int kSOCKS5OkRequestLength;
1330 1343
1331 extern const char kSOCKS5OkResponse[]; 1344 extern const char kSOCKS5OkResponse[];
1332 extern const int kSOCKS5OkResponseLength; 1345 extern const int kSOCKS5OkResponseLength;
1333 1346
1334 } // namespace net 1347 } // namespace net
1335 1348
1336 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ 1349 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | net/socket/socket_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698