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

Unified Diff: net/socket/tcp_client_socket_libevent.cc

Issue 848006: Generalize the net module's LoadLog facility from a passive container, to an event stream (NetLog). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Split up RequestTracker into ConnectJobTracker+RequestTracker+RequestTrackerBase, address comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/tcp_client_socket_libevent.h ('k') | net/socket/tcp_client_socket_pool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/tcp_client_socket_libevent.cc
===================================================================
--- net/socket/tcp_client_socket_libevent.cc (revision 41560)
+++ net/socket/tcp_client_socket_libevent.cc (working copy)
@@ -15,8 +15,8 @@
#include "base/string_util.h"
#include "base/trace_event.h"
#include "net/base/io_buffer.h"
-#include "net/base/load_log.h"
#include "net/base/net_errors.h"
+#include "net/base/net_log.h"
#if defined(USE_SYSTEM_LIBEVENT)
#include <event.h>
#else
@@ -138,17 +138,17 @@
}
int TCPClientSocketLibevent::Connect(CompletionCallback* callback,
- LoadLog* load_log) {
+ const BoundNetLog& net_log) {
// If already connected, then just return OK.
if (socket_ != kInvalidSocket)
return OK;
DCHECK(!waiting_connect_);
- DCHECK(!load_log_);
+ DCHECK(!net_log_.net_log());
TRACE_EVENT_BEGIN("socket.connect", this, "");
- LoadLog::BeginEvent(load_log, LoadLog::TYPE_TCP_CONNECT);
+ net_log.BeginEvent(NetLog::TYPE_TCP_CONNECT);
int rv = DoConnect();
@@ -156,12 +156,12 @@
// Synchronous operation not supported.
DCHECK(callback);
- load_log_ = load_log;
+ net_log_ = net_log;
waiting_connect_ = true;
write_callback_ = callback;
} else {
TRACE_EVENT_END("socket.connect", this, "");
- LoadLog::EndEvent(load_log, LoadLog::TYPE_TCP_CONNECT);
+ net_log.EndEvent(NetLog::TYPE_TCP_CONNECT);
}
return rv;
@@ -403,19 +403,19 @@
const addrinfo* next = current_ai_->ai_next;
Disconnect();
current_ai_ = next;
- scoped_refptr<LoadLog> load_log;
- load_log.swap(load_log_);
+ BoundNetLog net_log = net_log_;
+ net_log_ = BoundNetLog();
TRACE_EVENT_END("socket.connect", this, "");
- LoadLog::EndEvent(load_log, LoadLog::TYPE_TCP_CONNECT);
- result = Connect(write_callback_, load_log);
+ net_log.EndEvent(NetLog::TYPE_TCP_CONNECT);
+ result = Connect(write_callback_, net_log);
} else {
result = MapConnectError(os_error);
bool ok = write_socket_watcher_.StopWatchingFileDescriptor();
DCHECK(ok);
waiting_connect_ = false;
TRACE_EVENT_END("socket.connect", this, "");
- LoadLog::EndEvent(load_log_, LoadLog::TYPE_TCP_CONNECT);
- load_log_ = NULL;
+ net_log_.EndEvent(NetLog::TYPE_TCP_CONNECT);
+ net_log_ = BoundNetLog();
}
if (result != ERR_IO_PENDING) {
« no previous file with comments | « net/socket/tcp_client_socket_libevent.h ('k') | net/socket/tcp_client_socket_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698