OLD | NEW |
---|---|
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 #include "net/socket/client_socket_pool_base.h" | 5 #include "net/socket/client_socket_pool_base.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/stats_counters.h" | 10 #include "base/stats_counters.h" |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
646 } | 646 } |
647 } | 647 } |
648 } | 648 } |
649 | 649 |
650 void ClientSocketPoolBaseHelper::OnIPAddressChanged() { | 650 void ClientSocketPoolBaseHelper::OnIPAddressChanged() { |
651 Flush(); | 651 Flush(); |
652 } | 652 } |
653 | 653 |
654 void ClientSocketPoolBaseHelper::Flush() { | 654 void ClientSocketPoolBaseHelper::Flush() { |
655 pool_generation_number_++; | 655 pool_generation_number_++; |
656 CancelAllConnectJobs(); | |
Mike Belshe
2010/07/29 09:18:42
This might not be the best fix.
Another way to go
| |
657 CloseIdleSockets(); | 656 CloseIdleSockets(); |
658 } | 657 } |
659 | 658 |
660 void ClientSocketPoolBaseHelper::RemoveConnectJob(const ConnectJob* job, | 659 void ClientSocketPoolBaseHelper::RemoveConnectJob(const ConnectJob* job, |
661 Group* group) { | 660 Group* group) { |
662 CHECK_GT(connecting_socket_count_, 0); | 661 CHECK_GT(connecting_socket_count_, 0); |
663 connecting_socket_count_--; | 662 connecting_socket_count_--; |
664 | 663 |
665 DCHECK(group); | 664 DCHECK(group); |
666 DCHECK(ContainsKey(group->jobs, job)); | 665 DCHECK(ContainsKey(group->jobs, job)); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
816 CHECK(!handle->is_initialized()); | 815 CHECK(!handle->is_initialized()); |
817 CompletionCallback* callback = it->second.callback; | 816 CompletionCallback* callback = it->second.callback; |
818 int result = it->second.result; | 817 int result = it->second.result; |
819 pending_callback_map_.erase(it); | 818 pending_callback_map_.erase(it); |
820 callback->Run(result); | 819 callback->Run(result); |
821 } | 820 } |
822 | 821 |
823 } // namespace internal | 822 } // namespace internal |
824 | 823 |
825 } // namespace net | 824 } // namespace net |
OLD | NEW |