mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1128311 - Only flush the DNS cache when the last private browsing window is closed; r=mcmanus
This commit is contained in:
parent
37e1e73a58
commit
1d19b4a99e
@ -944,11 +944,17 @@ nsDNSService::Observe(nsISupports *subject, const char *topic, const char16_t *d
|
||||
strcmp(topic, NS_NETWORK_LINK_TOPIC) == 0,
|
||||
"unexpected observe call");
|
||||
|
||||
bool flushCache = false;
|
||||
if (!strcmp(topic, NS_NETWORK_LINK_TOPIC)) {
|
||||
nsAutoCString converted = NS_ConvertUTF16toUTF8(data);
|
||||
if (mResolver && !strcmp(converted.get(), NS_NETWORK_LINK_DATA_CHANGED)) {
|
||||
mResolver->FlushCache();
|
||||
flushCache = true;
|
||||
}
|
||||
} else if (!strcmp(topic, "last-pb-context-exited")) {
|
||||
flushCache = true;
|
||||
}
|
||||
if (flushCache) {
|
||||
mResolver->FlushCache();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user