OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/base/client_socket_handle.h" | 5 #include "net/base/client_socket_handle.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "net/base/client_socket.h" | 9 #include "net/base/client_socket.h" |
10 #include "net/base/client_socket_pool.h" | 10 #include "net/base/client_socket_pool.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // If we did not get initialized yet, so we've got a socket request pending. | 50 // If we did not get initialized yet, so we've got a socket request pending. |
51 // Cancel it. | 51 // Cancel it. |
52 pool_->CancelRequest(group_name_, this); | 52 pool_->CancelRequest(group_name_, this); |
53 } | 53 } |
54 group_name_.clear(); | 54 group_name_.clear(); |
55 is_reused_ = false; | 55 is_reused_ = false; |
56 user_callback_ = NULL; | 56 user_callback_ = NULL; |
57 } | 57 } |
58 | 58 |
59 LoadState ClientSocketHandle::GetLoadState() const { | 59 LoadState ClientSocketHandle::GetLoadState() const { |
60 DCHECK(!is_initialized()); | 60 CHECK(!is_initialized()); |
61 DCHECK(!group_name_.empty()); | 61 CHECK(!group_name_.empty()); |
62 return pool_->GetLoadState(group_name_, this); | 62 return pool_->GetLoadState(group_name_, this); |
63 } | 63 } |
64 | 64 |
65 void ClientSocketHandle::OnIOComplete(int result) { | 65 void ClientSocketHandle::OnIOComplete(int result) { |
66 DCHECK_NE(ERR_IO_PENDING, result); | 66 CHECK(ERR_IO_PENDING != result); |
67 CompletionCallback* callback = user_callback_; | 67 CompletionCallback* callback = user_callback_; |
68 user_callback_ = NULL; | 68 user_callback_ = NULL; |
69 if (result != OK) | 69 if (result != OK) |
70 ResetInternal(false); // The request failed, so there's nothing to cancel. | 70 ResetInternal(false); // The request failed, so there's nothing to cancel. |
71 callback->Run(result); | 71 callback->Run(result); |
72 } | 72 } |
73 | 73 |
74 } // namespace net | 74 } // namespace net |
OLD | NEW |