From 3143e362d0a8bc60c413a5cd59f08018e14e79d9 Mon Sep 17 00:00:00 2001 From: "sspitzer%mozilla.org" Date: Fri, 17 Aug 2007 17:54:58 +0000 Subject: [PATCH] fix for bug #392192: first run migration / import from opera browser is slow, history import should use "run in batch" r=dietrich git-svn-id: svn://10.0.0.236/trunk@232273 18797224-902f-48f8-a5cc-f745e15eee43 --- .../migration/src/nsOperaProfileMigrator.cpp | 10 ++++++++++ .../components/migration/src/nsOperaProfileMigrator.h | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/mozilla/browser/components/migration/src/nsOperaProfileMigrator.cpp b/mozilla/browser/components/migration/src/nsOperaProfileMigrator.cpp index 065b51cb599..9e992e78ec7 100644 --- a/mozilla/browser/components/migration/src/nsOperaProfileMigrator.cpp +++ b/mozilla/browser/components/migration/src/nsOperaProfileMigrator.cpp @@ -962,6 +962,16 @@ nsOperaCookieMigrator::ReadHeader() nsresult nsOperaProfileMigrator::CopyHistory(PRBool aReplace) +{ + nsresult rv; + nsCOMPtr history = do_GetService(NS_NAVHISTORYSERVICE_CONTRACTID, &rv); + NS_ENSURE_SUCCESS(rv, rv); + + return history->RunInBatchMode(this, nsnull); +} + +NS_IMETHODIMP +nsOperaProfileMigrator::RunBatched(nsISupports* aUserData) { nsCOMPtr hist(do_GetService(NS_GLOBALHISTORY2_CONTRACTID)); diff --git a/mozilla/browser/components/migration/src/nsOperaProfileMigrator.h b/mozilla/browser/components/migration/src/nsOperaProfileMigrator.h index 19cd5a5c31a..0c1018841a4 100644 --- a/mozilla/browser/components/migration/src/nsOperaProfileMigrator.h +++ b/mozilla/browser/components/migration/src/nsOperaProfileMigrator.h @@ -45,6 +45,7 @@ #include "nsISupportsArray.h" #include "nsStringAPI.h" #include "nsVoidArray.h" +#include "nsINavHistoryService.h" class nsICookieManager2; class nsILineInputStream; @@ -55,10 +56,12 @@ class nsIPrefBranch; class nsINavBookmarksService; class nsIRDFResource; -class nsOperaProfileMigrator : public nsIBrowserProfileMigrator +class nsOperaProfileMigrator : public nsIBrowserProfileMigrator, + public nsINavHistoryBatchCallback { public: NS_DECL_NSIBROWSERPROFILEMIGRATOR + NS_DECL_NSINAVHISTORYBATCHCALLBACK NS_DECL_ISUPPORTS nsOperaProfileMigrator();