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

Issue 191673003: Implement ScopedFD in terms of ScopedGeneric. (Closed)

Created:
6 years, 9 months ago by brettw
Modified:
6 years, 9 months ago
Reviewers:
agl, viettrungluu
CC:
chromium-reviews, nkostylev+watch_chromium.org, gavinp+memory_chromium.org, stevenjb+watch_chromium.org, extensions-reviews_chromium.org, cbentzel+watch_chromium.org, jam, joi+watch-content_chromium.org, darin-cc_chromium.org, yfriedman+watch_chromium.org, chromium-apps-reviews_chromium.org, erikwright+watch_chromium.org, fischman+watch_chromium.org, craigdh+watch_chromium.org, feature-media-reviews_chromium.org, bulach+watch_chromium.org, oshima+watch_chromium.org, ilevy-cc_chromium.org, klundberg+watch_chromium.org, agl, tfarina, mcasas+watch_chromium.org, robertshield, davemoore+watch_chromium.org, stgao, wjia+watch_chromium.org, jln+watch_chromium.org
Visibility:
Public.

Description

Implement ScopedFD in terms of ScopedGeneric. Move to a new file base/files/scoped_file.h. I will also add ScopedFILE to here (currently in file_util.h) later. I think there is a crash in the old code in content/browser/zygote_host/zygote_host_impl_linux.cc that this patch should fix. The old ScopedFD took the address of something in a vector that is being modified. I removed SafeScopedFD from content/common/sandbox_linux/sandbox_linux.cc since base's ScopedFD not CHECKs on close failure (this is a more recent addition). BUG= R=agl@chromium.org, viettrungluu@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=257001 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=257179

Patch Set 1 #

Total comments: 1

Patch Set 2 : #

Patch Set 3 : Add new files. #

Patch Set 4 : Merge to new ScopedGeneric name #

Patch Set 5 : #

Total comments: 7

Patch Set 6 : #

Patch Set 7 : mac fix #

Patch Set 8 : linux fix #

Patch Set 9 : try fixes #

Patch Set 10 : fix mac #

Patch Set 11 : fix mac #

Total comments: 6

Patch Set 12 : #

