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

Issue 10067002: Add an AddExtension() method in FilePath (Closed)

Created:
8 years, 8 months ago by Devlin
Modified:
8 years, 8 months ago
CC:
chromium-reviews, erikwright (departed), brettw-cc_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Add an AddExtension() method in FilePath This provides an AddExtension() method in FilePath, which will append an extension to the FilePath. This provides clearer, more deliberate functionality than AppendASCII(), and allows us to add extensions without using ReplaceExtension, which will not work on files which already have extension (or appear to, e.g. temp files). BUG=NONE TEST=FilePathTest.AddExtension (added), previous FilePathTests. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=133839

Patch Set 1 #

Total comments: 6

Patch Set 2 : Moved function IsBaseEmptyOrSpecialCase #

Total comments: 2

Patch Set 3 : Simplified special case checking #

Total comments: 2

Patch Set 4 : Removed duplicative check #

Patch Set 5 : Retry with Green Tree and passing tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -22 lines) Patch
M base/file_path.h View 1 1 chunk +6 lines, -1 line 0 comments Download
M base/file_path.cc View 1 2 3 3 chunks +29 lines, -21 lines 0 comments Download
M base/file_path_unittest.cc View 1 chunk +38 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
Devlin
If you could look this over when you get a chance, it'd be much appreciated.
8 years, 8 months ago (2012-04-12 03:36:30 UTC) #1
darin (slow to review)
Mark should review this.
8 years, 8 months ago (2012-04-16 15:52:08 UTC) #2
Mark Mentovai
https://chromiumcodereview.appspot.com/10067002/diff/1/base/file_path.h File base/file_path.h (right): https://chromiumcodereview.appspot.com/10067002/diff/1/base/file_path.h#newcode247 base/file_path.h:247: FilePath AddExtension( It’s hard to see why you need ...
8 years, 8 months ago (2012-04-16 15:54:45 UTC) #3
Devlin
https://chromiumcodereview.appspot.com/10067002/diff/1/base/file_path.h File base/file_path.h (right): https://chromiumcodereview.appspot.com/10067002/diff/1/base/file_path.h#newcode247 base/file_path.h:247: FilePath AddExtension( On 2012/04/16 15:54:45, Mark Mentovai wrote: > ...
8 years, 8 months ago (2012-04-17 21:52:49 UTC) #4
Mark Mentovai
https://chromiumcodereview.appspot.com/10067002/diff/1/base/file_path.h File base/file_path.h (right): https://chromiumcodereview.appspot.com/10067002/diff/1/base/file_path.h#newcode258 base/file_path.h:258: bool IsBaseEmptyOrSpecialCase() const; D Cronin wrote: > On 2012/04/16 ...
8 years, 8 months ago (2012-04-18 20:02:21 UTC) #5
Devlin
https://chromiumcodereview.appspot.com/10067002/diff/1/base/file_path.h File base/file_path.h (right): https://chromiumcodereview.appspot.com/10067002/diff/1/base/file_path.h#newcode258 base/file_path.h:258: bool IsBaseEmptyOrSpecialCase() const; On 2012/04/18 20:02:21, Mark Mentovai wrote: ...
8 years, 8 months ago (2012-04-19 00:05:42 UTC) #6
Mark Mentovai
https://chromiumcodereview.appspot.com/10067002/diff/7001/base/file_path.cc File base/file_path.cc (right): https://chromiumcodereview.appspot.com/10067002/diff/7001/base/file_path.cc#newcode166 base/file_path.cc:166: if (*(path.end() - 1) == FilePath::kExtensionSeparator) { What’s this ...
8 years, 8 months ago (2012-04-19 20:59:09 UTC) #7
Devlin
https://chromiumcodereview.appspot.com/10067002/diff/7001/base/file_path.cc File base/file_path.cc (right): https://chromiumcodereview.appspot.com/10067002/diff/7001/base/file_path.cc#newcode166 base/file_path.cc:166: if (*(path.end() - 1) == FilePath::kExtensionSeparator) { On 2012/04/19 ...
8 years, 8 months ago (2012-04-21 01:37:36 UTC) #8
Mark Mentovai
I would prefer it simplified, unless there’s a proven reason for the optimization. I suspect ...
8 years, 8 months ago (2012-04-21 15:46:48 UTC) #9
Devlin
On 2012/04/21 15:46:48, Mark Mentovai wrote: > I would prefer it simplified, unless there’s a ...
8 years, 8 months ago (2012-04-21 16:58:52 UTC) #10
Mark Mentovai
https://chromiumcodereview.appspot.com/10067002/diff/13001/base/file_path.cc File base/file_path.cc (right): https://chromiumcodereview.appspot.com/10067002/diff/13001/base/file_path.cc#newcode413 base/file_path.cc:413: if (path_.empty()) This check is redundant because IsEmptyOrSpecialCase will ...
8 years, 8 months ago (2012-04-21 17:02:00 UTC) #11
Devlin
On 2012/04/21 17:02:00, Mark Mentovai wrote: > https://chromiumcodereview.appspot.com/10067002/diff/13001/base/file_path.cc > File base/file_path.cc (right): > > https://chromiumcodereview.appspot.com/10067002/diff/13001/base/file_path.cc#newcode413 ...
8 years, 8 months ago (2012-04-21 17:26:23 UTC) #12
Mark Mentovai
Great. And the test data already checks for the thing that the redundant code you ...
8 years, 8 months ago (2012-04-21 17:38:30 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rdevlin.cronin@chromium.org/10067002/11002
8 years, 8 months ago (2012-04-21 18:14:52 UTC) #14
commit-bot: I haz the power
Try job failure for 10067002-11002 (retry) on win_rel for step "browser_tests". It's a second try, ...
8 years, 8 months ago (2012-04-21 21:06:26 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rdevlin.cronin@chromium.org/10067002/24001
8 years, 8 months ago (2012-04-24 23:04:04 UTC) #16
commit-bot: I haz the power
8 years, 8 months ago (2012-04-25 01:53:46 UTC) #17
Change committed as 133839

Powered by Google App Engine
This is Rietveld 408576698