From 6264c30a9101614801345725e34c3af34ce67598 Mon Sep 17 00:00:00 2001 From: "bryner%brianryner.com" Date: Wed, 18 Jan 2006 01:21:36 +0000 Subject: [PATCH] Addressing sr comments from darin. Bug 322369. git-svn-id: svn://10.0.0.236/trunk@187736 18797224-902f-48f8-a5cc-f745e15eee43 --- .../components/places/public/nsINavHistoryService.idl | 7 +++++++ .../components/places/src/nsMorkHistoryImporter.cpp | 3 +++ mozilla/db/morkreader/nsMorkReader.cpp | 5 +++-- mozilla/db/morkreader/nsMorkReader.h | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/mozilla/browser/components/places/public/nsINavHistoryService.idl b/mozilla/browser/components/places/public/nsINavHistoryService.idl index ea2645a03d4..c38e3eaca79 100644 --- a/mozilla/browser/components/places/public/nsINavHistoryService.idl +++ b/mozilla/browser/components/places/public/nsINavHistoryService.idl @@ -823,5 +823,12 @@ interface nsINavHistoryService : nsISupports [scriptable, uuid(be935aed-6929-4e44-be29-17ec89e5c8bd)] interface nsIMorkHistoryImporter : nsISupports { + /** + * Import the given Mork history file. + * @param file The Mork history file to import + * @param history A reference to the nsINavHistoryService. This is + * supplied since the importer is invoked during + * history service initialization. + */ void importHistory(in nsIFile file, in nsINavHistoryService history); }; diff --git a/mozilla/browser/components/places/src/nsMorkHistoryImporter.cpp b/mozilla/browser/components/places/src/nsMorkHistoryImporter.cpp index 7aceed858ec..c96430d7c21 100644 --- a/mozilla/browser/components/places/src/nsMorkHistoryImporter.cpp +++ b/mozilla/browser/components/places/src/nsMorkHistoryImporter.cpp @@ -195,6 +195,8 @@ NS_IMETHODIMP nsMorkHistoryImporter::ImportHistory(nsIFile *aFile, nsINavHistoryService *aHistory) { + NS_ENSURE_TRUE(aFile && aHistory, NS_ERROR_NULL_POINTER); + // Read in the mork file nsMorkReader reader; nsresult rv = reader.Init(); @@ -223,6 +225,7 @@ nsMorkHistoryImporter::ImportHistory(nsIFile *aFile, // Now add the results to history nsNavHistory *history = NS_STATIC_CAST(nsNavHistory*, aHistory); mozIStorageConnection *conn = history->GetStorageConnection(); + NS_ENSURE_TRUE(conn, NS_ERROR_NOT_INITIALIZED); mozStorageTransaction transaction(conn, PR_FALSE); reader.EnumerateRows(AddToHistoryCB, &data); diff --git a/mozilla/db/morkreader/nsMorkReader.cpp b/mozilla/db/morkreader/nsMorkReader.cpp index 5f5609df260..02d5c6e6d28 100644 --- a/mozilla/db/morkreader/nsMorkReader.cpp +++ b/mozilla/db/morkreader/nsMorkReader.cpp @@ -12,7 +12,7 @@ * for the specific language governing rights and limitations under the * License. * - * The Original Code is Places. + * The Original Code is the Mork Reader. * * The Initial Developer of the Original Code is * Google Inc. @@ -64,7 +64,8 @@ ConvertChar(char *c) if ('0' <= c1 && c1 <= '9') { *c = c1 - '0'; return PR_TRUE; - } else if ('A' <= c1 && c1 <= 'F') { + } + if ('A' <= c1 && c1 <= 'F') { *c = c1 - 'A' + 10; return PR_TRUE; } diff --git a/mozilla/db/morkreader/nsMorkReader.h b/mozilla/db/morkreader/nsMorkReader.h index 2afbddf5db6..faf3dd883ff 100644 --- a/mozilla/db/morkreader/nsMorkReader.h +++ b/mozilla/db/morkreader/nsMorkReader.h @@ -12,7 +12,7 @@ * for the specific language governing rights and limitations under the * License. * - * The Original Code is Places. + * The Original Code is the Mork Reader. * * The Initial Developer of the Original Code is * Google Inc.