Disk cache: Delete all files from the cache folder, instead of only the files created by the cache.
Disk cache: Delete all files from the cache folder, instead of only the
files created by the cache.

I changed the code that deletes the cache files from the unit tests to use
the same code used by the cache itself to discard old caches. However, said code
performs a selective deletion of files, and leave anything that it doesn't know
about on the folder, and then attempts to remove the folder (knowing that it will
fail if there are extra files or directories there).

That causes a problem with the unit tests, because some of the tests create an extra
file in that folder, so the folder cannot be deleted. As a result, we start accumulating
extra folders until we reach our pre-defined limit, and at that time the tests start
to fail.

We could modify the code to also delete this extra file, but given that the whole cache
lives under a hidden folder, it makes sense to simplify the code and just delete
every file when we want to discard an old file.

So this means that if a user decides to write a file to that folder, we will delete it
whenever we update the cache version, or when the user chooses to "Clear browsing data/
cache".

Note that if the foreign object is a directory, we won't delete it and it will be moved
aside.



git-svn-id: http://src.chromium.org/svn/trunk/src@1244 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: 0fd66821757ea9abc4634725ddcc4595b51171c2
meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser