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

Issue 5560013: A scoped NetLog event that automatically logs an end event on destruction. (Closed)

Created:
10 years ago by mmenke
Modified:
9 years, 7 months ago
Reviewers:
eroman
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr., willchan no longer on Chromium
Visibility:
Public.

Description

A ScopedNetLogEvent that logs a NetLog begin event on creation, and the corresponding end event on destruction. BUG=64981 TEST=NetLog.ScopedNetLogEventTest Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=68742

Patch Set 1 : '' #

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 4

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+82 lines, -0 lines) Patch
M net/base/net_log.h View 1 2 3 1 chunk +24 lines, -0 lines 0 comments Download
M net/base/net_log.cc View 1 2 3 1 chunk +23 lines, -0 lines 0 comments Download
A net/base/net_log_unittest.cc View 1 2 3 1 chunk +34 lines, -0 lines 0 comments Download
M net/net.gyp View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
mmenke
Might be convenient to have this inherit from BoundNetLog instead, so classes that log an ...
10 years ago (2010-12-08 20:53:55 UTC) #1
eroman
lgtm http://codereview.chromium.org/5560013/diff/14001/net/base/net_log.cc File net/base/net_log.cc (right): http://codereview.chromium.org/5560013/diff/14001/net/base/net_log.cc#newcode203 net/base/net_log.cc:203: end_event_parameters_(NULL) { nit: I have always seen this ...
10 years ago (2010-12-09 02:00:14 UTC) #2
mmenke
10 years ago (2010-12-09 15:12:01 UTC) #3
Thanks.

http://codereview.chromium.org/5560013/diff/14001/net/base/net_log.cc
File net/base/net_log.cc (right):

http://codereview.chromium.org/5560013/diff/14001/net/base/net_log.cc#newcode203
net/base/net_log.cc:203: end_event_parameters_(NULL) {
On 2010/12/09 02:00:14, eroman wrote:
> nit: I have always seen this omitted in chrome code, and rely on default
> constructor.

Done.

http://codereview.chromium.org/5560013/diff/14001/net/base/net_log_unittest.cc
File net/base/net_log_unittest.cc (right):

http://codereview.chromium.org/5560013/diff/14001/net/base/net_log_unittest.c...
net/base/net_log_unittest.cc:11: net::CapturingNetLog
log(net::CapturingNetLog::kUnbounded);
On 2010/12/09 02:00:14, eroman wrote:
> nit: I generally like to put my unit tests inside of:
> 
> namespace net {
> namespace {
> 
> <<--->>
> 
> }
> }
> 
> to avoid prefixing everything with net::

Both namespaces added.  Does make for cleaner code.  Looks the majority of unit
tests don't use an anonymous namespace.

Powered by Google App Engine
This is Rietveld 408576698