зеркало из https://github.com/mozilla/pjs.git
fix for bug #410302: when configured to clear private private data on shutdown, we do more work than we need to.
r=dietrich, a=schrep
This commit is contained in:
Родитель
45f5a568aa
Коммит
0c2a5f886c
|
@ -208,16 +208,17 @@ nsNavHistoryExpire::OnQuit()
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
NS_WARNING("ExpireEmbeddedLinks failed.");
|
NS_WARNING("ExpireEmbeddedLinks failed.");
|
||||||
|
|
||||||
// Determine whether we must partially or fully expire dangling entries.
|
// Determine whether we can skip partially expiration of dangling entries
|
||||||
|
// because we be doing a full expiration on shutdown in ClearHistory()
|
||||||
nsCOMPtr<nsIPrefBranch> prefs(do_GetService("@mozilla.org/preferences-service;1"));
|
nsCOMPtr<nsIPrefBranch> prefs(do_GetService("@mozilla.org/preferences-service;1"));
|
||||||
PRBool sanitizeOnShutdown, sanitizeHistory;
|
PRBool sanitizeOnShutdown, sanitizeHistory;
|
||||||
prefs->GetBoolPref(PREF_SANITIZE_ON_SHUTDOWN, &sanitizeOnShutdown);
|
prefs->GetBoolPref(PREF_SANITIZE_ON_SHUTDOWN, &sanitizeOnShutdown);
|
||||||
prefs->GetBoolPref(PREF_SANITIZE_ITEM_HISTORY, &sanitizeHistory);
|
prefs->GetBoolPref(PREF_SANITIZE_ITEM_HISTORY, &sanitizeHistory);
|
||||||
PRInt32 maxRecords =
|
if (sanitizeHistory && sanitizeOnShutdown)
|
||||||
(sanitizeHistory && sanitizeOnShutdown) ? -1 :EXPIRATION_CAP_PLACES;
|
return;
|
||||||
|
|
||||||
// vacuum up dangling items
|
// vacuum up dangling items
|
||||||
rv = ExpireHistoryParanoid(connection, maxRecords);
|
rv = ExpireHistoryParanoid(connection, EXPIRATION_CAP_PLACES);
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
NS_WARNING("ExpireHistoryParanoid failed.");
|
NS_WARNING("ExpireHistoryParanoid failed.");
|
||||||
rv = ExpireFaviconsParanoid(connection);
|
rv = ExpireFaviconsParanoid(connection);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче