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

Issue 13196006: Move path functions from file_util to FilePath object. (Closed)

Created:
7 years, 8 months ago by brettw
Modified:
7 years, 7 months ago
CC:
chromium-reviews, tzik+watch_chromium.org, amit, kinuko+watch, frankf+watch_chromium.org, cbentzel+watch_chromium.org, benjhayden+dwatch_chromium.org, grt+watch_chromium.org, jam, apatrick_chromium, joi+watch-content_chromium.org, darin-cc_chromium.org, yfriedman+watch_chromium.org, chromium-apps-reviews_chromium.org, erikwright+watch_chromium.org, tim (not reviewing), Raghu Simha, bulach+watch_chromium.org, haitaol1, ilevy+watch_chromium.org, jochen+watch_chromium.org, akalin, sail+watch_chromium.org, Aaron Boodman, robertshield, rdsmith+dwatch_chromium.org, klundberg+watch_chromium.org
Visibility:
Public.

Description

Move path functions from file_util to FilePath object. EnsureEndsWithSeparator used to check whether the file existed. This seems bad and unnecessary so I removed it. I removed file_util::ContainsPath and used the existing file_util::IsParent instead. The functions descriptions are the same but the implementations do slightly different things, which is worrying. The only non-test use of this function to worry about is content/browser/storage_partition_impl_map.cc. As far as I see, the requirements for this seem OK, but I'm not very familiar with this. After some discussion with akalin, I changed sync/internal_api/sync_manager_impl.cc to be a DCHECK that the path is absolute rather than make it absolute. The old code relied on the behavior of the old function that the argument would be unchanged if the file didn't exist, and this (possibly relative) path would be used later. This behavior doesn't make a lot of sense, and it looks like now that the path is always absolute, so I replaced this call with a DCHECK. BUG= Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=193855

Patch Set 1 #

Total comments: 5

Patch Set 2 : Self-review #

Patch Set 3 : Try fixes, merge #

Total comments: 2

Patch Set 4 : Move AsAbsolute back out of FilePath #

Total comments: 4

Patch Set 5 : merged #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : #

