fix for bug #392192: first run migration / import from safari browser is slow, history import should use "run in batch"

r=sayrer
This commit is contained in:
sspitzer%mozilla.org 2007-08-14 19:29:49 +00:00
Родитель 80b7a111ef
Коммит d1c54e498b
2 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -832,6 +832,16 @@ nsSafariProfileMigrator::CopyCookies(PRBool aReplace)
nsresult
nsSafariProfileMigrator::CopyHistory(PRBool aReplace)
{
nsresult rv;
nsCOMPtr<nsINavHistoryService> history = do_GetService(NS_NAVHISTORYSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
return history->RunInBatchMode(this, nsnull);
}
NS_IMETHODIMP
nsSafariProfileMigrator::RunBatched(nsISupports* aUserData)
{
nsCOMPtr<nsIProperties> fileLocator(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID));
nsCOMPtr<nsILocalFile> safariHistoryFile;

Просмотреть файл

@ -43,15 +43,18 @@
#include "nsIObserverService.h"
#include "nsISupportsArray.h"
#include "nsStringAPI.h"
#include "nsINavHistoryService.h"
#include <CoreFoundation/CoreFoundation.h>
class nsIRDFDataSource;
class nsSafariProfileMigrator : public nsIBrowserProfileMigrator
class nsSafariProfileMigrator : public nsIBrowserProfileMigrator,
public nsINavHistoryBatchCallback
{
public:
NS_DECL_NSIBROWSERPROFILEMIGRATOR
NS_DECL_NSINAVHISTORYBATCHCALLBACK
NS_DECL_ISUPPORTS
nsSafariProfileMigrator();