Patch Set 13 : #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+332 lines, -286 lines) Patch
M base/BUILD.gn View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M base/base.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M base/debug/proc_maps_linux.cc View 1 3 chunks +4 lines, -4 lines 0 comments Download
M base/file_util.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -26 lines 0 comments Download
M base/file_util_posix.cc View 1 2 3 4 5 6 7 8 9 3 chunks +8 lines, -8 lines 0 comments Download
M base/file_util_unittest.cc View 1 2 3 4 5 6 7 8 9 3 chunks +5 lines, -4 lines 0 comments Download
A base/files/scoped_file.h View 1 2 3 4 5 1 chunk +47 lines, -0 lines 0 comments Download
A base/files/scoped_file.cc View 1 2 1 chunk +35 lines, -0 lines 0 comments Download
M base/memory/discardable_memory_allocator_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +6 lines, -7 lines 0 comments Download
M base/memory/shared_memory.h View 2 chunks +2 lines, -1 line 0 comments Download
M base/memory/shared_memory_posix.cc View 1 2 3 4 5 8 chunks +10 lines, -14 lines 0 comments Download
M base/posix/unix_domain_socket_linux_unittest.cc View 1 2 3 4 5 3 chunks +4 lines, -3 lines 0 comments Download
M base/process/kill_mac.cc View 1 2 3 4 5 6 3 chunks +5 lines, -6 lines 0 comments Download
M base/process/kill_posix.cc View 1 2 3 4 5 6 7 8 3 chunks +5 lines, -5 lines 0 comments Download
M base/process/launch_posix.cc View 1 2 chunks +4 lines, -4 lines 0 comments Download
M base/test/launcher/test_launcher.cc View 1 2 3 4 5 3 chunks +9 lines, -10 lines 0 comments Download
M chrome/browser/chromeos/system/automatic_reboot_manager.cc View 1 2 3 4 5 6 7 8 3 chunks +11 lines, -10 lines 1 comment Download
M chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc View 3 chunks +9 lines, -8 lines 0 comments Download
M chrome/browser/mac/relauncher.cc View 1 2 3 4 5 6 7 8 9 10 7 chunks +11 lines, -13 lines 0 comments Download
M chrome/browser/process_singleton_mac_unittest.cc View 1 2 chunks +4 lines, -5 lines 0 comments Download
M chrome/test/automation/proxy_launcher.cc View 1 2 3 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/test/chromedriver/chrome_launcher.cc View 1 2 3 4 5 6 7 2 chunks +5 lines, -5 lines 1 comment Download
M chrome/utility/importer/firefox_importer_unittest_utils_mac.cc View 1 2 chunks +4 lines, -4 lines 0 comments Download
M components/nacl.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/child_process_launcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +3 lines, -2 lines 0 comments Download
M content/browser/zygote_host/zygote_host_impl_linux.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M content/child/npapi/np_channel_base.cc View 3 chunks +4 lines, -3 lines 0 comments Download
M content/common/sandbox_linux/sandbox_linux.cc View 1 2 3 4 chunks +11 lines, -15 lines 0 comments Download
M content/common/sandbox_mac.mm View 1 2 chunks +4 lines, -4 lines 0 comments Download
M content/common/sandbox_mac_system_access_unittest.mm View 1 3 chunks +6 lines, -7 lines 1 comment Download
M ipc/ipc_channel_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +5 lines, -5 lines 0 comments Download
M ipc/unix_domain_socket_util.cc View 1 7 chunks +21 lines, -22 lines 0 comments Download
M media/video/capture/linux/video_capture_device_linux.h View 2 chunks +2 lines, -2 lines 0 comments Download
M media/video/capture/linux/video_capture_device_linux.cc View 1 21 chunks +37 lines, -40 lines 0 comments Download
M net/test/spawned_test_server/local_test_server.h View 2 chunks +2 lines, -2 lines 0 comments Download
M net/test/spawned_test_server/local_test_server_posix.cc View 3 chunks +6 lines, -6 lines 0 comments Download
M sandbox/linux/services/broker_process_unittest.cc View 1 2 3 5 chunks +4 lines, -5 lines 0 comments Download
M sandbox/linux/services/credentials_unittest.cc View 4 chunks +4 lines, -5 lines 0 comments Download
M sandbox/linux/services/scoped_process_unittest.cc View 3 chunks +6 lines, -5 lines 0 comments Download
M sandbox/linux/services/yama.cc View 1 2 chunks +4 lines, -4 lines 2 comments Download
M tools/android/memdump/memdump.cc View 1 5 chunks +10 lines, -13 lines 2 comments Download

Messages

