summaryrefslogtreecommitdiffstats
path: root/base/file_util_win.cc
Commit message (Collapse)AuthorAgeFilesLines
* windows: Fix a few things clang complains about.thakis@chromium.org2012-01-231-1/+2
| | | | | | | | | | | | No functionality change. BUG=82385 TEST=none Review URL: http://codereview.chromium.org/9200009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118725 0039d316-1c4b-4281-b951-d872f2087c98
* Match whole path components in DevicePathToDriveLetterPath(). Add tests.skerner@chromium.org2012-01-171-43/+45
| | | | | | | | | | | | | +rvargas, who understands the code +brettw, who is in OWNERS BUG=109577 TEST=FileUtilTest.DevicePathToDriveLetter Review URL: http://codereview.chromium.org/9167004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117986 0039d316-1c4b-4281-b951-d872f2087c98
* Coverity: Initialize member variables.jhawkins@chromium.org2011-12-201-0/+2
| | | | | | | | | | | | | CID=100356,100360,100368,100373,100374,100562,101529,101530,101536,101541, 101542,101595,101630,101685,101687,101689,101776,101812,101813,101854, 101861,101862,101871,101883,101886,101887,102034 BUG=none TEST=none R=binji Review URL: http://codereview.chromium.org/8965054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115225 0039d316-1c4b-4281-b951-d872f2087c98
* Adaptively use temp dir instead of /dev/shm for executable shmem file on Linuxmcgrathr@chromium.org2011-12-061-2/+2
| | | | | | | | | | | | | | | | | On some Linux systems, files from /dev/shm cannot have PROT_EXEC applied to their mappings. This depends on picayune setup details that vary between distributions and kernels and could vary between installations. So just use an empirical test of whether it works or not, and fall back to using generic temporary space instead of /dev/shm for the executable case if needed. BUG= http://code.google.com/p/chromium/issues/detail?id=103377 TEST= SharedMemory.AnonymousExecutable with /dev/shm mounted noexec R=mark@chromium.org Review URL: http://codereview.chromium.org/8800025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113228 0039d316-1c4b-4281-b951-d872f2087c98
* Replace most LOG/CHECK statements with DLOG/DCHECK statements in base.brettw@chromium.org2011-10-261-14/+14
| | | | | | | | | | | [ Reland of 107042 http://codereview.chromium.org/8368009 ] I tried hard not to change CHECKs that had side effects. I kept fatal checks that seemed security or debugging-info (in crash reports) sensitive, and ones that seems particularly well-conceived. Review URL: http://codereview.chromium.org/8341026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107434 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 107042 - Replace most LOG/CHECK statements with DLOG/DCHECK ↵brettw@chromium.org2011-10-251-14/+14
| | | | | | | | | | | | | | statements in base. I tried hard not to change CHECKs that had side effects. I kept fatal checks that seemed security or debugging-info (in crash reports) sensitive, and ones that seems particularly well-conceived. Review URL: http://codereview.chromium.org/8368009 TBR=brettw@chromium.org Review URL: http://codereview.chromium.org/8351025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107051 0039d316-1c4b-4281-b951-d872f2087c98
* Replace most LOG/CHECK statements with DLOG/DCHECK statements in base.brettw@chromium.org2011-10-251-14/+14
| | | | | | | | | I tried hard not to change CHECKs that had side effects. I kept fatal checks that seemed security or debugging-info (in crash reports) sensitive, and ones that seems particularly well-conceived. Review URL: http://codereview.chromium.org/8368009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107042 0039d316-1c4b-4281-b951-d872f2087c98
* Make BaseFile member functions return net::Error's.ahendrickson@chromium.org2011-09-041-24/+0
| | | | | | | | | | | | | | | | | | Moving towards giving the user feedback when a file system error occurs during a download. Split from CL 7134019. rdsmith: downloads phajdan.jr: downloads, base wtc: net brettw: base BUG=None TEST=None Review URL: http://codereview.chromium.org/7778003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99579 0039d316-1c4b-4281-b951-d872f2087c98
* base: Rename FileEnumerator::FILE_TYPE to FileEnumerator::FileType.tfarina@chromium.org2011-08-151-4/+4
| | | | | | | | | | | | | | enum types should be named using CamelCase as class and function names, not using MACRO_STYLE. BUG=None TEST=None R=evan@chromium.org Review URL: http://codereview.chromium.org/7618037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96766 0039d316-1c4b-4281-b951-d872f2087c98
* Adding FileUtilProxy::Entry::{size,last_modified_time},tzik@chromium.org2011-07-191-0/+16
| | | | | | | | | | | | and FileEnumerator::{GetFilesize,GetLastModifiedTime}. BUG=89134 TEST=None Review URL: http://codereview.chromium.org/7355013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92975 0039d316-1c4b-4281-b951-d872f2087c98
* Disallow links from being seen by the extensions via the fileapi.rkc@chromium.org2011-05-311-0/+6
| | | | | | | | | | | | This change is more of a hack at the moment, ideally we need to refactor file_util (and maybe a bit of file_path) to provide better ways to handle symlinks. This fix prevents exploits reading arbitary files either through handled extension calls or our component extension. BUG=chromium-os:15826 TEST=Verified that links do not show up when reading a directory in the file browser UI. Tests that specifically check for this will follow in subsequent checkins. Review URL: http://codereview.chromium.org/7085005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87389 0039d316-1c4b-4281-b951-d872f2087c98
* Send ShChange notifications to cause icon refreshes when updating shortcuts.robertshield@chromium.org2011-04-151-0/+10
| | | | | | | | BUG=78398 TEST=Install version 11.0.696.0 or earlier, then install 11.0.696.36 or later. Observe the desktop icons being updated. Review URL: http://codereview.chromium.org/6870008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81751 0039d316-1c4b-4281-b951-d872f2087c98
* Change DeleteRegistryKey to not require opening root keys with RegKey.tommi@chromium.org2011-03-131-9/+22
| | | | | | | | BUG=none Review URL: http://codereview.chromium.org/6679007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77979 0039d316-1c4b-4281-b951-d872f2087c98
* The code to validate whether plugin dlls are 32 bit failed for some dll's as ↵ananta@chromium.org2011-03-101-4/+2
| | | | | | | | | | | | | | | | | | | the attempt to create a memory mapped section with the size of the file fails with the section too large error. As per msdn documentation we can safely pass in 0 for the file size for CreateFileMapping and MapViewOfFile which indicates that the whole file is being mapped. This caused some plugin dlls like acrobat reader 9 to not load in chrome. Fixes bug http://code.google.com/p/chromium/issues/detail?id=75351 BUG=75351 TEST=manually as described in the bug. Review URL: http://codereview.chromium.org/6661010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77575 0039d316-1c4b-4281-b951-d872f2087c98
* While enumerating plugins under the MozillaPlugins registry key, we should ↵ananta@chromium.org2011-03-041-1/+25
| | | | | | | | | | | | | | | | | | 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
* Temp dir cleanup:grt@chromium.org2011-02-181-3/+1
| | | | | | | | | | | | | | | | - use ScopedTempDir in work items that need backup space for rollback - all work items that need backup space take a parent dir in which they create temp dirs - use ScopedTempDir in a few other places - renamed some parameters in certain functions so that the same name is used everywhere While I was at it, I couldn't help but replace Append(UTF8ToWide(version.GetString())) with the more pleasing AppendASCII(version.GetString()) BUG=70368 TEST=existing tests in installer_util_unittests cover the changes Review URL: http://codereview.chromium.org/6538025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75392 0039d316-1c4b-4281-b951-d872f2087c98
* Fail gracefully if profile Temp dir can not be accessed.skerner@chromium.org2011-01-191-4/+5
| | | | | | | | | BUG=60634, 67627 TEST=Manually interfere with Temp directory creation, see that expected failures happen. Review URL: http://codereview.chromium.org/6297003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71788 0039d316-1c4b-4281-b951-d872f2087c98
* Use FilePath::DirName instead of the deprecated file_util::GetDirectoryFromPath.tfarina@chromium.org2011-01-071-13/+0
| | | | | | | | | | | Fix the callers and remove the deprecated function. BUG=24672 TEST=trybots Review URL: http://codereview.chromium.org/6111003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70705 0039d316-1c4b-4281-b951-d872f2087c98
* Move base/thread.h to base/threading, fix up callers to use the new location.brettw@chromium.org2011-01-011-1/+1
| | | | | | | | TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/6028009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70345 0039d316-1c4b-4281-b951-d872f2087c98
* Move base/win_util to the base/win directory and use the base::win namespace.brettw@google.com2010-12-311-3/+3
| | | | | | | | | Fix up includes, many files including base/win_util don't actually need it. TEST=it compiles BUG=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70341 0039d316-1c4b-4281-b951-d872f2087c98
* Remove win_util::FormatMessage and FormatLastWin32Error. These were only ↵brettw@google.com2010-12-301-6/+4
| | | | | | | | | | | | | | used in a couple of diagnostic places and one can always use the "Error Lookup" utility. Move window HWND-specific functions from base/win_util.h to a new file app/win/hwnd_util.h. I plan to put some more stuff from app/win_util into this file as well. Move gfx/window_impl.h into app/win TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/6019007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70312 0039d316-1c4b-4281-b951-d872f2087c98
* add check for fAnyOperationsAbortederikkay@chromium.org2010-12-211-0/+8
| | | | | | | | | BUG=67621 TEST=none Review URL: http://codereview.chromium.org/6001003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69832 0039d316-1c4b-4281-b951-d872f2087c98
* Turn on file access checks on Win.jam@chromium.org2010-11-041-0/+70
| | | | | | | | | BUG=60211 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=64960 Review URL: http://codereview.chromium.org/4222005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65075 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 64960 - Turn on file access checks on Win.rafaelw@chromium.org2010-11-031-70/+0
| | | | | | | | | | BUG=60211 Review URL: http://codereview.chromium.org/4222005 TBR=jam@chromium.org Review URL: http://codereview.chromium.org/4431001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64974 0039d316-1c4b-4281-b951-d872f2087c98
* Turn on file access checks on Win.jam@chromium.org2010-11-031-0/+70
| | | | | | | BUG=60211 Review URL: http://codereview.chromium.org/4222005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64960 0039d316-1c4b-4281-b951-d872f2087c98
* Reland r62959 without the changes to histogram.cc, in hopes it won't break ↵pkasting@chromium.org2010-10-191-17/+11
| | | | | | | | | | | | | | | | | | tab_switching_test, and without the changes to tools_sanity_unittest.cc, which have already been relanded separately. TBR=timsteele Original changelog message: Convert LOG(INFO) to VLOG(1) - base/. Also removes an "else" after "return" and aligns "<<" per style guide. BUG=none TEST=none Review URL: http://codereview.chromium.org/3850007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63009 0039d316-1c4b-4281-b951-d872f2087c98
* ** Think this may have caused TabSwitchingTest to fail, as it is parsing log ↵tim@chromium.org2010-10-181-11/+17
| | | | | | | | | | | | | | | | | files. ** Revert 62959 - Convert LOG(INFO) to VLOG(1) - base/. Also removes an "else" after "return" and aligns "<<" per style guide. BUG=none TEST=none Review URL: http://codereview.chromium.org/3845002 TBR=pkasting@chromium.org Review URL: http://codereview.chromium.org/3850006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62981 0039d316-1c4b-4281-b951-d872f2087c98
* Convert LOG(INFO) to VLOG(1) - base/.pkasting@chromium.org2010-10-181-17/+11
| | | | | | | | | | Also removes an "else" after "return" and aligns "<<" per style guide. BUG=none TEST=none Review URL: http://codereview.chromium.org/3845002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62959 0039d316-1c4b-4281-b951-d872f2087c98
* Move pe_image and registry from base to base/win and use the namespace. It ↵brettw@chromium.org2010-10-171-2/+2
| | | | | | | | | | | | removes windows_message_list which isn't used. This keeps a stub for registry in the old location until we can update that. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/3836005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62888 0039d316-1c4b-4281-b951-d872f2087c98
* Move the windows-specific scoped_* stuff from base to base/win and in the ↵brettw@chromium.org2010-10-161-28/+28
| | | | | | | | | | | | | | | | base::win namespace. This keeps old headers that forward to the new versions and have using declarations that allow the existing code to compile. I fixed all the callers in base to use the new ones, and also the other files I happened to touch. This splits out the stuff from scoped_handle into a few separate files. I just deleted ScopedFindFile since it was only used in one place and it wasn't even really helping there. I removed StackBstr which was a #define and used the "regular" ScopedBstr in the 7 places that used it. This is an optimization to avoid an extra allocation, but none of the callers are remotely performance critical. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/3781009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62843 0039d316-1c4b-4281-b951-d872f2087c98
* Properly check CreateFileMapping's return value.tony@chromium.org2010-10-161-1/+1
| | | | | | | | | | According to MSDN, NULL is returned on error, not INVALID_FILE_HANDLE. BUG=58056 Review URL: http://codereview.chromium.org/3760008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62824 0039d316-1c4b-4281-b951-d872f2087c98
* Remove call to std::min since this check is already done intony@chromium.org2010-10-151-6/+2
| | | | | | | | histograms.h. Review URL: http://codereview.chromium.org/3769006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62762 0039d316-1c4b-4281-b951-d872f2087c98
* Move windows version-related stuff out of base/win_util and into ↵brettw@chromium.org2010-10-151-6/+7
| | | | | | | | | | | | | | base/win/windows_version. Many files now only need to include this instead of all of win_util. Remove a bunch of unused code from base/win_util. There was a surprising amount. Replace the AppUserModel property key with the one from the SDK now that we use the Win7 SDK. Move GetLogonSessionOnlyDACL from win_util to ipc since it's only used in that one place. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/3823002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62694 0039d316-1c4b-4281-b951-d872f2087c98
* Un-recursify FileEnumerator::Next().dumi@chromium.org2010-10-141-51/+52
| | | | | | | | | | 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
* Move Stats, histograms, and field trial into a metrics subdirectory of base andbrettw@chromium.org2010-10-141-1/+1
| | | | | | | | | put them in the base namespace. TEST=it compiles BUG=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62510 0039d316-1c4b-4281-b951-d872f2087c98
* Add histograms to see if we can find out why we're failingtony@chromium.org2010-10-071-1/+15
| | | | | | | | | | to load resources.pak on Windows. BUG=58056 Review URL: http://codereview.chromium.org/3616007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61818 0039d316-1c4b-4281-b951-d872f2087c98
* Fail to create a directory if there is a file in the path to be created.skerner@chromium.org2010-09-271-0/+1
| | | | | | | | | BUG=None TEST=None Review URL: http://codereview.chromium.org/3444023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60657 0039d316-1c4b-4281-b951-d872f2087c98
* Remove logging for issue 35198.skerner@chromium.org2010-09-241-45/+8
| | | | | | | | | | | 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-9/+0
| | | | | | | | | 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-0/+9
| | | | | | | | | | | | 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-9/+0
| | | | | | | | | | | 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-2/+4
| | | | | | | | | | | | 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
* Fixes warm-start performance on Vista and Win7 when using pre-reading ↵slightlyoff@chromium.org2010-08-041-16/+57
| | | | | | | | | | | optimization. Avg times go from ~500ms to ~300ms. TEST=run chrome_frame_perftests.exe --gtest_filter=*X.PerfWarm on Vista/Win7 and XP. Note that warm starts are now faster on Vista and unchanged on XP. BUG=45510 Review URL: http://codereview.chromium.org/3058023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54934 0039d316-1c4b-4281-b951-d872f2087c98
* Factor out NormalizeToNativeFilePath from NormalizeFilePathcpu@chromium.org2010-08-041-42/+38
| | | | | | | | | | | | - 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
* Add #include utf_string_conversions.h to all files that use ASCIIToWide andbrettw@chromium.org2010-08-031-0/+1
| | | | | | | | | | | | | | | ASCIIToUTF16. I removed string_util includes from a few places where it obviously wasn't needed. In a separate pass, I'm going to remove ASCIITo* from string_util, then I'm going to do an even later pass to find the unnecessary string_util.h includes and remove them. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/3058027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54746 0039d316-1c4b-4281-b951-d872f2087c98
* Fix incorect tests against INVALID_FILE_HANDLE, as pointed out by cpu on ↵skerner@chromium.org2010-08-031-2/+2
| | | | | | | | | | | chrome-team. BUG=NONE TEST=FileUtilTest.NormalizeFilePath* Review URL: http://codereview.chromium.org/3031041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54701 0039d316-1c4b-4281-b951-d872f2087c98
* Move the number conversions from string_util to a new file.brettw@chromium.org2010-07-301-2/+3
| | | | | | | | | | | | | Use the base namespace in the new file. Update callers. I removed all wstring variants and also the string->number ones that ignore the return value. That encourages people to write code and forget about error handling. TEST=included unit tests BUG=none Review URL: http://codereview.chromium.org/3056029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54355 0039d316-1c4b-4281-b951-d872f2087c98
* Give a better error when extension unpacking can't be done.skerner@chromium.org2010-07-301-3/+4
| | | | | | | | | | | The sandbox can not allow file access to paths that contain reparse points. Chrome tries to find a reparse point free path to the directory which will be sandboxed for extension unpacking. However, there are cases where there is no such path. See the bug for an example. In this case, give a decent error message. BUG=49530 TEST=Manually created a partition mounted in C:/mnt, mounted as drive letter, and mounted only under /Devices/HardDisk3/, tried unpacking extensions in each. Review URL: http://codereview.chromium.org/3060026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54327 0039d316-1c4b-4281-b951-d872f2087c98
* Remove some debug switches:skerner@chromium.org2010-07-301-69/+2
| | | | | | | | | | | | | | --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
* Changing the pre-reading of chrome.dll to read it as an image section ↵ananta@chromium.org2010-07-031-0/+25
| | | | | | | | | | | | | | | | | | | 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