Back out Bug 668699 because we can't use the pref service off the main thread.

This commit is contained in:
Kyle Huey 2011-07-06 11:10:14 -07:00
Родитель b6909019e9 d4cbdfcee5
Коммит fe506e4d64
1 изменённых файлов: 3 добавлений и 10 удалений

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

@ -77,7 +77,6 @@
#include "prprf.h"
#include "prnetdb.h"
#include "zlib.h"
#include "mozilla/Preferences.h"
// Needed to interpert mozIStorageConnection::GetLastError
#include <sqlite3.h>
@ -1799,6 +1798,7 @@ nsUrlClassifierDBServiceWorker::GetTables(nsIUrlClassifierCallback* c)
nsresult rv = OpenDb();
if (NS_FAILED(rv)) {
NS_ERROR("Unable to open database");
return NS_ERROR_FAILURE;
}
@ -2913,6 +2913,7 @@ nsUrlClassifierDBServiceWorker::BeginUpdate(nsIUrlClassifierUpdateObserver *obse
nsresult rv = OpenDb();
if (NS_FAILED(rv)) {
NS_ERROR("Unable to open database");
return NS_ERROR_FAILURE;
}
@ -3060,6 +3061,7 @@ nsUrlClassifierDBServiceWorker::UpdateStream(const nsACString& chunk)
LOG(("Update from Stream."));
nsresult rv = OpenDb();
if (NS_FAILED(rv)) {
NS_ERROR("Unable to open database");
return NS_ERROR_FAILURE;
}
@ -3365,15 +3367,6 @@ nsUrlClassifierDBServiceWorker::OpenDb()
if (mConnection)
return NS_OK;
// If we're turned off, refuse to open the DB
PRBool openDB =
Preferences::GetBool(CHECK_MALWARE_PREF, CHECK_MALWARE_DEFAULT) ||
Preferences::GetBool(CHECK_PHISHING_PREF, CHECK_PHISHING_DEFAULT);
if (!openDB) {
NS_WARNING("Not opening url-classifier DB");
return NS_ERROR_NOT_AVAILABLE;
}
LOG(("Opening db\n"));
nsresult rv;