int main() { FlushAllCaches(); delay(1000); Reboot(0); }
// xxxbsmedberg Move me to nsIWindowMediator NS_IMETHODIMP nsChromeRegistry::ReloadChrome() { UpdateSelectedLocale(); FlushAllCaches(); // Do a reload of all top level windows. nsresult rv = NS_OK; // Get the window mediator nsCOMPtr<nsIWindowMediator> windowMediator (do_GetService(NS_WINDOWMEDIATOR_CONTRACTID)); if (windowMediator) { nsCOMPtr<nsISimpleEnumerator> windowEnumerator; rv = windowMediator->GetEnumerator(nsnull, getter_AddRefs(windowEnumerator)); if (NS_SUCCEEDED(rv)) { // Get each dom window PRBool more; rv = windowEnumerator->HasMoreElements(&more); if (NS_FAILED(rv)) return rv; while (more) { nsCOMPtr<nsISupports> protoWindow; rv = windowEnumerator->GetNext(getter_AddRefs(protoWindow)); if (NS_SUCCEEDED(rv)) { nsCOMPtr<nsIDOMWindowInternal> domWindow = do_QueryInterface(protoWindow); if (domWindow) { nsCOMPtr<nsIDOMLocation> location; domWindow->GetLocation(getter_AddRefs(location)); if (location) { rv = location->Reload(PR_FALSE); if (NS_FAILED(rv)) return rv; } } } rv = windowEnumerator->HasMoreElements(&more); if (NS_FAILED(rv)) return rv; } } } return rv; }
void ColdReboot(void) { FlushAllCaches(); delay(1000); Reboot(FALSE); }
void WarmReboot(void) { FlushAllCaches(); delay(1000); Reboot(TRUE); }