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

Issue 837873002: Make logging a scoped_ptr<T> more useful. (Closed)

Created:
5 years, 11 months ago by dcheng
Modified:
5 years, 10 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org, gavinp+memory_chromium.org, jamesr, Jeffrey Yasskin, Nico
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make logging a scoped_ptr<T> more useful. Given the code: scoped_ptr<std::string> x; LOG(ERROR) << x; the logging output will always be 0 or 1. The reason is the scoped_ptr<T> is getting turned into a bool before being logged. This behavior doesn't seem very useful, so add a logging overload to make it print out the pointer value. BUG=none Committed: https://crrev.com/12fcf61becc682d7d542532d7f50cf2406f25bdf Cr-Commit-Position: refs/heads/master@{#316640}

Patch Set 1 #

Patch Set 2 : Add a test #

Patch Set 3 : Fix build #

Patch Set 4 : Sigh #

Patch Set 5 : SFINAE #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -0 lines) Patch
M base/memory/scoped_ptr.h View 1 2 3 4 2 chunks +6 lines, -0 lines 0 comments Download
M base/memory/scoped_ptr_unittest.cc View 1 2 chunks +13 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (5 generated)
dcheng
I added something similar for scoped_refptr<T> when removing the implicit conversions. This seems strictly more ...
5 years, 11 months ago (2015-01-07 01:22:55 UTC) #2
danakj
On 2015/01/07 01:22:55, dcheng wrote: > I added something similar for scoped_refptr<T> when removing the ...
5 years, 11 months ago (2015-01-07 04:36:17 UTC) #3
dcheng
Done.
5 years, 11 months ago (2015-01-07 20:59:46 UTC) #4
danakj
Cool. One question, does this do anything to the build size?
5 years, 11 months ago (2015-01-07 21:04:27 UTC) #5
dcheng
This doesn't do anything to build size. ... however I discovered some interesting test code. ...
5 years, 11 months ago (2015-01-08 00:36:26 UTC) #7
danakj
On 2015/01/08 00:36:26, dcheng wrote: > This doesn't do anything to build size. OK good, ...
5 years, 11 months ago (2015-01-08 00:52:50 UTC) #9
dcheng
My impression is that it was iostream that's problematic (http://llvm.org/docs/CodingStandards.html#include-iostream-is-forbidden is the best reference I ...
5 years, 11 months ago (2015-01-08 01:04:00 UTC) #10
jamesr
It's not final binary size that's impacted so much as the input to the compiler ...
5 years, 11 months ago (2015-01-08 01:18:20 UTC) #11
jamesr
you'd have to type-strip the T* somehow to void*, which might be tricky
5 years, 11 months ago (2015-01-08 01:19:54 UTC) #12
Randy Smith (Not in Mondays)
If the tests pass, content/browser/download/* LGTM--we don't use the mocking of that method.
5 years, 11 months ago (2015-01-08 16:39:35 UTC) #13
danakj
On 2015/01/08 01:19:54, jamesr wrote: > you'd have to type-strip the T* somehow to void*, ...
5 years, 11 months ago (2015-01-08 19:12:13 UTC) #14
dcheng
On 2015/01/08 at 19:12:13, danakj wrote: > On 2015/01/08 01:19:54, jamesr wrote: > > you'd ...
5 years, 11 months ago (2015-01-08 22:33:17 UTC) #15
danakj
On Thu, Jan 8, 2015 at 2:33 PM, <dcheng@chromium.org> wrote: > On 2015/01/08 at 19:12:13, ...
5 years, 11 months ago (2015-01-08 22:36:45 UTC) #16
Ryan Sleevi
Daniel, did this ever go anywhere? For the linker issue, can we not rely on ...
5 years, 10 months ago (2015-02-11 08:21:52 UTC) #17
dcheng
On 2015/02/11 at 08:21:52, rsleevi wrote: > Daniel, did this ever go anywhere? > > ...
5 years, 10 months ago (2015-02-16 19:49:41 UTC) #18
Nico
lgtm :-|
5 years, 10 months ago (2015-02-17 16:49:07 UTC) #20
danakj
LGTM
5 years, 10 months ago (2015-02-17 18:07:25 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/837873002/80001
5 years, 10 months ago (2015-02-17 18:48:17 UTC) #23
commit-bot: I haz the power
Committed patchset #5 (id:80001)
5 years, 10 months ago (2015-02-17 20:09:52 UTC) #24
commit-bot: I haz the power
5 years, 10 months ago (2015-02-17 20:10:33 UTC) #25
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/12fcf61becc682d7d542532d7f50cf2406f25bdf
Cr-Commit-Position: refs/heads/master@{#316640}

Powered by Google App Engine
This is Rietveld 408576698