summaryrefslogtreecommitdiffstats
path: root/base/path_service.cc
Commit message (Collapse)AuthorAgeFilesLines
* Move file_util to base/files/ directory.brettw@chromium.org2014-08-131-1/+1
| | | | | | | | | | | This updates the includes in base but leaves a forwarding header for the rest of the project for now. R=yzshen@chromium.org Review URL: https://codereview.chromium.org/468253002 Cr-Commit-Position: refs/heads/master@{#289360} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289360 0039d316-1c4b-4281-b951-d872f2087c98
* Enable Enterprise enrollment on desktop builds.joaodasilva@chromium.org2014-05-021-5/+10
| | | | | | | | | | | | | | | | | | | | | Note: this is a reland of https://codereview.chromium.org/258743005 This change implements some of the DBus stub methods so that enterprise enrollment works on desktop builds. That will make development of features that depend on enrollment faster for developers that use this workflow (e.g. for kiosk enterprise apps, public accounts, testing some device policies, etc). - Override some of the directories and files involved with the enrollment state - Simple stub implementation of the DBus calls involved - Write a persistent cache of the install attributes - Cleaned up the stub for user cloud policy and made them persistent too - Updated some tests This change doesn't affect production code. TBR=jochen@chromium.org BUG=240269, 367674 Review URL: https://codereview.chromium.org/264943011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267861 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of Enable Enterprise enrollment on desktop builds. ↵falken@chromium.org2014-05-021-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/258743005/) Reason for revert: It seems to have broken the following test from base_unittests and unit_tests on chromium.webkit Android Tests (dbg) builder: PathServiceTest.Override Log: http://build.chromium.org/p/chromium.webkit/builders/Android%20Tests%20%28dbg%29/builds/18922 Snippet from log: C 237s Main [FAIL] PathServiceTest.Override: C 237s Main ../../base/path_service_unittest.cc:184: Failure C 237s Main Value of: PathService::OverrideAndCreateIfNeeded(my_special_key, non_existent, false, false) C 237s Main Actual: true C 237s Main Expected: false Original issue's description: > Enable Enterprise enrollment on desktop builds. > > This change implements some of the DBus stub methods so that enterprise enrollment works on desktop builds. That will make development of features that depend on enrollment faster for developers that use this workflow (e.g. for kiosk enterprise apps, public accounts, testing some device policies, etc). > > - Override some of the directories and files involved with the enrollment state > - Simple stub implementation of the DBus calls involved > - Write a persistent cache of the install attributes > - Cleaned up the stub for user cloud policy and made them persistent too > - Updated some tests > > This change doesn't affect production code. > > TBR=jochen@chromium.org > BUG=240269, 367674 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=267640 TBR=brettw@chromium.org,nkostylev@chromium.org,pastarmovj@chromium.org,satorux@chromium.org,jochen@chromium.org,joaodasilva@chromium.org NOTREECHECKS=true NOTRY=true BUG=240269, 367674 Review URL: https://codereview.chromium.org/265013002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267761 0039d316-1c4b-4281-b951-d872f2087c98
* Enable Enterprise enrollment on desktop builds.joaodasilva@chromium.org2014-05-011-5/+10
| | | | | | | | | | | | | | | | | | | This change implements some of the DBus stub methods so that enterprise enrollment works on desktop builds. That will make development of features that depend on enrollment faster for developers that use this workflow (e.g. for kiosk enterprise apps, public accounts, testing some device policies, etc). - Override some of the directories and files involved with the enrollment state - Simple stub implementation of the DBus calls involved - Write a persistent cache of the install attributes - Cleaned up the stub for user cloud policy and made them persistent too - Updated some tests This change doesn't affect production code. TBR=jochen@chromium.org BUG=240269, 367674 Review URL: https://codereview.chromium.org/258743005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267640 0039d316-1c4b-4281-b951-d872f2087c98
* Move AppendFile and *CurrentDirectory to the base namespace.brettw@chromium.org2014-03-111-1/+1
| | | | | | | | | | This moves AppendFile, GetCurrentDirectory, and SetCurrentDirectory to the base namespace. TBR=jam Review URL: https://codereview.chromium.org/177923007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256309 0039d316-1c4b-4281-b951-d872f2087c98
* Move directory creation functions to base namespace.brettw@chromium.org2013-12-031-1/+1
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/100573002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238446 0039d316-1c4b-4281-b951-d872f2087c98
* Move PathExists to base namespace.brettw@chromium.org2013-07-111-1/+1
| | | | | | | | | BUG= TBR=jam@chromium.org Review URL: https://codereview.chromium.org/18286004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211147 0039d316-1c4b-4281-b951-d872f2087c98
* Rename base/hash_tables to base/containers/hash_tables.brettw@chromium.org2013-06-111-1/+1
| | | | | | | | | | | Remove forwarding header BUG= R=avi@chromium.org Review URL: https://codereview.chromium.org/16667019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205584 0039d316-1c4b-4281-b951-d872f2087c98
* Move path functions from file_util to FilePath object.brettw@chromium.org2013-04-121-8/+8
| | | | | | | | | | | | | | EnsureEndsWithSeparator used to check whether the file existed. This seems bad and unnecessary so I removed it. I removed file_util::ContainsPath and used the existing file_util::IsParent instead. The functions descriptions are the same but the implementations do slightly different things, which is worrying. The only non-test use of this function to worry about is content/browser/storage_partition_impl_map.cc. As far as I see, the requirements for this seem OK, but I'm not very familiar with this. After some discussion with akalin, I changed sync/internal_api/sync_manager_impl.cc to be a DCHECK that the path is absolute rather than make it absolute. The old code relied on the behavior of the old function that the argument would be unchanged if the file didn't exist, and this (possibly relative) path would be used later. This behavior doesn't make a lot of sense, and it looks like now that the path is always absolute, so I replaced this call with a DCHECK. BUG= Review URL: https://codereview.chromium.org/13196006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193855 0039d316-1c4b-4281-b951-d872f2087c98
* ifdef OS_NAME -> if defined(OS_NAME)dbeam@chromium.org2013-03-231-1/+1
| | | | | | | | | | | | ifndef OS_NAME -> if !defined(OS_NAME) BUG=none TEST=no regressions Review URL: https://chromiumcodereview.appspot.com/12545059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190069 0039d316-1c4b-4281-b951-d872f2087c98
* Move file_path.h to base/files.brettw@chromium.org2013-02-241-1/+1
| | | | | | TBR=sky git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184344 0039d316-1c4b-4281-b951-d872f2087c98
* Make base compile with no "using base::FilePath".brettw@chromium.org2013-02-161-0/+2
| | | | | | | | | | | | For base .cc files not using the base namespace, I added a using since theses files should be moved to the base namespace, and then explicit qualification will no longer be necessary. Original review URL: https://codereview.chromium.org/12226121 (reland of r182040). Review URL: https://codereview.chromium.org/12278014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182916 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 182032brettw@chromium.org2013-02-121-2/+0
| | | | | | | | | | | | | | | > Make base compile with no "using base::FilePath". > > For base .cc files not using the base namespace, I added a using since theses > files should be moved to the base namespace, and then explicit qualification > will no longer be necessary. > > Review URL: https://codereview.chromium.org/12226121 TBR=brettw@chromium.org Review URL: https://codereview.chromium.org/12207132 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182040 0039d316-1c4b-4281-b951-d872f2087c98
* Make base compile with no "using base::FilePath".brettw@chromium.org2013-02-121-0/+2
| | | | | | | | | | For base .cc files not using the base namespace, I added a using since theses files should be moved to the base namespace, and then explicit qualification will no longer be necessary. Review URL: https://codereview.chromium.org/12226121 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182032 0039d316-1c4b-4281-b951-d872f2087c98
* Disable cache in PathService.vitalybuka@chromium.org2013-01-291-3/+18
| | | | | | | | | | | | | | | Google Cloud Printer implements port monitor. It's DLL that loaded into windows Spooler service (spoolsv.exe). Port monitor saves printed document to temp file and then runs Chrome.exe to send this file to cloud print. spoolsv.exe always runs as SYSTEM, but threads that call port monitor is executed as user, that spooled print jobs. Port monitor should be able to find Chrome.exe for different user. Now port monitor uses chrome_launcher_support::GetAnyChromePath(), which uses PathService, is to find chrome. If cache is enabled, port monitor will always use paths generated for the first users. BUG=170300 Review URL: https://chromiumcodereview.appspot.com/12079030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179234 0039d316-1c4b-4281-b951-d872f2087c98
* Remove ".." from PathService take #2.maruel@chromium.org2013-01-261-0/+6
| | | | | | | | | | | | | | | | Hook directly into PathService::Get() and only convert to an absolute path when ".." is found in the path. Otherwise leave it as-is. In particular, this won't trigger when the path is simply relative, like "./unit_tests". This is necessary to make most test cases pass but this has the advatange of not triggering in the common case for Google Chrome. R=cpu@chromium.org,mark@chromium.org BUG=168890 Review URL: https://chromiumcodereview.appspot.com/12090003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179042 0039d316-1c4b-4281-b951-d872f2087c98
* Add PathService::RemoveOverride to clear path overrides.pastarmovj@chromium.org2012-09-261-43/+59
| | | | | | | | | | | | | | | This is especially useful for unit tests because they live in the same process and share all the singletons including PathService. One can of course override the overrides but it is much cleaner and sometimes the only good solution to return to the original PathProvider instead. BUG=149161 TEST=base_unittests:PathServiceTest.* Review URL: https://chromiumcodereview.appspot.com/10909228 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158842 0039d316-1c4b-4281-b951-d872f2087c98
* Add new PathService paths for Windows' All Users Desktop and Quick Launch ↵gab@chromium.org2012-09-201-4/+6
| | | | | | | | | | | | | | | | | | | | | | | folders. Re-commit, reverted in http://crrev.com/157680 (original commit in http://crrev.com/157667). This allows usage of PathService to cache the shortcut install paths and more importantly to mock them in shortcut tests! Also move chrome::DIR_USER_DESKTOP to base::DIR_USER_DESKTOP; this is really where it belongs. In fact it is only in chrome_paths.h because it used to be called DIR_DEFAULT_DOWNLOAD and cpu@ renamed it to DIR_USER_DESKTOP in http://crrev.com/1753 (early days!) after that it started to be used all over the place as the Desktop path. Finally bringing it to base_paths.h, beside DIR_START_MENU and friends, is the right thing to do imo. TBR=brettw@chromium.org BUG=148539 TEST=Quick Launch shortcut installed in the right place on XP (both Default and current user) Desktop shortcuts installed in the right place (both All Users and per-user installs). installer_util_unittests.exe --gtest_filter=ShellUtilShortcutTest* unit_tests.exe --gtest_filter=ProfileShortcutManagerTest* base_unittests --gtest_filter=PathServiceTest* Review URL: https://chromiumcodereview.appspot.com/10964007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157779 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 157667 - Add new PathService paths for Windows' All Users Desktop and ↵wjia@chromium.org2012-09-201-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Quick Launch folders. The previous patch failed PathServiceTest.Get. This allows usage of PathService to cache the paths and more importantly to mock them in shortcut tests! Also move chrome::DIR_USER_DESKTOP to base::DIR_USER_DESKTOP; this is really where it belongs. In fact it is only in chrome_paths.h because it used to be called DIR_DEFAULT_DOWNLOAD and cpu@ renamed it to DIR_USER_DESKTOP in http://crrev.com/1753 (early days!) after that it started to be used all over the place as the Desktop path. Finally bringing it to base_paths.h, beside DIR_START_MENU and friends, is the right thing to do imo. BUG=148539 TEST=Quick Launch shortcut installed in the right place on XP (both Default and current user) Desktop shortcuts installed in the right place (both All Users and per-user installs). installer_util_unittests.exe --gtest_filter=ShellUtilShortcutTest* unit_tests.exe --gtest_filter=ProfileShortcutManagerTest* base_unittests --gtest_filter=PathServiceTest* Review URL: https://chromiumcodereview.appspot.com/10910209 TBR=gab@chromium.org Review URL: https://codereview.chromium.org/10958009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157680 0039d316-1c4b-4281-b951-d872f2087c98
* Add new PathService paths for Windows' All Users Desktop and Quick Launch ↵gab@chromium.org2012-09-201-4/+6
| | | | | | | | | | | | | | | | | | | | folders. This allows usage of PathService to cache the paths and more importantly to mock them in shortcut tests! Also move chrome::DIR_USER_DESKTOP to base::DIR_USER_DESKTOP; this is really where it belongs. In fact it is only in chrome_paths.h because it used to be called DIR_DEFAULT_DOWNLOAD and cpu@ renamed it to DIR_USER_DESKTOP in http://crrev.com/1753 (early days!) after that it started to be used all over the place as the Desktop path. Finally bringing it to base_paths.h, beside DIR_START_MENU and friends, is the right thing to do imo. BUG=148539 TEST=Quick Launch shortcut installed in the right place on XP (both Default and current user) Desktop shortcuts installed in the right place (both All Users and per-user installs). installer_util_unittests.exe --gtest_filter=ShellUtilShortcutTest* unit_tests.exe --gtest_filter=ProfileShortcutManagerTest* base_unittests --gtest_filter=PathServiceTest* Review URL: https://chromiumcodereview.appspot.com/10910209 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157667 0039d316-1c4b-4281-b951-d872f2087c98
* Add new method OverrideAndCreateIfNeeded to PathService.pastarmovj@chromium.org2012-05-091-7/+18
| | | | | | | | | | | | This is prerequisite for adding support for running chrome on network shared location BUG=120388 TEST=base_unittests:PathServiceTest.Override Review URL: https://chromiumcodereview.appspot.com/10388027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136017 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 135321 - Make sure only the main browser process and service proceses ↵pastarmovj@chromium.org2012-05-041-18/+7
| | | | | | | | | | | | | | | | | | are allowed to create the profile directory. This patch lets Chrome start with profile located on a network share on Windows Vista and newer. BUG=120388 TEST=Start Chrome with --user-data-dir pointing to a network share location and try to navigate to a web page. This should not lead to a hang of the renderer. Review URL: http://codereview.chromium.org/10306009 TBR=pastarmovj@chromium.org Review URL: https://chromiumcodereview.appspot.com/10382012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135347 0039d316-1c4b-4281-b951-d872f2087c98
* Make sure only the main browser process and service proceses are allowed to ↵pastarmovj@chromium.org2012-05-041-7/+18
| | | | | | | | | | | | | | | create the profile directory. This patch lets Chrome start with profile located on a network share on Windows Vista and newer. BUG=120388 TEST=Start Chrome with --user-data-dir pointing to a network share location and try to navigate to a web page. This should not lead to a hang of the renderer. Review URL: http://codereview.chromium.org/10306009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135321 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Remove static storage for variables in an unnamed namespace.jhawkins@chromium.org2012-01-281-5/+5
| | | | | | | | | | BUG=none TEST=none R=binji Review URL: https://chromiumcodereview.appspot.com/9271061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119535 0039d316-1c4b-4281-b951-d872f2087c98
* Options2: Pull the trigger.jhawkins@chromium.org2011-12-141-3/+3
| | | | | | | | | | | | Options2 is a copy of the resources for and implementation of chrome://settings that will be pared down significantly for UberPage (see bug). BUG=100885 TEST=none R=csilv Review URL: http://codereview.chromium.org/8895023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114462 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Options2: Pull the trigger."jhawkins@chromium.org2011-12-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 11079a4772dacf7865c3d650b7aa911242bb782e. Revert "Fix build after code changed from underneath." This reverts commit 93b43a2cd246c85ee6159a70223966f5efe2af86. Revert "Moar build fix." This reverts commit bf84b5766d5d05466da641685a1f554786598310. Revert "Fix the fix." This reverts commit 4aecf275ac5c7163483f48ffa2abcfa1481ffd53. R=csilv@chromium.org BUG= TEST= Review URL: http://codereview.chromium.org/8937011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114276 0039d316-1c4b-4281-b951-d872f2087c98
* Options2: Pull the trigger.jhawkins@chromium.org2011-12-131-3/+3
| | | | | | | | | | | | Options2 is a copy of the resources for and implementation of chrome://settings that will be pared down significantly for UberPage (see bug). BUG=100885 TEST=none R=csilv Review URL: http://codereview.chromium.org/8895023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114267 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 114236 - Options2: Pull the trigger.jhawkins@chromium.org2011-12-131-3/+3
| | | | | | | | | | | | | BUG=none TEST=none R=csilv Review URL: http://codereview.chromium.org/8895023 TBR=jhawkins@chromium.org Review URL: http://codereview.chromium.org/8930012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114239 0039d316-1c4b-4281-b951-d872f2087c98
* Options2: Pull the trigger.jhawkins@chromium.org2011-12-131-3/+3
| | | | | | | | | | BUG=none TEST=none R=csilv Review URL: http://codereview.chromium.org/8895023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114236 0039d316-1c4b-4281-b951-d872f2087c98
* Allow linker initialization of lazy instancejoth@chromium.org2011-11-151-1/+1
| | | | | | | | | | | | | | Using the initializer list construct = {0} allows the object to be linker initialized. Modify the LazyInstance class design to make it a pod aggregate type that can be linker initialized this way. Also combines the instance and state members, in line with the Singleton<> class design. Introduces a new LAZY_INSTANCE_INITIALIZER macro specifically for using to init all lazy instances + modify all existing callsites to use it. (Old code would no longer compile) BUG=94925 TEST=existing tests pass. http://build.chromium.org/f/chromium/perf/linux-release/sizes/report.html?history=150&header=chrome-si&graph=chrome-si&rev=-1 should step downward. TBR=jam@chromium.org,rvargas@chromium.org,darin@chromium.org,ben@chromium.org,apatrick@chromium.org,akalin@chromium.org Review URL: http://codereview.chromium.org/8491043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110076 0039d316-1c4b-4281-b951-d872f2087c98
* Upstream android file related code.michaelbai@google.com2011-06-211-1/+17
| | | | | | | | | | | Implemented file related features BUG=None TEST=None Review URL: http://codereview.chromium.org/7184032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89914 0039d316-1c4b-4281-b951-d872f2087c98
* Use DCHECK_GE() where possible in base/. Patch by Kushal Pisavadia (see ↵pkasting@chromium.org2011-03-311-2/+2
| | | | | | | | | http://codereview.chromium.org/6688056/ ), r=me. BUG=58409 TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80063 0039d316-1c4b-4281-b951-d872f2087c98
* Continuing with DCHECK() replacement. Switching to DCHECK_GT for better ↵kushi.p@gmail.com2011-03-131-2/+2
| | | | | | | | | | | debug of broken contracts BUG=58409 Review URL: http://codereview.chromium.org/6690002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77977 0039d316-1c4b-4281-b951-d872f2087c98
* Remove obsolete base/lock.h and fix up callers to use the new header file andbrettw@chromium.org2011-01-211-9/+9
| | | | | | | | | | | the base namespace. Fix several files including lock.h unnecessarily. BUG=none TEST=none Original review=http://codereview.chromium.org/6142009/ Patch by leviw@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72106 0039d316-1c4b-4281-b951-d872f2087c98
* Make members of Singleton<T> private and only visible to the singleton type. ↵satish@chromium.org2010-12-141-2/+4
| | | | | | | | | | | | | | | This enforces that the Singleton<T> pattern can only be used within classes which want singleton-ness. As part of this CL I have also fixed up files which got missed in my previous CLs to use a GetInstance() method and use Singleton<T> from the source file. There are a small number of places where I have also switched to LazyInstance as that was more appropriate for types used in a single source file. BUG=65298 TEST=all existing tests should continue to pass. Review URL: http://codereview.chromium.org/5682008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69107 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 68932 - Make members of Singleton<T> private and only visible to the ↵satish@chromium.org2010-12-111-4/+2
| | | | | | | | | | | | | | | | | | singleton type. This enforces that the Singleton<T> pattern can only be used within classes which want singleton-ness. As part of this CL I have also fixed up files which got missed in my previous CLs to use a GetInstance() method and use Singleton<T> from the source file. There are a small number of places where I have also switched to LazyInstance as that was more appropriate for types used in a single source file. BUG=65298 TEST=all existing tests should continue to pass. Review URL: http://codereview.chromium.org/5682008 TBR=satish@chromium.org Review URL: http://codereview.chromium.org/5721005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68936 0039d316-1c4b-4281-b951-d872f2087c98
* Make members of Singleton<T> private and only visible to the singleton type. ↵satish@chromium.org2010-12-111-2/+4
| | | | | | | | | | | | | | | This enforces that the Singleton<T> pattern can only be used within classes which want singleton-ness. As part of this CL I have also fixed up files which got missed in my previous CLs to use a GetInstance() method and use Singleton<T> from the source file. There are a small number of places where I have also switched to LazyInstance as that was more appropriate for types used in a single source file. BUG=65298 TEST=all existing tests should continue to pass. Review URL: http://codereview.chromium.org/5682008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68932 0039d316-1c4b-4281-b951-d872f2087c98
* windows: remove PathService::Get() that uses wstringsevan@chromium.org2010-11-301-12/+0
| | | | | | | | | | This just required fixing the remaining callers. BUG=24672 Review URL: http://codereview.chromium.org/5356008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67783 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 67201 - Revert 67191 - chrome_paths: refactor and sanitize cache ↵viettrungluu@chromium.org2010-11-241-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | directory handling [Checking to see if this build failures on Windows.] [[Nope. Failure was a flake.]] Previously we had a bunch of logic in profile_impl.cc that computed where the cache directory lives. This change relocates it to chrome_paths.cc. Some background on cache directories. There are two possible places to store cache files: 1) in the user data directory 2) in an OS-specific user cache directory On Windows, we always pick (1). On Mac and Linux, we currently use (2) in some circumstances. This patch changes both Mac and Linux to have the same behavior with respect to (2). The Mac/Linux shared behavior is that if the profile directory is in the standard location for profiles, we put the cache files into a matching directory name in the standard system cache directory (e.g. on Linux if you're using ~/.config/google-chrome, your cache ends up in ~/.cache/google-chrome; on Mac, the directories are ~/Library/Application Support versus ~/Library/Caches). If your user data directory is not in the standard location, we use behavior (1). The semantic changes of this patch should be: - On Mac, previously we checked whether the (2) directory had some particular subdirectories already when picking which one to use. This was removed; which directory is used is solely a question of whether the profile directory is in the standard location. I think the previous behavior was unpredictable. - On Linux, previously we only used behavior (2) if you hadn't changed your user-data-directory at all. Now, to match Mac, as long as your user-data-dir is in the standard place, you use the system cache dir. So e.g. using ~/.config/foobar puts your cache in ~/.cache/foobar. - On Linux, previously the default cache would end up as directories under ~/.cache/google-chrome/; now it ends up as directories under ~/.cache/google-chrome/Default/. (In all instances above, on Linux we continue to obey $XDG_CACHE_HOME.) BUG=59824 TEST=New test ChromePaths.UserCacheDir Review URL: http://codereview.chromium.org/5123004 TBR=evan@chromium.org Review URL: http://codereview.chromium.org/5344003 TBR=viettrungluu@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67202 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 67191 - chrome_paths: refactor and sanitize cache directory handlingviettrungluu@chromium.org2010-11-241-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Checking to see if this build failures on Windows.] Previously we had a bunch of logic in profile_impl.cc that computed where the cache directory lives. This change relocates it to chrome_paths.cc. Some background on cache directories. There are two possible places to store cache files: 1) in the user data directory 2) in an OS-specific user cache directory On Windows, we always pick (1). On Mac and Linux, we currently use (2) in some circumstances. This patch changes both Mac and Linux to have the same behavior with respect to (2). The Mac/Linux shared behavior is that if the profile directory is in the standard location for profiles, we put the cache files into a matching directory name in the standard system cache directory (e.g. on Linux if you're using ~/.config/google-chrome, your cache ends up in ~/.cache/google-chrome; on Mac, the directories are ~/Library/Application Support versus ~/Library/Caches). If your user data directory is not in the standard location, we use behavior (1). The semantic changes of this patch should be: - On Mac, previously we checked whether the (2) directory had some particular subdirectories already when picking which one to use. This was removed; which directory is used is solely a question of whether the profile directory is in the standard location. I think the previous behavior was unpredictable. - On Linux, previously we only used behavior (2) if you hadn't changed your user-data-directory at all. Now, to match Mac, as long as your user-data-dir is in the standard place, you use the system cache dir. So e.g. using ~/.config/foobar puts your cache in ~/.cache/foobar. - On Linux, previously the default cache would end up as directories under ~/.cache/google-chrome/; now it ends up as directories under ~/.cache/google-chrome/Default/. (In all instances above, on Linux we continue to obey $XDG_CACHE_HOME.) BUG=59824 TEST=New test ChromePaths.UserCacheDir Review URL: http://codereview.chromium.org/5123004 TBR=evan@chromium.org Review URL: http://codereview.chromium.org/5344003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67201 0039d316-1c4b-4281-b951-d872f2087c98
* chrome_paths: refactor and sanitize cache directory handlingevan@chromium.org2010-11-241-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we had a bunch of logic in profile_impl.cc that computed where the cache directory lives. This change relocates it to chrome_paths.cc. Some background on cache directories. There are two possible places to store cache files: 1) in the user data directory 2) in an OS-specific user cache directory On Windows, we always pick (1). On Mac and Linux, we currently use (2) in some circumstances. This patch changes both Mac and Linux to have the same behavior with respect to (2). The Mac/Linux shared behavior is that if the profile directory is in the standard location for profiles, we put the cache files into a matching directory name in the standard system cache directory (e.g. on Linux if you're using ~/.config/google-chrome, your cache ends up in ~/.cache/google-chrome; on Mac, the directories are ~/Library/Application Support versus ~/Library/Caches). If your user data directory is not in the standard location, we use behavior (1). The semantic changes of this patch should be: - On Mac, previously we checked whether the (2) directory had some particular subdirectories already when picking which one to use. This was removed; which directory is used is solely a question of whether the profile directory is in the standard location. I think the previous behavior was unpredictable. - On Linux, previously we only used behavior (2) if you hadn't changed your user-data-directory at all. Now, to match Mac, as long as your user-data-dir is in the standard place, you use the system cache dir. So e.g. using ~/.config/foobar puts your cache in ~/.cache/foobar. - On Linux, previously the default cache would end up as directories under ~/.cache/google-chrome/; now it ends up as directories under ~/.cache/google-chrome/Default/. (In all instances above, on Linux we continue to obey $XDG_CACHE_HOME.) BUG=59824 TEST=New test ChromePaths.UserCacheDir Review URL: http://codereview.chromium.org/5123004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67191 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "chrome_paths: refactor and sanitize cache directory handling"evan@chromium.org2010-11-231-0/+8
| | | | | | This reverts commit r67160, test failures. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67171 0039d316-1c4b-4281-b951-d872f2087c98
* chrome_paths: refactor and sanitize cache directory handlingevan@chromium.org2010-11-231-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we had a bunch of logic in profile_impl.cc that computed where the cache directory lives. This change relocates it to chrome_paths.cc. Some background on cache directories. There are two possible places to store cache files: 1) in the user data directory 2) in an OS-specific user cache directory On Windows, we always pick (1). On Mac and Linux, we currently use (2) in some circumstances. This patch changes both Mac and Linux to have the same behavior with respect to (2). The Mac/Linux shared behavior is that if the profile directory is in the standard location for profiles, we put the cache files into a matching directory name in the standard system cache directory (e.g. on Linux if you're using ~/.config/google-chrome, your cache ends up in ~/.cache/google-chrome; on Mac, the directories are ~/Library/Application Support versus ~/Library/Caches). If your user data directory is not in the standard location, we use behavior (1). The semantic changes of this patch should be: - On Mac, previously we checked whether the (2) directory had some particular subdirectories already when picking which one to use. This was removed; which directory is used is solely a question of whether the profile directory is in the standard location. I think the previous behavior was unpredictable. - On Linux, previously we only used behavior (2) if you hadn't changed your user-data-directory at all. Now, to match Mac, as long as your user-data-dir is in the standard place, you use the system cache dir. So e.g. using ~/.config/foobar puts your cache in ~/.cache/foobar. - On Linux, previously the default cache would end up as directories under ~/.cache/google-chrome/; now it ends up as directories under ~/.cache/google-chrome/Default/. (In all instances above, on Linux we continue to obey $XDG_CACHE_HOME.) BUG=59824 TEST=New test ChromePaths.UserCacheDir Review URL: http://codereview.chromium.org/5123004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67160 0039d316-1c4b-4281-b951-d872f2087c98
* linux: fix cache corruption when using multiple --user-data-direvan@chromium.org2010-11-131-0/+8
| | | | | | | | | | | | | | This regressed in r59021. I think I can fix it in a cleaner way with some refactoring, but for now since I want to cherry-pick this onto older branches let's revert some of r59021 to fix this in the simplest way possible. BUG=59824 TEST=manual (will write a test in my followup that refactors it) Review URL: http://codereview.chromium.org/4911002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66066 0039d316-1c4b-4281-b951-d872f2087c98
* Fix CheckFalseTest.CheckFails on Linux after my change to ui_test.phajdan.jr@chromium.org2010-09-091-12/+26
| | | | | | | | | | | | | This makes PathService clear its cache after overriding a path. We have many paths depending on each other, so this is necessary to avoid inconsistencies. TEST=ui_tests in Release mode BUG=49838 Review URL: http://codereview.chromium.org/2805100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59021 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 56738 - Fix CheckFalseTest.CheckFails on Linux after my change to ↵rvargas@google.com2010-08-191-32/+13
| | | | | | | | | | | | | | | | | | ui_test. This makes PathService clear its cache after overriding a path. We have many paths depending on each other, so this is necessary to avoid inconsistencies. TEST=ui_tests in Release mode BUG=49838 Review URL: http://codereview.chromium.org/2805100 TBR=phajdan.jr@chromium.org Review URL: http://codereview.chromium.org/3169031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56778 0039d316-1c4b-4281-b951-d872f2087c98
* Fix CheckFalseTest.CheckFails on Linux after my change to ui_test.phajdan.jr@chromium.org2010-08-191-13/+32
| | | | | | | | | | | | | This makes PathService clear its cache after overriding a path. We have many paths depending on each other, so this is necessary to avoid inconsistencies. TEST=ui_tests in Release mode BUG=49838 Review URL: http://codereview.chromium.org/2805100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56738 0039d316-1c4b-4281-b951-d872f2087c98
* Header cleanup in base.brettw@chromium.org2010-08-171-1/+0
| | | | | | | | | | | | | | This makes uses of StringPrintf and friends use the base namespace and include stringprintf.h explicitly. This also removes a bunch of unnecessary string_util includes (which exposed a few other errors like people forgetting to include <vector>. TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/3119022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56446 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 55450 - Fix CheckFalseTest.CheckFails on Linux after my change to ↵glen@chromium.org2010-08-091-26/+12
| | | | | | | | | | | | | | | | | | | | | ui_test. This makes PathService clear its cache after overriding a path. We have many paths depending on each other, so this is necessary to avoid inconsistencies. Added a comment that PathService::Override should not be called by production code. TEST=ui_tests in Release mode BUG=49838 Review URL: http://codereview.chromium.org/2805100 TBR=phajdan.jr@chromium.org Review URL: http://codereview.chromium.org/3107001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55468 0039d316-1c4b-4281-b951-d872f2087c98
* Fix CheckFalseTest.CheckFails on Linux after my change to ui_test.phajdan.jr@chromium.org2010-08-091-12/+26
| | | | | | | | | | | | | | | | This makes PathService clear its cache after overriding a path. We have many paths depending on each other, so this is necessary to avoid inconsistencies. Added a comment that PathService::Override should not be called by production code. TEST=ui_tests in Release mode BUG=49838 Review URL: http://codereview.chromium.org/2805100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55450 0039d316-1c4b-4281-b951-d872f2087c98