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

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

Issue 1898133002: Add reprioritization to socket pools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Plumbed SetPriority down from HttpStreamFactoryImpl::Job. Created 4 years, 8 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 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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 int cancel_count() const { return cancel_count_; } 928 int cancel_count() const { return cancel_count_; }
929 929
930 // TransportClientSocketPool implementation. 930 // TransportClientSocketPool implementation.
931 int RequestSocket(const std::string& group_name, 931 int RequestSocket(const std::string& group_name,
932 const void* socket_params, 932 const void* socket_params,
933 RequestPriority priority, 933 RequestPriority priority,
934 RespectLimits respect_limits, 934 RespectLimits respect_limits,
935 ClientSocketHandle* handle, 935 ClientSocketHandle* handle,
936 const CompletionCallback& callback, 936 const CompletionCallback& callback,
937 const BoundNetLog& net_log) override; 937 const BoundNetLog& net_log) override;
938 938 void SetPriority(const std::string& group_name,
939 ClientSocketHandle* handle,
940 RequestPriority priority) override;
939 void CancelRequest(const std::string& group_name, 941 void CancelRequest(const std::string& group_name,
940 ClientSocketHandle* handle) override; 942 ClientSocketHandle* handle) override;
941 void ReleaseSocket(const std::string& group_name, 943 void ReleaseSocket(const std::string& group_name,
942 std::unique_ptr<StreamSocket> socket, 944 std::unique_ptr<StreamSocket> socket,
943 int id) override; 945 int id) override;
944 946
945 private: 947 private:
946 ClientSocketFactory* client_socket_factory_; 948 ClientSocketFactory* client_socket_factory_;
947 std::vector<std::unique_ptr<MockConnectJob>> job_list_; 949 std::vector<std::unique_ptr<MockConnectJob>> job_list_;
948 RequestPriority last_request_priority_; 950 RequestPriority last_request_priority_;
(...skipping 12 matching lines...) Expand all
961 ~MockSOCKSClientSocketPool() override; 963 ~MockSOCKSClientSocketPool() override;
962 964
963 // SOCKSClientSocketPool implementation. 965 // SOCKSClientSocketPool implementation.
964 int RequestSocket(const std::string& group_name, 966 int RequestSocket(const std::string& group_name,
965 const void* socket_params, 967 const void* socket_params,
966 RequestPriority priority, 968 RequestPriority priority,
967 RespectLimits respect_limits, 969 RespectLimits respect_limits,
968 ClientSocketHandle* handle, 970 ClientSocketHandle* handle,
969 const CompletionCallback& callback, 971 const CompletionCallback& callback,
970 const BoundNetLog& net_log) override; 972 const BoundNetLog& net_log) override;
971 973 void SetPriority(const std::string& group_name,
974 ClientSocketHandle* handle,
975 RequestPriority priority) override;
972 void CancelRequest(const std::string& group_name, 976 void CancelRequest(const std::string& group_name,
973 ClientSocketHandle* handle) override; 977 ClientSocketHandle* handle) override;
974 void ReleaseSocket(const std::string& group_name, 978 void ReleaseSocket(const std::string& group_name,
975 std::unique_ptr<StreamSocket> socket, 979 std::unique_ptr<StreamSocket> socket,
976 int id) override; 980 int id) override;
977 981
978 private: 982 private:
979 TransportClientSocketPool* const transport_pool_; 983 TransportClientSocketPool* const transport_pool_;
980 984
981 DISALLOW_COPY_AND_ASSIGN(MockSOCKSClientSocketPool); 985 DISALLOW_COPY_AND_ASSIGN(MockSOCKSClientSocketPool);
(...skipping 26 matching lines...) Expand all
1008 1012
1009 // Helper function to get the total data size of the MockReads in |reads|. 1013 // Helper function to get the total data size of the MockReads in |reads|.
1010 int64_t CountReadBytes(const MockRead reads[], size_t reads_size); 1014 int64_t CountReadBytes(const MockRead reads[], size_t reads_size);
1011 1015
1012 // Helper function to get the total data size of the MockWrites in |writes|. 1016 // Helper function to get the total data size of the MockWrites in |writes|.
1013 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size); 1017 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size);
1014 1018
1015 } // namespace net 1019 } // namespace net
1016 1020
1017 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ 1021 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698