summaryrefslogtreecommitdiffstats
path: root/base/file_util_win.cc
Commit message (Collapse)AuthorAgeFilesLines
* Change default fopen() on Windows from fopen_s() to fsopen(,,_SH_DENYNO).dpranke@chromium.org2010-03-051-10/+2
| | | | | | | | | | | | | | | | fopen_s() won't let you open a file that is open by another process. This has the unfortunate property of triggering a race condition in Python exposed by running run-webkit-tests using a lot of threads and spawning off image_diff. There doesn't seem to be a good reason to disallow files that are open in other processes, so I'm changing this. BUG=none TEST=run_webkit_tests doesn't produce "image_diff: can't open file" errors R=darin@chromium.org Review URL: http://codereview.chromium.org/668022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40710 0039d316-1c4b-4281-b951-d872f2087c98
* Fix app shortcut mess up per issue 31789xiyuan@chromium.org2010-02-231-0/+8
| | | | | | | | | | | | | | | | | | Issue 31789 is caused by a longer than MAX_PATH chars web app description. Fix it by limiting the description string size to MAX_PATH. Note: 1. MSDN mentions that the size limitation for Win2000 or later is INFOTIPSIZE but the limit on my vista dev machine is MAX_PATH. <http://msdn.microsoft.com/en-us/library/bb774955(VS.85).aspx> 2. The size limit includes the terminating NULL. BUG=31789 TEST=Verify fix for issue 31789. facebook.com has a 261-char description and chromium should be able to create a working shortcut for it. Review URL: http://codereview.chromium.org/650186 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39686 0039d316-1c4b-4281-b951-d872f2087c98
* Actually delete databases in CookiesTreeModel.jochen@chromium.org2010-02-181-1/+11
| | | | | | | | | 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-0/+5
| | | | | | | | | 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
* Ensure existing user pinned chrome shortcuts have correct app id.xiyuan@chromium.org2010-01-131-1/+1
| | | | | | | | | | | On Win7, check if user has pinned chrome shortcuts and ensure they have correct app id. BUG=28104 TEST=On Win7, install chrome prior 4.0.266.0 and pin chrome shortcut (browser with default profile, browser with non-default profile, web apps etc). Then update to a version with this fix. After update, running chrome should not have duplicate icon spawned. Review URL: http://codereview.chromium.org/548008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36193 0039d316-1c4b-4281-b951-d872f2087c98
* Fix an error when calling ReplaceFile for files on a Windows file share.phajdan.jr@chromium.org2010-01-111-6/+13
| | | | | | | | | | | | Add debugging code to get more info about further issues I couldn't reproduce and fix yet. TEST=none BUG=19607 Review URL: http://codereview.chromium.org/541004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35934 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a regression introduced by r33225.huanr@chromium.org2009-12-171-1/+5
| | | | | | | | | | | | On windows, if CreateDirectory is called with an path on an inaccessible drive, it will enter an infinite loop. BUG=30415 TEST=base_unittests.exe --gtest_filter=FileUtilTest.CreateDirectoryTest Review URL: http://codereview.chromium.org/500075 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34871 0039d316-1c4b-4281-b951-d872f2087c98
* Improve unit tests to verify that directories are listed before files in ↵vandebo@chromium.org2009-12-111-0/+4
| | | | | | | | | | | | | 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
* file_util: The member variable |pattern_| has a different type (FilePath) ↵thestig@chromium.org2009-12-081-2/+2
| | | | | | | | | | | | | | | 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
* Add support for 64-bit Windows build: base and chrome/appgregoryd@google.com2009-12-041-1/+3
| | | | | | | | | | | This is required to support Native Client on 64-bit Windows. Native Client will use a small 64-bit executable to load NaCl modules on 64-bit Windows. This 64-bit executable will use Chrome code, but some functionality has to be removed to minimize dependencies. This functionality may be enabled later if we decide that it is necessary. TEST=None BUG=28176 Review URL: http://codereview.chromium.org/371073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33823 0039d316-1c4b-4281-b951-d872f2087c98
* Fix race in directory creation on Windows. Thejoi@chromium.org2009-11-271-3/+38
| | | | | | | | | | | | | | | | | | | | | | | | file_util::CreateDirectory() function is supposed to succeed if the directory already exists, but in the previous implementation when two processes/threads called the function at the same time for the same path, one would see a failure. Also, get rid of the use of SHCreateDirectoryEx function. For one, it is highly serializing because it calls SHChangeNotify. The race was actually easy to reproduce by starting two instances of Chrome both at the same time, with a profile directory flag indicating a profile directory that did not previously exist. For another, SHCreateDirectoryEx would fail with ERROR_CANCELLED if any of the path components were not visible, according to its MSDN documentation. BUG=none TEST=[base_unittests.exe --gtest_filter=*CreateDirectory* ], and/or install Chrome Frame on a fresh machine and make sure the first page you navigate to has two Chrome Frame instances on it - you should get no DCHECK on failure of PathService::Override Review URL: http://codereview.chromium.org/437090 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33225 0039d316-1c4b-4281-b951-d872f2087c98
* For now, let's clear local storage whenever we clear cookies.jorlow@chromium.org2009-11-261-0/+7
| | | | | | | | 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
* Set prop app id for chromium/application shortcut.xiyuan@chromium.org2009-11-191-80/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow up change after andrew's patch for win7 shortcut to properly set app id for chromium/application shortcut. - Move PKEY_AppUserModel_ID and code to set it from app/win_util.cc to base/win_util.cc as SetAppIdForPropertyStore to share with file_util shortcut code; - Add an app_id args to file_util's CreateShortcutLink and UpdateShortcutLink; - Update code that calls the above two function in installer and UserDataManager so that the chromium shortcuts are created with proper app id (except the uninstall shortcut which is not tagged with any app id). - Move ComputeApplicationNameFromURL from Browser to web_app namespace and use it as app id for application shortcut. This makes pinned shortcut and browser window use the same app id and Win7 correctly groups them; - Rename ComputeApplicationNameFromURL to GenerateApplicationNameFromURL per Ben's comments; - Add a DCHECK in SetAppIdForPropertyStore to ensure app id is less than 128 chars and contains no space per msdn; - Change default app id from IDS_PRODUCT_NAME to chrome::kBrowserAppName BUG=28104 TEST=On Win7, pinned shortcut should no longer be separated from running instance of chrome for both chrome and web application. Review URL: http://codereview.chromium.org/399045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32508 0039d316-1c4b-4281-b951-d872f2087c98
* Implement web app shortcuts natively per issue 25528xiyuan@chromium.org2009-11-171-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Implement a CreateApplicationShortcutView similar to the current Gears-based one; - Add a few profile prefs to persist user's last checked shortcut locations - Implement a web_app::CreateShortcut that stores icon under "<profile>/Web Applications" in a similar layout as gears (i.e. <host>/<scheme_port>/<web_app_title>.ico) and calls file_util code to creates shortcut on Windows; - Add Win7 taskbar pin/unpin support function to file_util; - Update TabContents to replace gears with new code; Note: - Gears dialog is modaless but this one is a modal dialog. - Gear's icon store is not migrated because gears icons could still be used by shortcuts created by gears and thus we could not delete them even after migration. And we are not using the local ico files in the dialog even if they exists. - New CreateApplicationShortcutView is included when TOOLKIT_VIEW is defined. However on platforms other than Windows, the actual CreateShortCut code is not implemented. Right now it calls ShellIntegration's CreateDesktopShort if OS_LINUX is defined and NOTREACHED() for other platforms. BUG=25528 TEST=Verify the new UI provides the same functionality as gears under XP/Vista and support pinning on Win 7. Review URL: http://codereview.chromium.org/372012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32165 0039d316-1c4b-4281-b951-d872f2087c98
* reland 31875. Revert was:estade@chromium.org2009-11-161-4/+1
| | | | | | | | | | | | | | ------ Revert 31875 to see whether it fixes reliability bot. BUG=25677 TEST=None ------ TBR=huanr Review URL: http://codereview.chromium.org/397017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32112 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 31875 to see whether it fixes reliability bot.huanr@chromium.org2009-11-161-1/+4
| | | | | | | | | BUG=25677 TEST=None Review URL: http://codereview.chromium.org/397014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32074 0039d316-1c4b-4281-b951-d872f2087c98
* Use renderer spellchecker for windows.estade@chromium.org2009-11-131-4/+1
| | | | | | | BUG=25677 Review URL: http://codereview.chromium.org/372075 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31875 0039d316-1c4b-4281-b951-d872f2087c98
* Remove file_util::TrimTrailingSeparators(), which is deprecated andtkent@chromium.org2009-10-151-4/+2
| | | | | | | | | | doesn't work well for Windows root drives. BUG=24722 TEST=existing tests are enough. Review URL: http://codereview.chromium.org/271086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29093 0039d316-1c4b-4281-b951-d872f2087c98
* More CopyDirectory tests and fixesvandebo@chromium.org2009-10-151-0/+3
| | | | | | | | | BUG=themes stopped working on Linux and Mac TEST=unittests Review URL: http://codereview.chromium.org/269083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29076 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes a bug that .crx can not be installed by "Could not createtkent@chromium.org2009-10-091-3/+1
| | | | | | | | | | | directory for unzipping." in the case that the environment variable TMP is set to a root directory of a drive such as "C:\" TEST=Add new tests to base_unittest BUG=23911 Review URL: http://codereview.chromium.org/257061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28529 0039d316-1c4b-4281-b951-d872f2087c98
* Remove uses of deprecated version of FileUtil::ResolveShortcut.evan@chromium.org2009-08-251-7/+0
| | | | | | | | | | BUG=None TEST=run base_unittests.exe Review URL: http://codereview.chromium.org/173181 Patch from Thiago Farina <thiago.farina@gmail.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24208 0039d316-1c4b-4281-b951-d872f2087c98
* Renames the function CreateTemporaryFilename to CreateTemporaryFile and ↵erikkay@chromium.org2009-08-181-12/+12
| | | | | | | | | | | | | | track down all callers, also removes the deprecated function that uses std::wstring. BUG=3078 (http://crbug.com/3078) TEST=run base_unittests, installer_util_unittests, net_unittests, setup_unittests, and unit_tests. Review URL: http://codereview.chromium.org/164537 Patch from Thiago Farina. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23631 0039d316-1c4b-4281-b951-d872f2087c98
* Adding last modified time to file_utilbrettw@chromium.org2009-07-241-0/+2
| | | | | | | | | Original review: http://codereview.chromium.org/160050 Patch by dhg@google.com Review URL: http://codereview.chromium.org/159347 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21533 0039d316-1c4b-4281-b951-d872f2087c98
* Include a parent directory link in the file list for file:///somepathyuzo@chromium.org2009-06-091-4/+8
| | | | | | | | | | | | | | | Also, order files/directories lexicographically. TEST=on linux, type file:///usr/ in the address bar and make sure the contents are sorted and include an entry for '..', which is [parent directory]. On windows, type file:///C:/Users/ . BUG=12621, 12812 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17933 0039d316-1c4b-4281-b951-d872f2087c98
* Removes the following deprecated functions:ojan@chromium.org2009-06-031-17/+0
| | | | | | | | | | | | | | | | file_util::InsertBeforeExtension(wstring*, wstring&) file_util::PathComponents(wstring&, vector<wstring>*) file_util::ReplaceExtension(wstring*, wstring&) BUG=none TEST=manual test for importing IE bookmarks with some sub-directories. Original patch by tkent@google.com. See http://codereview.chromium.org/118109 r=ojan,estade git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17469 0039d316-1c4b-4281-b951-d872f2087c98
* Add file_util::ReplaceFile and use it in ImportantFileWriter.phajdan.jr@chromium.org2009-05-191-0/+12
| | | | | | | | | | It has more strict semantics than file_util::Move. http://crbug.com/11585 Review URL: http://codereview.chromium.org/113207 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16386 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Add file_util::ReplaceFile and use it in ImportantFileWriter."phajdan.jr@chromium.org2009-05-181-12/+0
| | | | | | | | | | http://crbug.com/11585 TBR=stoyan Review URL: http://codereview.chromium.org/113534 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16296 0039d316-1c4b-4281-b951-d872f2087c98
* Add file_util::ReplaceFile and use it in ImportantFileWriter.phajdan.jr@chromium.org2009-05-181-0/+12
| | | | | | | | | | It has more strict semantics than file_util::Move. http://crbug.com/11585 Review URL: http://codereview.chromium.org/113207 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16291 0039d316-1c4b-4281-b951-d872f2087c98
* ImportantFileWriterphajdan.jr@chromium.org2009-04-281-8/+12
| | | | | | | | | | | | | | Introducing a class for writing important files, preventing their corruption during writing. Switched PrefService to use it. Other classes will be switched in future changesets. TEST=This may affect things using preferences. Make sure that changes in preferences don't get lost, and that you don't get excessive disk activity when changing preferences. http://crbug.com/10618 Review URL: http://codereview.chromium.org/83001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14717 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 14152.thestig@chromium.org2009-04-211-4/+6
| | | | | | | TBR=tony Review URL: http://codereview.chromium.org/87066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14154 0039d316-1c4b-4281-b951-d872f2087c98
* Stop using and remove deprecated file_util::TrimTrailingSeparator().thestig@chromium.org2009-04-211-6/+4
| | | | | | Review URL: http://codereview.chromium.org/67271 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14152 0039d316-1c4b-4281-b951-d872f2087c98
* Retrial of the first step to port file_util::CountFilesCreatedAfter()erikkay@google.com2009-04-181-4/+7
| | | | | | | | | Submitting http://codereview.chromium.org/75033 on behalf of hamaji Review URL: http://codereview.chromium.org/67276 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13993 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 13748.erikkay@google.com2009-04-151-7/+4
| | | | | | Review URL: http://codereview.chromium.org/73084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13751 0039d316-1c4b-4281-b951-d872f2087c98
* Submitting http://codereview.chromium.org/73075 on behalf of ↵erikkay@google.com2009-04-151-4/+7
| | | | | | | | shinichiro.hamaji@gmail.com Review URL: http://codereview.chromium.org/73083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13748 0039d316-1c4b-4281-b951-d872f2087c98
* First pass of refactoring dialogs.avi@chromium.org2009-04-061-2/+9
| | | | | | Review URL: http://codereview.chromium.org/60110 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13168 0039d316-1c4b-4281-b951-d872f2087c98
* file_util::Move fails on Windows if moving a directoryhuanr@chromium.org2009-03-111-2/+25
| | | | | | | | | | | across volumes. This change adds a CopyAndDeleteDirectory function, and Move falls back to CopyAndDeleteDirectory if moving directory fails. BUG=8505 Review URL: http://codereview.chromium.org/43069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11460 0039d316-1c4b-4281-b951-d872f2087c98
* Properly honor base::SharedMemory semantics for name="" to meanjrg@chromium.org2009-02-041-0/+20
| | | | | | | | | | | | new/private shared memory on POSIX. Transition base::SharedMemory implementation to file/mmap() to prevent leaking of wired kernel resources and allow easier cleanup. Enable one more shared_memory unit test for POSIX. Enable stats_table_unittest.cc for Mac, and modify it so it cleans up. Review URL: http://codereview.chromium.org/19724 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9114 0039d316-1c4b-4281-b951-d872f2087c98
* Safe browsing cleanup:estade@chromium.org2009-01-281-8/+8
| | | | | | | | | * wstring -> FilePath * create versions of WriteFile/ReadFile with FilePath signatures Review URL: http://codereview.chromium.org/19610 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8797 0039d316-1c4b-4281-b951-d872f2087c98
* FileUtilTest.Contains failed on Vista Home 64 (and wine)dkegel@google.com2009-01-271-4/+7
| | | | | | | | | because deleting an empty directory tree fails there with ERROR_FILE_NOT_FOUND, so allow that return value. Review URL: http://codereview.chromium.org/18830 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8733 0039d316-1c4b-4281-b951-d872f2087c98
* Convert download manager to FilePath.estade@chromium.org2009-01-061-5/+4
| | | | | | | | (Fixed up version of issue 17032. Now passes all unit tests.) Review URL: http://codereview.chromium.org/16533 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7630 0039d316-1c4b-4281-b951-d872f2087c98
* Keep trying to undo 7564.estade@chromium.org2009-01-051-0/+1
| | | | | | | | tbr=jhawkins Review URL: http://codereview.chromium.org/17062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7572 0039d316-1c4b-4281-b951-d872f2087c98
* Unbreak unit tests. Revert r7564.estade@chromium.org2009-01-051-1/+0
| | | | | | | | tbr=jhawkins Review URL: http://codereview.chromium.org/16522 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7571 0039d316-1c4b-4281-b951-d872f2087c98
* file_util minor cleanup:erikkay@google.com2008-12-231-10/+10
| | | | | | | | | | * add POSIX version of IsPathWritable * convert IsPathWritable to FilePath * convert CreateNewTempDirectory to FilePath * fix a bug where recursive delete errors weren't being handled in POSIX Review URL: http://codereview.chromium.org/16241 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7430 0039d316-1c4b-4281-b951-d872f2087c98
* revert r6938estade@chromium.org2008-12-121-21/+1
| | | | | | | (i.e. reapply 6935, with fix) Review URL: http://codereview.chromium.org/14087 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6953 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting 6935.ojan@google.com2008-12-121-1/+21
| | | | | | | Broke compile Review URL: http://codereview.chromium.org/14083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6938 0039d316-1c4b-4281-b951-d872f2087c98
* Implement the memory mapped file class for posix.estade@chromium.org2008-12-121-21/+1
| | | | | | Review URL: http://codereview.chromium.org/14073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6935 0039d316-1c4b-4281-b951-d872f2087c98
* Add a MemoryMappedFile class to file_util.estade@chromium.org2008-12-121-1/+65
| | | | | | | | Factor out windowisms from the spell checker. Review URL: http://codereview.chromium.org/14041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6919 0039d316-1c4b-4281-b951-d872f2087c98
* Move file enumeration to filepaths.avi@google.com2008-12-111-18/+17
| | | | | | Review URL: http://codereview.chromium.org/13315 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6784 0039d316-1c4b-4281-b951-d872f2087c98
* Get rid of kPathSeparator on windows. Port some wstring function to take ↵estade@chromium.org2008-12-041-57/+18
| | | | | | | | FilePaths. Re-enable relevant posix unit tests. Review URL: http://codereview.chromium.org/12893 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6387 0039d316-1c4b-4281-b951-d872f2087c98