Total messages: 20 (0 generated)
brettw
Please don't rubberstamp, I'm paranoid about breaking something.
6 years, 9 months ago (2014-03-08 00:53:34 UTC) #1
brettw
Note: requires https://codereview.chromium.org/189613002/
6 years, 9 months ago (2014-03-08 00:54:04 UTC) #2
jln (very slow on Chromium)
Did you forget to include base/files/scoped_file.h in your CL? Note: there is pattern of: int ...
6 years, 9 months ago (2014-03-08 01:15:14 UTC) #3
viettrungluu
https://codereview.chromium.org/191673003/diff/1/base/memory/discardable_memory_allocator_android.cc File base/memory/discardable_memory_allocator_android.cc (right): https://codereview.chromium.org/191673003/diff/1/base/memory/discardable_memory_allocator_android.cc#newcode70 base/memory/discardable_memory_allocator_android.cc:70: if (!fd) { So, it occurs to me that ...
6 years, 9 months ago (2014-03-08 03:06:03 UTC) #4
agl
LGTM for net/
6 years, 9 months ago (2014-03-10 14:56:14 UTC) #5
brettw
New patch up with Testable removed, replaced with is_valid()
6 years, 9 months ago (2014-03-10 17:36:28 UTC) #6
jln (very slow on Chromium)
On 2014/03/10 17:36:28, brettw wrote: > New patch up with Testable removed, replaced with is_valid() ...
6 years, 9 months ago (2014-03-10 17:51:02 UTC) #7
brettw
Whoops, missing files added.
6 years, 9 months ago (2014-03-10 17:55:30 UTC) #8
viettrungluu
https://codereview.chromium.org/191673003/diff/80001/base/memory/discardable_memory_allocator_android.cc File base/memory/discardable_memory_allocator_android.cc (right): https://codereview.chromium.org/191673003/diff/80001/base/memory/discardable_memory_allocator_android.cc#newcode91 base/memory/discardable_memory_allocator_android.cc:91: ignore_result(fd_closer.release()); This doesn't compile. https://codereview.chromium.org/191673003/diff/80001/base/memory/shared_memory_posix.cc File base/memory/shared_memory_posix.cc (right): https://codereview.chromium.org/191673003/diff/80001/base/memory/shared_memory_posix.cc#newcode352 ...
6 years, 9 months ago (2014-03-12 19:47:22 UTC) #9
brettw
Review comments so far, added some advice on when to use. https://codereview.chromium.org/191673003/diff/80001/base/test/launcher/test_launcher.cc File base/test/launcher/test_launcher.cc (right): ...
6 years, 9 months ago (2014-03-12 20:45:29 UTC) #10
viettrungluu
On 2014/03/12 20:45:29, brettw wrote: > Review comments so far, added some advice on when ...
6 years, 9 months ago (2014-03-13 22:37:09 UTC) #11
viettrungluu
https://codereview.chromium.org/191673003/diff/150043/content/browser/zygote_host/zygote_host_impl_linux.cc File content/browser/zygote_host/zygote_host_impl_linux.cc (right): https://codereview.chromium.org/191673003/diff/150043/content/browser/zygote_host/zygote_host_impl_linux.cc#newcode322 content/browser/zygote_host/zygote_host_impl_linux.cc:322: std::vector<linked_ptr<base::ScopedFD> > autodelete_fds; Side comment: I don't see why ...
6 years, 9 months ago (2014-03-13 22:37:19 UTC) #12
viettrungluu
Also, LGTM w/the noted things addressed/looked at/considered/ignored/aborted/retried/failed.
6 years, 9 months ago (2014-03-13 22:38:12 UTC) #13
brettw
https://codereview.chromium.org/191673003/diff/150043/net/test/spawned_test_server/local_test_server_posix.cc File net/test/spawned_test_server/local_test_server_posix.cc (right): https://codereview.chromium.org/191673003/diff/150043/net/test/spawned_test_server/local_test_server_posix.cc#newcode151 net/test/spawned_test_server/local_test_server_posix.cc:151: base::ScopedFD our_fd(child_fd_.release()); On 2014/03/13 22:37:20, viettrungluu wrote: > Why ...
6 years, 9 months ago (2014-03-13 22:42:09 UTC) #14
brettw
Committed patchset #11 manually as r257001.
6 years, 9 months ago (2014-03-14 05:21:26 UTC) #15
Nico
A revert of this CL has been created in https://codereview.chromium.org/197873014/ by thakis@chromium.org. The reason for ...
6 years, 9 months ago (2014-03-14 05:33:21 UTC) #16
brettw
Committed patchset #13 manually as r257179.
6 years, 9 months ago (2014-03-14 19:37:00 UTC) #17
jochen (gone - plz use gerrit)
A revert of this CL has been created in https://codereview.chromium.org/201203002/ by jochen@chromium.org. The reason for ...
6 years, 9 months ago (2014-03-15 13:33:57 UTC) #18
agl
LGTM https://codereview.chromium.org/191673003/diff/220001/chrome/browser/chromeos/system/automatic_reboot_manager.cc File chrome/browser/chromeos/system/automatic_reboot_manager.cc (right): https://codereview.chromium.org/191673003/diff/220001/chrome/browser/chromeos/system/automatic_reboot_manager.cc#newcode68 chrome/browser/chromeos/system/automatic_reboot_manager.cc:68: while ((length = read(fd.get(), buffer, sizeof(buffer))) > 0) ...
6 years, 9 months ago (2014-03-18 06:52:04 UTC) #19
brettw
6 years, 9 months ago (2014-03-18 20:21:53 UTC) #20
Message was sent while issue was closed.
Thanks, HANDLE_EINTR suggestions implemented on
https://codereview.chromium.org/203213005/

Powered by Google App Engine
This is Rietveld 408576698