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

Issue 11359177: Cleanup, no functional change. (Closed)

Created:
8 years, 1 month ago by Peter Kasting
Modified:
8 years, 1 month ago
Reviewers:
dmazzoni
CC:
chromium-reviews, hashimoto+watch_chromium.org, aboxhall+watch_chromium.org, yoshiki+watch_chromium.org, jam, yuzo+watch_chromium.org, davidbarr+watch_chromium.org, joi+watch-content_chromium.org, darin-cc_chromium.org, dmazzoni+watch_chromium.org, dtseng+watch_chromium.org, ctguil+watch_chromium.org, zork+watch_chromium.org
Visibility:
Public.

Description

Cleanup, no functional change. * Function declarations should either list all arguments on the same line as the function name, or one per line, indented even, starting on the same line as the function name if they fit. * '*' is adjacent to type name, not variable name. * Eliminate some code duplication. * No else after return. * Use vector::empty() and string16::clear() where appropriate. * Various other tiny cleanups for shorter code, parallel structure, consistent indenting with other Chrome code, etc. BUG=none TEST=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=167306

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+221 lines, -257 lines) Patch
M content/browser/accessibility/browser_accessibility_win.h View 15 chunks +64 lines, -62 lines 0 comments Download
M content/browser/accessibility/browser_accessibility_win.cc View 59 chunks +157 lines, -195 lines 4 comments Download

Messages

Total messages: 10 (0 generated)
Peter Kasting
8 years, 1 month ago (2012-11-13 03:16:09 UTC) #1
dmazzoni
lgtm Be sure to fix the one functional error below before committing, thanks! https://codereview.chromium.org/11359177/diff/1/content/browser/accessibility/browser_accessibility_win.cc File ...
8 years, 1 month ago (2012-11-13 03:54:02 UTC) #2
Peter Kasting
https://codereview.chromium.org/11359177/diff/1/content/browser/accessibility/browser_accessibility_win.cc File content/browser/accessibility/browser_accessibility_win.cc (right): https://codereview.chromium.org/11359177/diff/1/content/browser/accessibility/browser_accessibility_win.cc#newcode2688 content/browser/accessibility/browser_accessibility_win.cc:2688: DCHECK(table); On 2012/11/13 03:54:02, Dominic Mazzoni wrote: > This ...
8 years, 1 month ago (2012-11-13 04:02:08 UTC) #3
dmazzoni
https://codereview.chromium.org/11359177/diff/1/content/browser/accessibility/browser_accessibility_win.cc File content/browser/accessibility/browser_accessibility_win.cc (right): https://codereview.chromium.org/11359177/diff/1/content/browser/accessibility/browser_accessibility_win.cc#newcode2688 content/browser/accessibility/browser_accessibility_win.cc:2688: DCHECK(table); On 2012/11/13 04:02:08, Peter Kasting wrote: > On ...
8 years, 1 month ago (2012-11-13 04:12:12 UTC) #4
jam
On Mon, Nov 12, 2012 at 7:16 PM, <pkasting@chromium.org> wrote: > Reviewers: Dominic Mazzoni, > ...
8 years, 1 month ago (2012-11-13 04:41:15 UTC) #5
Peter Kasting
This is coming from "be consistent within the file itself". The file mostly uses this ...
8 years, 1 month ago (2012-11-13 04:50:30 UTC) #6
jam
On Mon, Nov 12, 2012 at 8:50 PM, <pkasting@chromium.org> wrote: > This is coming from ...
8 years, 1 month ago (2012-11-13 04:58:28 UTC) #7
Peter Kasting
On 2012/11/13 04:58:28, John Abd-El-Malek wrote: > Why should the file be consistent with putting ...
8 years, 1 month ago (2012-11-13 05:12:58 UTC) #8
jam
I think some stuff like this is so minor that it's not worth stressing about, ...
8 years, 1 month ago (2012-11-13 06:49:28 UTC) #9
Peter Kasting
8 years, 1 month ago (2012-11-13 07:07:15 UTC) #10
On 2012/11/13 06:49:28, John Abd-El-Malek wrote:
> I'm just not comfortable with third parties going to change this code
> because of the hysteresis issue. If you're not going to change other files,
> I don't care much about this one. But I don't think doing this to
> other files will be productive.

I don't have any plans to go do this to other files.  The reason I started
touching this file to begin with was because I was trying to find and read all
the code that uses BSTRs (to convert to ScopedBstr where possible) and reading
this file was bugging me.

I was in the process of writing a follow-up note here anyway, though, and this
provides a good segue to it.

While I do think the consistency argument is true, and I think the change
overall is an improvement that should stand -- if admittedly highly trivial in
places -- that argument was not my complete original motivation.

Part of why the file was bugging me was that that first bullet in the
description is in fact what the Chrome style guide used to say about function
declarations/definitions.  It said that for years, and I enforced it in my
reviews for years before that, though not everyone on the team knew/agreed
with/followed the rule.  So that pattern is just ingrained by force of habit.  I
totally forgot that we rewrote the style guide to omit this directive (because
it went beyond the requirements of the Google style guide).

It would not have been hard to say that originally: "I admit I forgot we don't
require this anymore.  However, I still think this change is a good idea because
it makes the file style consistent." etc.  But I didn't do that.  Instead I just
stuck with the arguments that most strongly supported what I was doing.  It
wasn't an explicit conscious decision -- I think I was instinctively defensive,
for reasons that I'd rather not discuss in public (if they even need to be
discussed at all).  In retrospect, I regret that.  It's important to admit
mistakes, even minor ones; that's what's best from both a technical and an
interpersonal perspective.

So, I'm sorry I didn't say that up front.  And I'll try to remember in the
future not to enforce style rules we no longer have.

Powered by Google App Engine
This is Rietveld 408576698