summaryrefslogtreecommitdiffstats
path: root/base/file_path.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fix file_path build.brettw@chromium.org2010-07-311-2/+2
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54458 0039d316-1c4b-4281-b951-d872f2087c98
* Fix Windows build by qualifying the namespace.brettw@chromium.org2010-07-311-2/+3
| | | | | | | TEST=none BUG=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54457 0039d316-1c4b-4281-b951-d872f2087c98
* Treat multiple extensions like .tar.gz as a single extension.estade@chromium.org2010-07-271-56/+96
| | | | | | | | | | | The logic is taken from firefox. BUG=48346 TEST=unit tests; downloading the same .tar.gz file multiple times (see bug) Review URL: http://codereview.chromium.org/3018011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53844 0039d316-1c4b-4281-b951-d872f2087c98
* Remove more definitions from header files.erg@chromium.org2010-07-161-0/+17
| | | | | | | | | | | This patch only concerns itself with places where we have more than 100 copies of methods being generated. (For example, the destructor and other random methods in FilePath weren't being inlined, leading to several hundred copies being generated.) BUG=none TEST=none Review URL: http://codereview.chromium.org/3039001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52694 0039d316-1c4b-4281-b951-d872f2087c98
* Add a method for normalizing path separators on Windows.tony@chromium.org2010-06-251-0/+9
| | | | | | | | TEST=new unittests Review URL: http://codereview.chromium.org/2831029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50822 0039d316-1c4b-4281-b951-d872f2087c98
* Support reordering of Browser Actions within the container. Currently does ↵finnur@chromium.org2010-02-031-1/+39
| | | | | | | | | | | | | | not support dragging to/from the chevron menu. Also fixed two bugs in the same code: - the container would be 0 width if a value for it hasn't been saved (part of bug 32101). - the default icon was not used when a tab specific icon was not found (bug 34317). BUG=http://crbug.com/26990, http://crbug.com/32101, http://crbug.com/34317 TEST=In both LTR and RTL locale, try reordering the browser actions and make sure to test dragging to the ends with and without a chevron visible. Install Send to Gmail extension and make sure it has an icon while in the overflow menu. Review URL: http://codereview.chromium.org/549224 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37922 0039d316-1c4b-4281-b951-d872f2087c98
* Get rid of FilePath::AppendAndResolveRelative().mad@chromium.org2009-10-281-69/+0
| | | | | | | | | | | | | | To resolve the problem of '..' parent references as well as symbolic links on POSIX platforms, we can simply use the file_util::AbsolutePath() function. This has the drawback of having a different behavior on Windows and POSIX platforms, in the way that it can return a canonical path that doesn't exists when ran on Windows, but it will return an empty path (or false) when run on a POSIX platform. So we need to add an extra PathExists() call to unify the behavior. BUG=25681,25131 Review URL: http://codereview.chromium.org/343003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30334 0039d316-1c4b-4281-b951-d872f2087c98
* Fix for bug 10876 that resulted in some refactoring:rolandsteiner@chromium.org2009-10-281-4/+606
| | | | | | | | | | | | | | | | | | | | | The bug originates from extensions being treated case sensitive on Windows and Mac OSX, where they shouldn't be. Therefore I added generic static methods to FilePath to compare strings in the same way the file system does, and changed the relevant parts of the code to make use of them. I tested the methods under Windows and Mac OS X. I also wrote a basic version for Linux/Posix that behaves the same way as the original code, so there should at least be no regression. Also, while fixing this I found some confusion in the code about whether extensions are used with or without leading dot. For this reason I changed some functions that were taking an extension as parameter to instead take the whole file path. This makes calling these functions easier and the caller doesn't need to know whether the extension is supposed to be with or without dot. In the same vein, I split DownloadManager::IsExecutable into IsExecutableFile, where one again passes in the whole file and doesn't have to worry about getting the extension right, and IsExecutableExtension, which corresponds to the original functionality. Ideally only the former method should be public, but that again would have required further code scrubbing that was (even more) outside of the original bug fix. Finally, fixed a wrong comment in the file path tests. BUG=10876 TEST=FilePathTest.MatchesExtension, .CompareIgnoreCase Review URL: http://codereview.chromium.org/149796 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30323 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 30168 - Commit patch set from http://codereview.chromium.org/149796rolandsteiner@chromium.org2009-10-271-606/+4
| | | | | | | | | | | | | (see discussion and history there) BUG=10876 TEST=FilePathTest.MatchesExtension.CompareIgnoreCase TBR=rolandsteiner@chromium.org Review URL: http://codereview.chromium.org/337042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30170 0039d316-1c4b-4281-b951-d872f2087c98
* Commit patch set from http://codereview.chromium.org/149796rolandsteiner@chromium.org2009-10-271-4/+606
| | | | | | | | | | (see discussion and history there) BUG=10876 TEST=FilePathTest.MatchesExtension.CompareIgnoreCase git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30168 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 30149 - The existing file_util::AbsolutePath() function was already ↵tim@chromium.org2009-10-271-0/+69
| | | | | | | | | | | | | doing what we needed to do in the ExtensionResource class. BUG= http://crbug.com/25681 & http://crbug.com/25131 Review URL: http://codereview.chromium.org/334028 TBR=mad@chromium.org Review URL: http://codereview.chromium.org/335042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30152 0039d316-1c4b-4281-b951-d872f2087c98
* The existing file_util::AbsolutePath() function was already doing what we ↵mad@chromium.org2009-10-271-69/+0
| | | | | | | | | | needed to do in the ExtensionResource class. BUG= http://crbug.com/25681 & http://crbug.com/25131 Review URL: http://codereview.chromium.org/334028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30149 0039d316-1c4b-4281-b951-d872f2087c98
* Minimize dependency of user scripts.mad@chromium.org2009-10-201-2/+69
| | | | | | | | | | | And made some minor lint fixes and code refactoring on the way, based on CR comments of previous attempt. BUG=none TEST=Make sure that the extension resources can still be properly localized and that they also load correctly when they are not localized. Review URL: http://codereview.chromium.org/267051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29512 0039d316-1c4b-4281-b951-d872f2087c98
* Set OS X cache directory to ~/Library/Caches/[app name]/[profile name] mark@chromium.org2009-09-161-0/+10
| | | | | | | | | | | | | - Added implementation of GetUserCacheDirectory() for OS X. - Added FilePath::GetRelativePath(). - Implemented per-profile cache directories for OS X. Patch by Fred Akalin <akalin@gmail.com> Code review URL: http://codereview.chromium.org/174053 Review URL: http://codereview.chromium.org/204043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26387 0039d316-1c4b-4281-b951-d872f2087c98
* Move StringPiece into the base namespace. It is collidingtony@chromium.org2009-09-101-2/+3
| | | | | | | | | | with the StringPiece class in icu4.2, which is a problem when trying to use the system version of icu. Review URL: http://codereview.chromium.org/193072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25920 0039d316-1c4b-4281-b951-d872f2087c98
* Add "bool FilePath::ReferencesParent()" which adds a clean & simple way forcevans@chromium.org2009-08-151-0/+14
| | | | | | | | | | | | checking for ".." in a FilePath. Needed to make an upcoming security fix clean. BUG=NONE TEST=FilePathTest.ReferencesParent Review URL: http://codereview.chromium.org/172012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23528 0039d316-1c4b-4281-b951-d872f2087c98
* Reliability test porting: stringy stuff.estade@chromium.org2009-08-131-0/+9
| | | | | | | | | No functional change. This gets things compiling on linux, but it still needs some work before it can be run on linux. BUG=19085 Review URL: http://codereview.chromium.org/164352 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23272 0039d316-1c4b-4281-b951-d872f2087c98
* Fix few trivial Coverity issues, mainly PASS_BY_VALUE.phajdan.jr@chromium.org2009-07-061-1/+1
| | | | | | Review URL: http://codereview.chromium.org/155022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19974 0039d316-1c4b-4281-b951-d872f2087c98
* make FilePath:IsParent use case-insensitive compare for drive letters on windowsrafaelw@chromium.org2009-07-011-0/+52
| | | | | | | | | R=erikkay BUG=15659 Review URL: http://codereview.chromium.org/150109 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19694 0039d316-1c4b-4281-b951-d872f2087c98
* Allow extension extensions to be case-insensitive.avi@chromium.org2009-06-291-0/+12
| | | | | | | | | BUG=none TEST=try to load an extension with a capital letter or two in the extension's extension. It should load. Review URL: http://codereview.chromium.org/147017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19520 0039d316-1c4b-4281-b951-d872f2087c98
* Move PathComponents from file_util to FilePath, add FilePath::IsParent()rafaelw@chromium.org2009-06-241-0/+72
| | | | | | | | r=erikkay,mark Review URL: http://codereview.chromium.org/145026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19174 0039d316-1c4b-4281-b951-d872f2087c98
* Move a few functions commonly called with char* to StringPiece.deanm@chromium.org2009-05-291-2/+2
| | | | | | | | | | | In some cases this will avoid the implicit char* -> std::string conversion, object creation, and string copying. One of the biggest benefit is on Windows, where we can save some conversions in FilePath::AppendASCII. Review URL: http://codereview.chromium.org/113996 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17182 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGE (except one global std::wstring changed to const wchar_t* ↵maruel@chromium.org2009-03-031-1/+1
| | | | | | | | | | | const per style compliance). Preliminary work to enforce new PRESUBMIT.py rules: - <=80 cols - no trailing whitespaces - svn:eol-style=LF git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10791 0039d316-1c4b-4281-b951-d872f2087c98
* Adds AppendASCII which will append an ASCII path component.erikkay@google.com2009-01-211-0/+9
| | | | | | | | Since this is safe to do on all platform path encodings (even Linux), this allows path components to be taken from ASCII sources without #ifdefs for the caller. Review URL: http://codereview.chromium.org/18134 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8394 0039d316-1c4b-4281-b951-d872f2087c98
* Move Contains() method to file_utils, stop relying on in extensions_protocolaa@chromium.org2009-01-091-26/+0
| | | | | | Review URL: http://codereview.chromium.org/16805 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7841 0039d316-1c4b-4281-b951-d872f2087c98
* Add implementations of various extension related methods (derived from ↵erikkay@google.com2009-01-091-4/+81
| | | | | | | | | | | | file_util): Extension, RemoveExtension, InsertBeforeExtension, ReplaceExtension I didn't reimplement the old file_util ones since they actually modify the FilePath in place, which isn't the style of the rest of the FilePath methods. I'll file a cleanup bug after this for callers to switch to the new methods. Review URL: http://codereview.chromium.org/17243 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7811 0039d316-1c4b-4281-b951-d872f2087c98
* Move plugins to FilePaths, some cleanupavi@google.com2009-01-061-1/+1
| | | | | | Review URL: http://codereview.chromium.org/16456 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7588 0039d316-1c4b-4281-b951-d872f2087c98
* Keep trying to undo 7564.estade@chromium.org2009-01-051-2/+2
| | | | | | | | 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-2/+2
| | | | | | | | 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
* Reverting 7423.erikkay@google.com2008-12-231-9/+0
| | | | | | | After talking with Darin, I'm convinced this was a bad idea. The issue is that Linux can't actually know the encoding of the file (bad Linux!), so on Linux this method is nonsensical. It also turns out to not be useful for the case I thought I needed it for. Review URL: http://codereview.chromium.org/16252 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7455 0039d316-1c4b-4281-b951-d872f2087c98
* Add a method to explicitly request a UTF8 representation of a FilePath. ↵erikkay@google.com2008-12-231-0/+9
| | | | | | | | This is for places where you need to use a FilePath in a non-filesystem context (for example, adding a file to an archive file, or constructing a file:// URL). Review URL: http://codereview.chromium.org/16239 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7423 0039d316-1c4b-4281-b951-d872f2087c98
* Rather than create a TODO that will never be done, I went ahead and ↵aa@chromium.org2008-12-181-0/+27
| | | | | | | | implemented FilePath::Contains(). Review URL: http://codereview.chromium.org/14827 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7208 0039d316-1c4b-4281-b951-d872f2087c98
* Move file enumeration to filepaths.avi@google.com2008-12-111-5/+12
| | | | | | Review URL: http://codereview.chromium.org/13315 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6784 0039d316-1c4b-4281-b951-d872f2087c98
* Make FilePath::Append accept FilePath parameter. Patch by Paweł Hajdan jrmark@chromium.org2008-12-081-29/+51
| | | | | | | | | <phajdan.jr@gmail.com> http://codereview.chromium.org/12907 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6511 0039d316-1c4b-4281-b951-d872f2087c98
* Backing out r6315 due to DirectoryWatcherTest.SubDir (base_unittests) failuremark@chromium.org2008-12-031-51/+29
| | | | | | | (again) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6316 0039d316-1c4b-4281-b951-d872f2087c98
* Make FilePath::Append accept FilePath parameter. Patch by Paweł Hajdan jrmark@chromium.org2008-12-031-29/+51
| | | | | | | | | <phajdan.jr@gmail.com> http://codereview.chromium.org/12907 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6315 0039d316-1c4b-4281-b951-d872f2087c98
* Backing out r6299 due to DirectoryWatcherTest.SubDir (base_unittests) failuremark@chromium.org2008-12-031-51/+29
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6304 0039d316-1c4b-4281-b951-d872f2087c98
* Make FilePath::Append accept FilePath parameter. Patch by Paweł Hajdan jrmark@chromium.org2008-12-031-29/+51
| | | | | | | | | <phajdan.jr@gmail.com> http://codereview.chromium.org/12907 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6299 0039d316-1c4b-4281-b951-d872f2087c98
* Remove file_util::kPathSeparator from posix.estade@chromium.org2008-11-271-4/+3
| | | | | | Review URL: http://codereview.chromium.org/12489 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6099 0039d316-1c4b-4281-b951-d872f2087c98
* Begin the first small step towards using FilePath everywhere:evanm@google.com2008-10-301-0/+28
| | | | | | | | | | - Add some transition APIs. - Start migrating some code to transition APIs. Review URL: http://codereview.chromium.org/8825 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4254 0039d316-1c4b-4281-b951-d872f2087c98
* Add a FilePath objectmark@chromium.org2008-10-031-0/+175
Review URL: http://codereview.chromium.org/6025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2838 0039d316-1c4b-4281-b951-d872f2087c98