summaryrefslogtreecommitdiffstats
path: root/base/file_util.h
Commit message (Collapse)AuthorAgeFilesLines
* While enumerating plugins under the MozillaPlugins registry key, we should ↵ananta@chromium.org2011-03-041-1/+11
| | | | | | | | | | | | | | | | | | ignore 64 bit plugins. We validate whether a plugin is a 32 bit dll by reading its PE image. This fixes bug http://code.google.com/p/chromium/issues/detail?id=73032 Added support for the win32 version of the MemoryMappedFile helper class in base to map a file as an image section. BUG=73032 TEST=As described in the bug at this point. Review URL: http://codereview.chromium.org/6611028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76934 0039d316-1c4b-4281-b951-d872f2087c98
* Make MemoryMappedFile::IsValid consttommi@chromium.org2011-02-231-1/+1
| | | | | | | | | TEST=none BUG=none Review URL: http://codereview.chromium.org/6574005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75794 0039d316-1c4b-4281-b951-d872f2087c98
* Start sorting methods in class declarations.erg@google.com2011-01-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | A lot of our headers are a mess and aren't organized. Impose the following order on files in the base/ directory: class Blah { each public/protected/private section: typedefs; enums; static constants; ctors; dtors; methods; overridden virtual methods; data members; }; BUG=68682 TEST=compiles Review URL: http://codereview.chromium.org/6081007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70749 0039d316-1c4b-4281-b951-d872f2087c98
* Some additions to support symlinks better on platforms that support them.gspencer@chromium.org2010-11-301-0/+8
| | | | | | | | | BUG=none TEST=Ran new unit test, passed trybots. Review URL: http://codereview.chromium.org/5349007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67631 0039d316-1c4b-4281-b951-d872f2087c98
* Un-recursify FileEnumerator::Next().dumi@chromium.org2010-10-141-4/+2
| | | | | | | | | | BUG=58368 TEST=file_util_unittest.cc passes Review URL: http://codereview.chromium.org/3751001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62677 0039d316-1c4b-4281-b951-d872f2087c98
* Remove logging for issue 35198.skerner@chromium.org2010-09-241-8/+0
| | | | | | | | | | | Remove switch --issue35198-logging . BUG=56664 TEST=Install an extension on all platforms. Review URL: http://codereview.chromium.org/3427019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60471 0039d316-1c4b-4281-b951-d872f2087c98
* Add a TouchFile() function that takes a FilePath argument.dumi@chromium.org2010-09-231-2/+7
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/3496005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60381 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Add a TouchFile function that operates on FilePaths + fixing a bug"maruel@chromium.org2010-09-231-7/+2
| | | | | | | | | | | | This reverts commit 60322. TBR=dumi TEST=none BUG=none Review URL: http://codereview.chromium.org/3439019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60327 0039d316-1c4b-4281-b951-d872f2087c98
* Add a TouchFile function that operates on FilePaths + fixing a bugdumi@chromium.org2010-09-231-2/+7
| | | | | | | | | | | related to FILE_WRITE_ATTRIBUTES on Windows. BUG=none TEST=FileUtilTest::TouchFile Review URL: http://codereview.chromium.org/3404018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60322 0039d316-1c4b-4281-b951-d872f2087c98
* Moving file_util::FileInfo to base::PlatformFileInfo, and adding thedumi@chromium.org2010-09-031-15/+1
| | | | | | | | | | | | last_accessed and creation_time fields. BUG=none TEST=none Review URL: http://codereview.chromium.org/3347005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58454 0039d316-1c4b-4281-b951-d872f2087c98
* linux: add UMA stat for the file system where the prefs are storedevan@chromium.org2010-08-201-2/+22
| | | | | | | | | | | | | I'd like to see how common it is to use a network file system for your home directory. This would help evaluate how important it is to support these users. See also: http://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/b43d2905f079fa1c Review URL: http://codereview.chromium.org/3187011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56786 0039d316-1c4b-4281-b951-d872f2087c98
* Factor out NormalizeToNativeFilePath from NormalizeFilePathcpu@chromium.org2010-08-041-0/+8
| | | | | | | | | | | | - Also do some cleaning up, fixing invalid usage of ScopedHandle BUG=50774 TEST=existing unit tests suffice Review URL: http://codereview.chromium.org/3043050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54918 0039d316-1c4b-4281-b951-d872f2087c98
* Remove some debug switches:skerner@chromium.org2010-07-301-5/+0
| | | | | | | | | | | | | | --issue35198-crxdir-browser --issue35198-permission They were used to understand issue 35198. They are no longer needed. There is one more switch, --issue35198-logging, that is not being removed in this CL. The logging it adds may still be useful. BUG=50604 TEST=manual Review URL: http://codereview.chromium.org/3052023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54323 0039d316-1c4b-4281-b951-d872f2087c98
* Shuffle some of the functions in file_util.h.agl@chromium.org2010-07-301-13/+10
| | | | | | (A followup from r54316.) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54321 0039d316-1c4b-4281-b951-d872f2087c98
* Fix some bad uses of GetTempDir.agl@chromium.org2010-07-301-0/+2
| | | | | | | | | | | (Just a first step. I can't remove GetTempDir yet though.) BUG=none TEST=unit tests http://codereview.chromium.org/3075008/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54316 0039d316-1c4b-4281-b951-d872f2087c98
* `#pragma once` for app, base, chrome, gfx, ipc, net, skia, viewsthakis@chromium.org2010-07-261-0/+1
| | | | | | | | | BUG=50273 TEST=everything still builds, build is 10% faster on windows, same speed on mac/linux TBR: erg git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53716 0039d316-1c4b-4281-b951-d872f2087c98
* Changing the pre-reading of chrome.dll to read it as an image section ↵ananta@chromium.org2010-07-031-0/+9
| | | | | | | | | | | | | | | | | | | instead. XP ignores pages read as data while mapping image sections. This shows a reasonable improvement in cold startup performance on XP. This change only comes into effect for headless mode which enables us to try out the effect on the perf bots and for chrome frame processes. Code mostly written by Amit. Added a chrome frame perf tests which measures LoadLibrary in cold mode with pre-reading. Bug=45510 Review URL: http://codereview.chromium.org/2805064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51594 0039d316-1c4b-4281-b951-d872f2087c98
* Loosen permission on extension temp dir when a flag is used.skerner@chromium.org2010-07-011-0/+5
| | | | | | | | | | | | | | | | | | | Issue 35198 can not be reproduced locally. To enable users to do experiments, three command line flags are added to chrome: --issue35198-crxdir-browser: Have the browser process create the directory in which the extension will be unzipped. --issue35198-logging: Enable log messages from directory creation in the utility process to be moved to the browser process. --issue35198-permission: Use the most permissive file permissions possible on the extension unpack directory. BUG=35198 TEST=manual Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=51231 Review URL: http://codereview.chromium.org/2802018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51416 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 51231 - Loosen permission on extension temp dir when a flag is used.skerner@chromium.org2010-06-301-2/+1
| | | | | | | | | | | | | | | | | | | | Issue 35198 can not be reproduced locally. To enable users to do experiments, three command line flags are added to chrome: --issue35198-crxdir-browser: Have the browser process create the directory in which the extension will be unzipped. --issue35198-logging: Enable log messages from directory creation in the utility process to be moved to the browser process. --issue35198-permission: Use the most permissive file permissions possible on the extension unpack directory. BUG=35198 TEST=manual Review URL: http://codereview.chromium.org/2802018 TBR=skerner@chromium.org Review URL: http://codereview.chromium.org/2861039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51238 0039d316-1c4b-4281-b951-d872f2087c98
* Loosen permission on extension temp dir when a flag is used.skerner@chromium.org2010-06-301-1/+2
| | | | | | | | | | | | | | | | | Issue 35198 can not be reproduced locally. To enable users to do experiments, three command line flags are added to chrome: --issue35198-crxdir-browser: Have the browser process create the directory in which the extension will be unzipped. --issue35198-logging: Enable log messages from directory creation in the utility process to be moved to the browser process. --issue35198-permission: Use the most permissive file permissions possible on the extension unpack directory. BUG=35198 TEST=manual Review URL: http://codereview.chromium.org/2802018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51231 0039d316-1c4b-4281-b951-d872f2087c98
* Clang: Do not ignore result of HANDLE_EINTR.thakis@chromium.org2010-06-231-1/+3
| | | | | | Review URL: http://codereview.chromium.org/2805026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50556 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 49983 - patchthakis@chromium.org2010-06-161-3/+1
| | | | | | | TBR=thakis@chromium.org Review URL: http://codereview.chromium.org/2847011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50001 0039d316-1c4b-4281-b951-d872f2087c98
* patchthakis@chromium.org2010-06-161-1/+3
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49983 0039d316-1c4b-4281-b951-d872f2087c98
* If CreateDirectory() fails during extension unpacking, log the exact OS call ↵skerner@chromium.org2010-06-141-0/+8
| | | | | | | | | | | | | that failed. This change is designed to help understand bug 35198, which we can not reproduce locally. BUG=35198 TEST=manual Review URL: http://codereview.chromium.org/2714016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49703 0039d316-1c4b-4281-b951-d872f2087c98
* Add histograms to track the size of the profile data.rvargas@google.com2010-06-111-0/+9
| | | | | | | | | | BUG=16705 TEST=FileUtilTest.FileAndDirectorySize Review URL: http://codereview.chromium.org/2778006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49606 0039d316-1c4b-4281-b951-d872f2087c98
* Give the extension unpacker process a junction/symlink free path to the ↵skerner@chromium.org2010-06-091-6/+7
| | | | | | | | | | | unpack directory. BUG=35198,13044 TEST=FileUtilTest.NormalizeFilePathBasic,FileUtilTest. NormalizeFilePathReparsePoints,FileUtilTest.NormalizeFilePathSymlinks Review URL: http://codereview.chromium.org/2088006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49337 0039d316-1c4b-4281-b951-d872f2087c98
* file_util: Convert the wstring version of IsDirectoryEmpty to FilePath.tfarina@chromium.org2010-05-261-4/+4
| | | | | | | | | BUG=24672 TEST=compiles Review URL: http://codereview.chromium.org/2153002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48237 0039d316-1c4b-4281-b951-d872f2087c98
* Mac: Infrastructure for serialization of OS fonts over IPC.jeremy@chromium.org2010-05-231-2/+2
| | | | | | | | | BUG=29729 TEST=All unit tests should pass. Review URL: http://codereview.chromium.org/2131005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48002 0039d316-1c4b-4281-b951-d872f2087c98
* page cycler: Use buffer-cache priming code on all systems.evan@chromium.org2010-05-191-0/+2
| | | | | | | | | | | I noticed that the first time I run the page cycler the test numbers are worse, probably because the test pages are not in cache. We already have this code on Mac and I don't see why it shouldn't apply to all systems. Review URL: http://codereview.chromium.org/2096005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47650 0039d316-1c4b-4281-b951-d872f2087c98
* Use realpath() to find the path to the extension unpack dir on posix systems.skerner@chromium.org2010-05-121-0/+7
| | | | | | | | | | | | | Extensions are unpacked by a sandboxed utility process. The sandbox forbids file access outside the directory the extension will be unpacked in. If the path to that directory contains a symbolic link, then unpacking will fail because following the link will cause file system access outside the sandbox path. Use realpath() to get a symlink free path to the directory where the extension will be unpacked. A similar issue exists on windows, with junctions instead of symlinks. This will be fixed in another change. BUG=13044,35198 TEST=FileUtilTest.RealPath Review URL: http://codereview.chromium.org/2001013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47032 0039d316-1c4b-4281-b951-d872f2087c98
* ScopedFD should handle EINTR on close.mark@chromium.org2010-05-051-2/+3
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/1954003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46467 0039d316-1c4b-4281-b951-d872f2087c98
* Unpack extensions inside chrome's profile directory.skerner@chromium.org2010-04-301-0/+7
| | | | | | | | | | | Other users of the temp directory will be altered in a subsequent CL. BUG=13044 TEST=SandboxedExtensionUnpackerTest.*, ScopedTempDir.UniqueTempDirUnderPath, FileUtilTest.CreateNewTempDirInDirTest, manual testing on win, linux, mac. Review URL: http://codereview.chromium.org/1582022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46078 0039d316-1c4b-4281-b951-d872f2087c98
* bsd: refactor XDG bits of linux_util into a shared file.evan@chromium.org2010-04-221-0/+4
| | | | | | | | | This allows the shared code to build on the BSDs without them needing to build _linux files. Review URL: http://codereview.chromium.org/1701005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45380 0039d316-1c4b-4281-b951-d872f2087c98
* file_util.h won't compile if UNIT_TEST and OS_WIN are defined.yuzo@chromium.org2010-04-211-1/+2
| | | | | | | | | | | src\base/file_util.h(524) : error C2664: 'GetNamedSecurityInfoW' : cannot convert parameter 1 from 'const wchar_t *' to 'LPWSTR' BUG=none TEST=none Review URL: http://codereview.chromium.org/1582040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45142 0039d316-1c4b-4281-b951-d872f2087c98
* Report unreadable files as size zero when uploading.vandebo@chromium.org2010-03-291-0/+54
| | | | | | | | | | | Upload zero bytes if the file size shrinks. BUG=30850 TEST=uploading an unreadable file works Review URL: http://codereview.chromium.org/1250002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42981 0039d316-1c4b-4281-b951-d872f2087c98
* Function to compute the total size of the files in a directorycpu@chromium.org2010-03-241-0/+7
| | | | | | | | | | | | | We need this for the diagnostic mode but it can be used by others. Did not see test for GetFileSize() so added them BUG=none TEST=ut included Review URL: http://codereview.chromium.org/1220001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42540 0039d316-1c4b-4281-b951-d872f2087c98
* Deprecate file_util::AppendToPath() on non-Windows.evan@chromium.org2010-02-261-3/+0
| | | | | | | | | | | | We still have ~150 callers to AppendToPath in our code, but most of them are in the installer and I'm reluctant to fiddle with that code without having an easy way to test it. BUG=24672 Review URL: http://codereview.chromium.org/654013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40120 0039d316-1c4b-4281-b951-d872f2087c98
* Deprecate GetDirectoryFromPath on non-Windows.evan@chromium.org2010-02-231-11/+0
| | | | | | | | | | | Due to a bunch of changes I made last week, we now only need this in Windows-specific codepaths. BUG=24672 Review URL: http://codereview.chromium.org/654009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39715 0039d316-1c4b-4281-b951-d872f2087c98
* Add back a line in file_util.h that was accidentally deleted long ago.evan@chromium.org2010-02-231-0/+1
| | | | | | Review URL: http://codereview.chromium.org/652111 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39712 0039d316-1c4b-4281-b951-d872f2087c98
* Move deprecated file_util declarations into a separate file.evan@chromium.org2010-02-231-54/+4
| | | | | | | | | | | | This will make it harder to find them (discouraging new uses) and make it easier to find them for cleanup purposes. BUG=24672 TEST=compiles Review URL: http://codereview.chromium.org/654004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39711 0039d316-1c4b-4281-b951-d872f2087c98
* Actually delete databases in CookiesTreeModel.jochen@chromium.org2010-02-181-1/+4
| | | | | | | | | BUG=34633 TEST=delete a database while it's opened in the renderer Review URL: http://codereview.chromium.org/600104 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39346 0039d316-1c4b-4281-b951-d872f2087c98
* Make sure the parent directory always comes first when listing directories.estade@chromium.org2010-02-111-5/+8
| | | | | | | | | BUG=35288 TEST=see bug Review URL: http://codereview.chromium.org/596054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38854 0039d316-1c4b-4281-b951-d872f2087c98
* Support dragging a virtual file out of the browser.jianli@chromium.org2010-01-151-0/+9
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/351029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36378 0039d316-1c4b-4281-b951-d872f2087c98
* Make ProcessWatcher use kqueues on Mac.jeremy@chromium.org2009-12-151-0/+14
| | | | | | | | | | | | | * Port ProcessWatcher::EnsureProcessTerminated() to kqueue() APIs on OS X. * Make ProcessWatcher::EnsureProcessGetsReaped() Linux-only, since it's only used there. * Add a unit test. BUG=12731 TEST=Open Chrome/Mac, open and close a few tabs. Processes shouldn't stay around. Review URL: http://codereview.chromium.org/496007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34547 0039d316-1c4b-4281-b951-d872f2087c98
* Improve unit tests to verify that directories are listed before files in ↵vandebo@chromium.org2009-12-111-0/+3
| | | | | | | | | | | | | file:/// urls. And fix current regression. BUG=28420 TEST=improved unit tests Review URL: http://codereview.chromium.org/492015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34382 0039d316-1c4b-4281-b951-d872f2087c98
* Minor cleanup; remove deprecate file_util function and some obsolete TODOs.estade@chromium.org2009-12-091-2/+0
| | | | | | Review URL: http://codereview.chromium.org/467030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34133 0039d316-1c4b-4281-b951-d872f2087c98
* file_util: The member variable |pattern_| has a different type (FilePath) ↵thestig@chromium.org2009-12-081-13/+13
| | | | | | | | | | | | | | | from the constructor parameter (StringType). So fix this type to match with the constructor. Original patch by Thiago Farina <thiago.farina@gmail.com> at http://codereview.chromium.org/465119/show BUG=none TEST=none Review URL: http://codereview.chromium.org/466071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34092 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the deprecated version of ContentsEqual.thakis@chromium.org2009-12-011-3/+0
| | | | | | | | | | BUG=24672 TEST=base_unittests Review URL: http://codereview.chromium.org/432001 Patch from tfarina. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33483 0039d316-1c4b-4281-b951-d872f2087c98
* For now, let's clear local storage whenever we clear cookies.jorlow@chromium.org2009-11-261-0/+4
| | | | | | | | BUG=28788 TEST="Clear private data..." from the menu, check cookies, and tell it ok. Data in "Local Storage" inside the profile's data dir should be deleted and any open websites that were using that data should no longer be able to see it. Review URL: http://codereview.chromium.org/441012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33162 0039d316-1c4b-4281-b951-d872f2087c98
* file_util: Remove deprecated function SetCurrentDirectory.thestig@chromium.org2009-11-251-2/+0
| | | | | | | | | | | BUG=24672 TEST=None Original Review URL: http://codereview.chromium.org/391059 Patch from Thiago Farina <thiago.farina@gmail.com>. Review URL: http://codereview.chromium.org/434093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33135 0039d316-1c4b-4281-b951-d872f2087c98