Backout 6533fc1ea789 Bug 724423 - Fix jump list favicon cleanup. CLOSED TREE r=me

Some debug win8 assertion failures that may be because of this

--HG--
extra : amend_source : 632ee9f59c9758734033d6a5deac60a396a81766
This commit is contained in:
Brian R. Bondy 2014-05-28 00:04:04 -04:00
parent 755b99f4f6
commit 326d7ffa82
3 changed files with 2 additions and 33 deletions

View File

@ -126,9 +126,6 @@ NS_IMETHODIMP JumpListBuilder::InitListBuild(nsIMutableArray *removedItems, bool
IObjectArray *objArray;
// The returned objArray of removed items are for manually removed items.
// This does not return items which are removed because they were previously
// part of the jump list but are no longer part of the jump list.
if (SUCCEEDED(mJumpListMgr->BeginList(&mMaxItems, IID_PPV_ARGS(&objArray)))) {
if (objArray) {
TransferIObjectArrayToIMutableArray(objArray, removedItems);
@ -382,12 +379,6 @@ NS_IMETHODIMP JumpListBuilder::AddListToBuild(int16_t aCatType, nsIArray *items,
hr = mJumpListMgr->AppendCategory(reinterpret_cast<const wchar_t*>(catName.BeginReading()), pArray);
if (SUCCEEDED(hr))
*_retval = true;
// Get rid of the old icons
nsCOMPtr<nsIRunnable> event =
new mozilla::widget::AsyncDeleteAllFaviconsFromDisk(true);
mIOThread->Dispatch(event, NS_DISPATCH_NORMAL);
return NS_OK;
}
break;

View File

@ -958,9 +958,7 @@ AsyncDeleteIconFromDisk::~AsyncDeleteIconFromDisk()
{
}
AsyncDeleteAllFaviconsFromDisk::
AsyncDeleteAllFaviconsFromDisk(bool aIgnoreRecent)
: mIgnoreRecent(aIgnoreRecent)
AsyncDeleteAllFaviconsFromDisk::AsyncDeleteAllFaviconsFromDisk()
{
}
@ -999,24 +997,6 @@ NS_IMETHODIMP AsyncDeleteAllFaviconsFromDisk::Run()
if (NS_FAILED(currFile->Exists(&exists)) || !exists)
continue;
if (mIgnoreRecent) {
// Check to make sure the icon wasn't just recently created.
// If it was created recently, don't delete it yet.
int64_t fileModTime = 0;
rv = currFile->GetLastModifiedTime(&fileModTime);
fileModTime /= PR_MSEC_PER_SEC;
// If the icon is older than the regeneration time (+ 10 min to be
// safe), then it's old and we can get rid of it.
// This code is only hit directly after a regeneration.
int32_t icoNoDeleteSeconds =
FaviconHelper::GetICOCacheSecondsTimeout() + 600;
int64_t nowTime = PR_Now() / int64_t(PR_USEC_PER_SEC);
if (NS_FAILED(rv) ||
(nowTime - fileModTime) < icoNoDeleteSeconds) {
continue;
}
}
// We found an ICO file that exists, so we should remove it
currFile->Remove(false);
}

View File

@ -411,10 +411,8 @@ public:
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIRUNNABLE
AsyncDeleteAllFaviconsFromDisk(bool aIgnoreRecent = false);
AsyncDeleteAllFaviconsFromDisk();
virtual ~AsyncDeleteAllFaviconsFromDisk();
private:
bool mIgnoreRecent;
};
class FaviconHelper