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

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

Issue 1088007: Add an initial implementation of net-internals inspector in javascript.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: more build file Created 10 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « net/base/net_log.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // not been called yet (hence we are cancelling). 49 // not been called yet (hence we are cancelling).
50 net_log_.AddEvent(NetLog::TYPE_CANCELLED); 50 net_log_.AddEvent(NetLog::TYPE_CANCELLED);
51 net_log_.EndEvent(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB); 51 net_log_.EndEvent(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB);
52 } 52 }
53 } 53 }
54 54
55 int ConnectJob::Connect() { 55 int ConnectJob::Connect() {
56 if (timeout_duration_ != base::TimeDelta()) 56 if (timeout_duration_ != base::TimeDelta())
57 timer_.Start(timeout_duration_, this, &ConnectJob::OnTimeout); 57 timer_.Start(timeout_duration_, this, &ConnectJob::OnTimeout);
58 58
59 net_log_.BeginEvent(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB); 59 net_log_.BeginEventWithString(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB,
60 group_name_);
60 61
61 int rv = ConnectInternal(); 62 int rv = ConnectInternal();
62 63
63 if (rv != ERR_IO_PENDING) { 64 if (rv != ERR_IO_PENDING) {
64 delegate_ = NULL; 65 delegate_ = NULL;
65 net_log_.EndEvent(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB); 66 net_log_.EndEvent(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB);
66 } 67 }
67 68
68 return rv; 69 return rv;
69 } 70 }
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 bool ClientSocketPoolBaseHelper::ReachedMaxSocketsLimit() const { 715 bool ClientSocketPoolBaseHelper::ReachedMaxSocketsLimit() const {
715 // Each connecting socket will eventually connect and be handed out. 716 // Each connecting socket will eventually connect and be handed out.
716 int total = handed_out_socket_count_ + connecting_socket_count_; 717 int total = handed_out_socket_count_ + connecting_socket_count_;
717 DCHECK_LE(total, max_sockets_); 718 DCHECK_LE(total, max_sockets_);
718 return total == max_sockets_; 719 return total == max_sockets_;
719 } 720 }
720 721
721 } // namespace internal 722 } // namespace internal
722 723
723 } // namespace net 724 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_log.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698