DescriptionIntercept base::File Open/Close
When a file descriptor is opened by the base::File, all calls to close(3) from the same dynamic library will hit a CHECK unless they are made from a whitelist of callsites belonging to base::File.
There is a handy protect_file_posix.gypi introduced to make it easy to enable on Chrome-for-Android.
This 'linker magic' is somewhat crazy, so:
1. it will be *removed *when crbug.com/424562 is fixed
2. it should only be used by a whitelist of binaries/libraries (in the opensource part: libchromeshell only)
BUG=424562
Committed: https://crrev.com/45a0dc0b75b52e026eb15526ef441edc5dbe9ba5
Cr-Commit-Position: refs/heads/master@{#304592}
Patch Set 1 #Patch Set 2 : Moved the logic to file_posix.cc, need some magic in GYP yet #Patch Set 3 : with moar GYP magic #Patch Set 4 : disable linker magic for component build #
Total comments: 24
Patch Set 5 : addressed most comments #Patch Set 6 : More careful protection in constructors #Patch Set 7 : Added base/files/file_posix_hooks_internal.h #Patch Set 8 : gn #
Total comments: 5
Patch Set 9 : nits #Patch Set 10 : Add more TODOs for removal. #Patch Set 11 : . #Patch Set 12 : . #
Messages
Total messages: 31 (7 generated)
|