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

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

Issue 2994003: Refactor how ClientSocketPoolBaseHelper avoids re-entrancy. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Merge. Created 10 years, 5 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/socket/client_socket_pool_base_unittest.cc ('k') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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>
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 628
629 DISALLOW_COPY_AND_ASSIGN(MockConnectJob); 629 DISALLOW_COPY_AND_ASSIGN(MockConnectJob);
630 }; 630 };
631 631
632 MockTCPClientSocketPool( 632 MockTCPClientSocketPool(
633 int max_sockets, 633 int max_sockets,
634 int max_sockets_per_group, 634 int max_sockets_per_group,
635 const scoped_refptr<ClientSocketPoolHistograms>& histograms, 635 const scoped_refptr<ClientSocketPoolHistograms>& histograms,
636 ClientSocketFactory* socket_factory); 636 ClientSocketFactory* socket_factory);
637 637
638 int release_count() { return release_count_; }; 638 int release_count() const { return release_count_; };
639 int cancel_count() { return cancel_count_; }; 639 int cancel_count() const { return cancel_count_; };
640 640
641 // TCPClientSocketPool methods. 641 // TCPClientSocketPool methods.
642 virtual int RequestSocket(const std::string& group_name, 642 virtual int RequestSocket(const std::string& group_name,
643 const void* socket_params, 643 const void* socket_params,
644 RequestPriority priority, 644 RequestPriority priority,
645 ClientSocketHandle* handle, 645 ClientSocketHandle* handle,
646 CompletionCallback* callback, 646 CompletionCallback* callback,
647 const BoundNetLog& net_log); 647 const BoundNetLog& net_log);
648 648
649 virtual void CancelRequest(const std::string& group_name, 649 virtual void CancelRequest(const std::string& group_name,
650 const ClientSocketHandle* handle); 650 ClientSocketHandle* handle);
651 virtual void ReleaseSocket(const std::string& group_name, 651 virtual void ReleaseSocket(const std::string& group_name,
652 ClientSocket* socket, int id); 652 ClientSocket* socket, int id);
653 653
654 protected: 654 protected:
655 virtual ~MockTCPClientSocketPool(); 655 virtual ~MockTCPClientSocketPool();
656 656
657 private: 657 private:
658 ClientSocketFactory* client_socket_factory_; 658 ClientSocketFactory* client_socket_factory_;
659 int release_count_; 659 int release_count_;
660 int cancel_count_; 660 int cancel_count_;
(...skipping 12 matching lines...) Expand all
673 673
674 // SOCKSClientSocketPool methods. 674 // SOCKSClientSocketPool methods.
675 virtual int RequestSocket(const std::string& group_name, 675 virtual int RequestSocket(const std::string& group_name,
676 const void* socket_params, 676 const void* socket_params,
677 RequestPriority priority, 677 RequestPriority priority,
678 ClientSocketHandle* handle, 678 ClientSocketHandle* handle,
679 CompletionCallback* callback, 679 CompletionCallback* callback,
680 const BoundNetLog& net_log); 680 const BoundNetLog& net_log);
681 681
682 virtual void CancelRequest(const std::string& group_name, 682 virtual void CancelRequest(const std::string& group_name,
683 const ClientSocketHandle* handle); 683 ClientSocketHandle* handle);
684 virtual void ReleaseSocket(const std::string& group_name, 684 virtual void ReleaseSocket(const std::string& group_name,
685 ClientSocket* socket, int id); 685 ClientSocket* socket, int id);
686 686
687 protected: 687 protected:
688 virtual ~MockSOCKSClientSocketPool(); 688 virtual ~MockSOCKSClientSocketPool();
689 689
690 private: 690 private:
691 const scoped_refptr<TCPClientSocketPool> tcp_pool_; 691 const scoped_refptr<TCPClientSocketPool> tcp_pool_;
692 692
693 DISALLOW_COPY_AND_ASSIGN(MockSOCKSClientSocketPool); 693 DISALLOW_COPY_AND_ASSIGN(MockSOCKSClientSocketPool);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 741
742 extern const char kSOCKS5OkRequest[]; 742 extern const char kSOCKS5OkRequest[];
743 extern const int kSOCKS5OkRequestLength; 743 extern const int kSOCKS5OkRequestLength;
744 744
745 extern const char kSOCKS5OkResponse[]; 745 extern const char kSOCKS5OkResponse[];
746 extern const int kSOCKS5OkResponseLength; 746 extern const int kSOCKS5OkResponseLength;
747 747
748 } // namespace net 748 } // namespace net
749 749
750 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ 750 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/socket/client_socket_pool_base_unittest.cc ('k') | net/socket/socket_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698