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

Side by Side Diff: net/base/client_socket_handle.cc

Issue 125025: Try to track down a dangling ClientSocketHandle* by upgrading DCHECKs to CHECKs. (Closed)
Patch Set: Created 11 years, 6 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 | « no previous file | net/base/tcp_client_socket_pool.cc » ('j') | net/base/tcp_client_socket_pool.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | net/base/tcp_client_socket_pool.cc » ('j') | net/base/tcp_client_socket_pool.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698