зеркало из https://github.com/mozilla/pjs.git
Bug 404634 - "http urls don't render in TestGtkEmbed" [p=asac@jwsdot.com (Alexander Sack) r=bsmedberg r=bzbarsky a=blocking1.9+]
This commit is contained in:
Родитель
c9bb3a7b3b
Коммит
a0d087efa5
|
@ -7467,8 +7467,9 @@ nsDocShell::CheckClassifier(nsIChannel *aChannel)
|
|||
|
||||
classifier->SetChannel(aChannel);
|
||||
nsresult rv = classifier->Run();
|
||||
if (rv == NS_ERROR_FACTORY_NOT_REGISTERED) {
|
||||
// no URI classifier, ignore this
|
||||
if (rv == NS_ERROR_FACTORY_NOT_REGISTERED ||
|
||||
rv == NS_ERROR_NOT_AVAILABLE) {
|
||||
// no URI classifier => ignored cases
|
||||
return NS_OK;
|
||||
}
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
|
|
@ -86,10 +86,27 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsDownloadProxy)
|
|||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsTypeAheadFind)
|
||||
|
||||
#ifdef MOZ_URL_CLASSIFIER
|
||||
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsUrlClassifierDBService,
|
||||
nsUrlClassifierDBService::GetInstance)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUrlClassifierStreamUpdater)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUrlClassifierUtils, Init)
|
||||
|
||||
static NS_IMETHODIMP
|
||||
nsUrlClassifierDBServiceConstructor(nsISupports *aOuter, REFNSIID aIID,
|
||||
void **aResult)
|
||||
{
|
||||
nsresult rv;
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
NS_ENSURE_NO_AGGREGATION(aOuter);
|
||||
|
||||
nsUrlClassifierDBService *inst = nsUrlClassifierDBService::GetInstance(&rv);
|
||||
if (NULL == inst) {
|
||||
return rv;
|
||||
}
|
||||
/* NS_ADDREF(inst); */
|
||||
rv = inst->QueryInterface(aIID, aResult);
|
||||
NS_RELEASE(inst);
|
||||
|
||||
return rv;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_FEEDS
|
||||
|
|
|
@ -650,7 +650,13 @@ nsUrlClassifierDBServiceWorker::Init()
|
|||
// portable between machine types, so store it in the local profile dir.
|
||||
nsresult rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_LOCAL_50_DIR,
|
||||
getter_AddRefs(mDBFile));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
|
||||
getter_AddRefs(mDBFile));
|
||||
}
|
||||
|
||||
if (NS_FAILED(rv)) return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
rv = mDBFile->Append(NS_LITERAL_STRING(DATABASE_FILENAME));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -2266,16 +2272,20 @@ NS_IMPL_THREADSAFE_ISUPPORTS3(nsUrlClassifierDBService,
|
|||
nsIObserver)
|
||||
|
||||
/* static */ nsUrlClassifierDBService*
|
||||
nsUrlClassifierDBService::GetInstance()
|
||||
nsUrlClassifierDBService::GetInstance(nsresult *result)
|
||||
{
|
||||
*result = NS_OK;
|
||||
if (!sUrlClassifierDBService) {
|
||||
sUrlClassifierDBService = new nsUrlClassifierDBService();
|
||||
if (!sUrlClassifierDBService)
|
||||
if (!sUrlClassifierDBService) {
|
||||
*result = NS_ERROR_OUT_OF_MEMORY;
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
NS_ADDREF(sUrlClassifierDBService); // addref the global
|
||||
|
||||
if (NS_FAILED(sUrlClassifierDBService->Init())) {
|
||||
*result = sUrlClassifierDBService->Init();
|
||||
if (NS_FAILED(*result)) {
|
||||
NS_RELEASE(sUrlClassifierDBService);
|
||||
return nsnull;
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
|
||||
nsresult Init();
|
||||
|
||||
static nsUrlClassifierDBService* GetInstance();
|
||||
static nsUrlClassifierDBService* GetInstance(nsresult *result);
|
||||
|
||||
#ifdef MOZILLA_1_8_BRANCH
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_URLCLASSIFIERDBSERVICE_CID)
|
||||
|
|
Загрузка…
Ссылка в новой задаче