Added a purge by predicate method to the ResourceCache.

This enables removing stale entries by passing a callback that tests if
a key is still valid or not, instead of having to put all the currently good
keys in a set. The cache user can now wrap a custom function that works with
whatever structured contains the current keys to keep.

BUG=270667
R=bartfab@chromium.org

Review URL: https://codereview.chromium.org/52553005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233600 0039d316-1c4b-4281-b951-d872f2087c98
Fix DST bug in history browsertest.

The test assumed that two history entries that are 24 hours apart
would not occur on the same day. But, thanks to the miracle of daylight
savings time, they can!

BUG=None
R=sergiu@chromium.org

Review URL: https://codereview.chromium.org/61683005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233601 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 233601
This fix a problem where a MediaStream can not be created if a USB device is unplugged and re-plugged.
This is potentially the same thing that happens when the lid is closed and the machine suspends on a Cr OS device.

BUG=315433
R=tommi@chromium.org, xians@chromium.org

Review URL: https://codereview.chromium.org/62103002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233602 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 233602