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

Side by Side Diff: net/socket/client_socket_pool_base_unittest.cc

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 #include "net/socket/client_socket_pool_base.h" 5 #include "net/socket/client_socket_pool_base.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 void RequestSockets(const std::string& group_name, 514 void RequestSockets(const std::string& group_name,
515 const void* params, 515 const void* params,
516 int num_sockets, 516 int num_sockets,
517 const BoundNetLog& net_log) override { 517 const BoundNetLog& net_log) override {
518 const scoped_refptr<TestSocketParams>* casted_params = 518 const scoped_refptr<TestSocketParams>* casted_params =
519 static_cast<const scoped_refptr<TestSocketParams>*>(params); 519 static_cast<const scoped_refptr<TestSocketParams>*>(params);
520 520
521 base_.RequestSockets(group_name, *casted_params, num_sockets, net_log); 521 base_.RequestSockets(group_name, *casted_params, num_sockets, net_log);
522 } 522 }
523 523
524 void SetPriority(const std::string& group_name,
525 ClientSocketHandle* handle,
526 RequestPriority priority) override {
527 base_.SetPriority(group_name, handle, priority);
528 }
529
524 void CancelRequest(const std::string& group_name, 530 void CancelRequest(const std::string& group_name,
525 ClientSocketHandle* handle) override { 531 ClientSocketHandle* handle) override {
526 base_.CancelRequest(group_name, handle); 532 base_.CancelRequest(group_name, handle);
527 } 533 }
528 534
529 void ReleaseSocket(const std::string& group_name, 535 void ReleaseSocket(const std::string& group_name,
530 std::unique_ptr<StreamSocket> socket, 536 std::unique_ptr<StreamSocket> socket,
531 int id) override { 537 int id) override {
532 base_.ReleaseSocket(group_name, std::move(socket), id); 538 base_.ReleaseSocket(group_name, std::move(socket), id);
533 } 539 }
(...skipping 3299 matching lines...) Expand 10 before | Expand all | Expand 10 after
3833 request(1)->handle()->Reset(); 3839 request(1)->handle()->Reset();
3834 ASSERT_EQ(1, pool_->NumConnectJobsInGroup("a")); 3840 ASSERT_EQ(1, pool_->NumConnectJobsInGroup("a"));
3835 3841
3836 EXPECT_EQ(OK, request(2)->WaitForResult()); 3842 EXPECT_EQ(OK, request(2)->WaitForResult());
3837 EXPECT_FALSE(request(1)->have_result()); 3843 EXPECT_FALSE(request(1)->have_result());
3838 } 3844 }
3839 3845
3840 } // namespace 3846 } // namespace
3841 3847
3842 } // namespace net 3848 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698