Patch Set 11 : git try #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+224 lines, -281 lines) Patch
M base/file_util.h View 1 2 3 4 1 chunk +7 lines, -20 lines 0 comments Download
M base/file_util.cc View 1 2 3 4 2 chunks +0 lines, -49 lines 0 comments Download
M base/file_util_posix.cc View 1 2 3 4 5 6 7 3 chunks +19 lines, -14 lines 0 comments Download
M base/file_util_unittest.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -44 lines 0 comments Download
M base/file_util_win.cc View 1 2 3 4 2 chunks +12 lines, -9 lines 0 comments Download
M base/files/file_path.h View 1 2 3 4 5 1 chunk +7 lines, -0 lines 0 comments Download
M base/files/file_path.cc View 1 2 3 4 5 6 7 1 chunk +18 lines, -0 lines 0 comments Download
M base/files/file_path_unittest.cc View 1 2 3 4 5 1 chunk +28 lines, -1 line 0 comments Download
M base/path_service.cc View 1 2 3 3 chunks +8 lines, -8 lines 0 comments Download
M base/test/test_file_util_posix.cc View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/extensions/component_loader.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/extensions/extension_browsertest.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_creator.cc View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/extension_service_unittest.cc View 1 2 3 4 5 6 7 2 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/extensions/platform_app_launcher.cc View 1 2 3 4 5 6 7 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/extensions/unpacked_installer.cc View 1 2 3 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/net/url_fixer_upper.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/net/url_fixer_upper_unittest.cc View 1 2 3 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/platform_util_win.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/shell_integration.cc View 1 2 3 4 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/version_handler.cc View 1 2 3 1 chunk +5 lines, -5 lines 0 comments Download
M chrome/common/extensions/extension_file_util.cc View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/common/extensions/extension_file_util_unittest.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M chrome/installer/setup/setup_main.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/installer/setup/uninstall.cc View 1 2 3 2 chunks +2 lines, -4 lines 0 comments Download
M chrome/test/base/ui_test_utils.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/test/base/v8_unit_test.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/gpu/gpu_pixel_browsertest.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/test/mini_installer_test/installer_test_util.cc View 1 chunk +3 lines, -5 lines 0 comments Download
M chrome/test/reliability/page_load_test.cc View 1 2 3 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/tools/mac_helpers/infoplist_strings_util.mm View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome_frame/test/reliability/page_load_test.cc View 1 2 3 1 chunk +2 lines, -3 lines 0 comments Download
M cloud_print/service/win/chrome_launcher.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -5 lines 0 comments Download
M cloud_print/service/win/cloud_print_service.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M content/browser/download/save_package.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M content/browser/gpu/gpu_pixel_browsertest.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/storage_partition_impl_map.cc View 1 2 3 4 2 chunks +7 lines, -7 lines 0 comments Download
M content/common/sandbox_win.cc View 1 2 3 4 1 chunk +2 lines, -4 lines 0 comments Download
M content/public/test/test_launcher.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M content/shell/shell_browser_main.cc View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M content/shell/shell_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -3 lines 0 comments Download
M extensions/common/extension_resource.cc View 1 2 3 2 chunks +11 lines, -9 lines 0 comments Download
M extensions/common/extension_resource_unittest.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M net/url_request/file_protocol_handler.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_request_file_job.cc View 1 chunk +1 line, -1 line 0 comments Download
M skia/ext/vector_canvas_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -3 lines 0 comments Download
M sync/internal_api/sync_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -2 lines 0 comments Download
M tools/android/md5sum/md5sum.cc View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M ui/shell_dialogs/select_file_dialog_win.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M webkit/fileapi/local_file_system_operation_unittest.cc View 1 2 4 chunks +3 lines, -6 lines 0 comments Download
M webkit/glue/dom_serializer_unittest.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M webkit/glue/webfileutilities_impl.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M webkit/plugins/npapi/plugin_list_posix.cc View 1 2 3 1 chunk +2 lines, -3 lines 1 comment Download
M webkit/plugins/npapi/plugin_list_win.cc View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M webkit/support/platform_support_mac.mm View 1 2 3 4 2 chunks +3 lines, -4 lines 0 comments Download
M webkit/support/webkit_support.cc View 1 2 3 4 4 chunks +6 lines, -7 lines 0 comments Download
M webkit/tools/test_shell/test_shell_main.cc View 1 2 3 4 5 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
brettw
Self review https://codereview.chromium.org/13196006/diff/1/chrome/browser/extensions/platform_app_launcher.cc File chrome/browser/extensions/platform_app_launcher.cc (right): https://codereview.chromium.org/13196006/diff/1/chrome/browser/extensions/platform_app_launcher.cc#newcode66 chrome/browser/extensions/platform_app_launcher.cc:66: *file_path = file_path->AsAbsolute(); Fix me. https://codereview.chromium.org/13196006/diff/1/chrome/common/extensions/extension_file_util_unittest.cc File ...
7 years, 8 months ago (2013-03-30 04:19:38 UTC) #1
brettw
7 years, 8 months ago (2013-04-01 17:23:27 UTC) #2
rvargas (doing something else)
https://codereview.chromium.org/13196006/diff/24001/base/files/file_path.cc File base/files/file_path.cc (right): https://codereview.chromium.org/13196006/diff/24001/base/files/file_path.cc#newcode525 base/files/file_path.cc:525: FilePath FilePath::AsAbsolute() const { I'm not sure moving this ...
7 years, 8 months ago (2013-04-01 19:50:31 UTC) #3
brettw
(No new patch up, will let you know when I'm done.) https://codereview.chromium.org/13196006/diff/24001/base/files/file_path.cc File base/files/file_path.cc (right): ...
7 years, 8 months ago (2013-04-01 22:42:24 UTC) #4
brettw
I moved AsAbsolute out as base::MakeAbsoluteFilePath. I'm transitioning everything in file_util to the base namespace ...
7 years, 8 months ago (2013-04-01 23:51:18 UTC) #5
rvargas (doing something else)
LGTM after the small fix for AsEndingWithSeparator https://codereview.chromium.org/13196006/diff/20003/base/files/file_path.cc File base/files/file_path.cc (right): https://codereview.chromium.org/13196006/diff/20003/base/files/file_path.cc#newcode19 base/files/file_path.cc:19: #include "base/threading/thread_restrictions.h" ...
7 years, 8 months ago (2013-04-02 01:39:55 UTC) #6
brettw
https://codereview.chromium.org/13196006/diff/20003/chrome/browser/platform_util_win.cc File chrome/browser/platform_util_win.cc (right): https://codereview.chromium.org/13196006/diff/20003/chrome/browser/platform_util_win.cc#newcode36 chrome/browser/platform_util_win.cc:36: if (dir.empty()) Good catch, I also added tests for ...
7 years, 8 months ago (2013-04-08 23:40:19 UTC) #7
akalin
sync lgtm
7 years, 8 months ago (2013-04-08 23:42:14 UTC) #8
rvargas (doing something else)
lgtm
7 years, 8 months ago (2013-04-09 00:06:35 UTC) #9
brettw
The original patch broke a sync test. I had to make this change: https://codereview.chromium.org/13196006/diff2/71003:77001/sync/internal_api/sync_manager_impl.cc The ...
7 years, 8 months ago (2013-04-11 21:02:52 UTC) #10
brettw
cloud_print: TBR=vitalybuka@chromium.org extensions: TBR=finnur@chromium.org ui TBR=sky@chromium.org
7 years, 8 months ago (2013-04-12 04:41:27 UTC) #11
brettw
cloud_print: TBR=vitalybuka@chromium.org extensions: TBR=finnur@chromium.org ui TBR=sky@chromium.org
7 years, 8 months ago (2013-04-12 04:41:27 UTC) #12
brettw
chrome_frame TBR=robertshield@chromium.org content TBR=jam@chromium.org skia TBR=alokp@chromium.org
7 years, 8 months ago (2013-04-12 04:43:19 UTC) #13
Vitaly Buka (NO REVIEWS)
lgtm
7 years, 8 months ago (2013-04-12 04:43:32 UTC) #14
brettw
Committed patchset #11 manually as r193855.
7 years, 8 months ago (2013-04-12 05:17:24 UTC) #15
Finnur
Extensions LGTM
7 years, 8 months ago (2013-04-12 12:43:28 UTC) #16
Steve Block
7 years, 7 months ago (2013-05-07 06:46:27 UTC) #17
Message was sent while issue was closed.
https://codereview.chromium.org/13196006/diff/89001/webkit/plugins/npapi/plug...
File webkit/plugins/npapi/plugin_list_posix.cc (right):

https://codereview.chromium.org/13196006/diff/89001/webkit/plugins/npapi/plug...
webkit/plugins/npapi/plugin_list_posix.cc:221: base::FilePath orig_path =
base::MakeAbsoluteFilePath(path);
Shouldn't this be 'path = ...', and orig_path should be left as it was?

Powered by Google App Engine
This is Rietveld 408576698