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

Issue 2777203004: Avoid calling strlen() where possible in base/trace_config (Closed)

Created:
3 years, 8 months ago by Andrey Kraynov
Modified:
3 years, 8 months ago
CC:
chromium-reviews, elijahtaylor+arcwatch_chromium.org, oshima+watch_chromium.org, yusukes+watch_chromium.org, vmpstr+watch_chromium.org, wfh+watch_chromium.org, hidehiko+watch_chromium.org, lhchavez+watch_chromium.org, victorhsieh+watch_chromium.org, tracing+reviews_chromium.org, davemoore+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

The main target of this CL is to avoid calling strlen() where possible. It can happen if a raw |char*| literal or result of |c_str()| function is used to construct a StringPiece or std::string objects. In addition, StringPiece API like SplitStringPiece was used to avoid unnecessary string copying and allocations. BUG=679479 Review-Url: https://codereview.chromium.org/2777203004 Cr-Commit-Position: refs/heads/master@{#460203} Committed: https://chromium.googlesource.com/chromium/src/+/b5d44bb49fd4dc5e544f4312de6b00b1a1eb625c

Patch Set 1 #

Total comments: 4

Patch Set 2 : Keep DCHECKs. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -36 lines) Patch
M base/trace_event/trace_config.h View 2 chunks +2 lines, -2 lines 0 comments Download
M base/trace_event/trace_config.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M base/trace_event/trace_config_category_filter.h View 1 chunk +2 lines, -2 lines 0 comments Download
M base/trace_event/trace_config_category_filter.cc View 1 5 chunks +17 lines, -18 lines 0 comments Download
M base/trace_event/trace_event_etw_export_win.h View 2 chunks +2 lines, -2 lines 0 comments Download
M base/trace_event/trace_event_etw_export_win.cc View 1 4 chunks +8 lines, -9 lines 0 comments Download
M chrome/browser/chromeos/arc/tracing/arc_tracing_bridge.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 21 (6 generated)
Andrey Kraynov
Hi! This CL is a continuation of my previous patch, https://codereview.chromium.org/2624583002/patch/20001/30003. I had to split ...
3 years, 8 months ago (2017-03-28 13:04:58 UTC) #2
Primiano Tucci (use gerrit)
LGTM with 1 comment https://codereview.chromium.org/2777203004/diff/1/base/trace_event/trace_config_category_filter.cc File base/trace_event/trace_config_category_filter.cc (left): https://codereview.chromium.org/2777203004/diff/1/base/trace_event/trace_config_category_filter.cc#oldcode93 base/trace_event/trace_config_category_filter.cc:93: DCHECK(category_group_name); can you keep this ...
3 years, 8 months ago (2017-03-28 15:08:06 UTC) #3
Andrey Kraynov
On 2017/03/28 15:08:06, Primiano Tucci wrote: > LGTM with 1 comment > > https://codereview.chromium.org/2777203004/diff/1/base/trace_event/trace_config_category_filter.cc > ...
3 years, 8 months ago (2017-03-28 16:00:11 UTC) #4
Andrey Kraynov
https://codereview.chromium.org/2777203004/diff/1/base/trace_event/trace_config_category_filter.cc File base/trace_event/trace_config_category_filter.cc (right): https://codereview.chromium.org/2777203004/diff/1/base/trace_event/trace_config_category_filter.cc#newcode92 base/trace_event/trace_config_category_filter.cc:92: CStringTokenizer category_group_tokens(category_group_name.begin(), And one question I forgot to mention. ...
3 years, 8 months ago (2017-03-28 16:14:13 UTC) #5
Andrey Kraynov
https://codereview.chromium.org/2777203004/diff/1/base/trace_event/trace_config_category_filter.cc File base/trace_event/trace_config_category_filter.cc (left): https://codereview.chromium.org/2777203004/diff/1/base/trace_event/trace_config_category_filter.cc#oldcode93 base/trace_event/trace_config_category_filter.cc:93: DCHECK(category_group_name); On 2017/03/28 15:08:06, Primiano Tucci wrote: > can ...
3 years, 8 months ago (2017-03-28 16:55:45 UTC) #6
Andrey Kraynov
+ yusukes@ as OWNER for chrome/browser/chromeos/arc/tracing/ PTAL
3 years, 8 months ago (2017-03-28 16:57:57 UTC) #8
Primiano Tucci (use gerrit)
> It will check for both NULL string and empty string(""), is that OK? ack ...
3 years, 8 months ago (2017-03-28 16:59:56 UTC) #9
Yusuke Sato
arc/ lgtm
3 years, 8 months ago (2017-03-28 17:09:50 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2777203004/20001
3 years, 8 months ago (2017-03-28 17:26:08 UTC) #13
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/src/+/b5d44bb49fd4dc5e544f4312de6b00b1a1eb625c
3 years, 8 months ago (2017-03-28 20:25:43 UTC) #16
imcheng
A revert of this CL (patchset #2 id:20001) has been created in https://codereview.chromium.org/2776393004/ by imcheng@chromium.org. ...
3 years, 8 months ago (2017-03-28 22:13:45 UTC) #17
Andrey Kraynov
On 2017/03/28 22:13:45, imcheng wrote: > A revert of this CL (patchset #2 id:20001) has ...
3 years, 8 months ago (2017-03-28 22:41:14 UTC) #18
Andrey Kraynov
On 2017/03/28 16:59:56, Primiano Tucci wrote: > > It will check for both NULL string ...
3 years, 8 months ago (2017-03-29 12:26:06 UTC) #19
Primiano Tucci (use gerrit)
On 2017/03/29 12:26:06, Andrey Kraynov wrote: > On 2017/03/28 16:59:56, Primiano Tucci wrote: > > ...
3 years, 8 months ago (2017-03-29 15:33:11 UTC) #20
Andrey Kraynov
3 years, 8 months ago (2017-03-29 16:02:34 UTC) #21
Message was sent while issue was closed.
On 2017/03/29 15:33:11, Primiano Tucci wrote:
> 
> That looks definitely a bug to me, shame that caused a revert of this :/
> Filed crbug.com/706416

Thanks for your help!
Hope we can find a solution for the new bug 706416 so I will be able to reland
this CL.

Powered by Google App Engine
This is Rietveld 408576698