Bug 1486182: Follow-up: Fix straggler nsIUTF8StringEnumerator references. r=bustage CLOSED TREE
This commit is contained in:
@@ -12,7 +12,6 @@
|
|||||||
#include "nsIDOMWindow.h"
|
#include "nsIDOMWindow.h"
|
||||||
#include "nsIFile.h"
|
#include "nsIFile.h"
|
||||||
#include "nsISimpleEnumerator.h"
|
#include "nsISimpleEnumerator.h"
|
||||||
#include "nsIStringEnumerator.h"
|
|
||||||
#include "mozilla/SimpleEnumerator.h"
|
#include "mozilla/SimpleEnumerator.h"
|
||||||
|
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
@@ -547,9 +546,6 @@ nsCommandLine::EnumerateValidators(EnumerateValidatorsCallback aCallback, void *
|
|||||||
getter_AddRefs(entenum));
|
getter_AddRefs(entenum));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsCOMPtr<nsIUTF8StringEnumerator> strenum (do_QueryInterface(entenum));
|
|
||||||
NS_ENSURE_TRUE(strenum, NS_ERROR_UNEXPECTED);
|
|
||||||
|
|
||||||
for (auto& categoryEntry : SimpleEnumerator<nsICategoryEntry>(entenum)) {
|
for (auto& categoryEntry : SimpleEnumerator<nsICategoryEntry>(entenum)) {
|
||||||
nsAutoCString contractID;
|
nsAutoCString contractID;
|
||||||
categoryEntry->GetValue(contractID);
|
categoryEntry->GetValue(contractID);
|
||||||
|
|||||||
@@ -14,9 +14,9 @@
|
|||||||
#include "nsGkAtoms.h"
|
#include "nsGkAtoms.h"
|
||||||
#include "nsEnumeratorUtils.h"
|
#include "nsEnumeratorUtils.h"
|
||||||
|
|
||||||
|
#include "mozilla/SimpleEnumerator.h"
|
||||||
#include "nsICategoryManager.h"
|
#include "nsICategoryManager.h"
|
||||||
#include "nsISimpleEnumerator.h"
|
#include "nsISimpleEnumerator.h"
|
||||||
#include "nsIStringEnumerator.h"
|
|
||||||
|
|
||||||
#if defined(XP_WIN)
|
#if defined(XP_WIN)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@@ -315,25 +315,12 @@ nsDirectoryService::RegisterCategoryProviders()
|
|||||||
catman->EnumerateCategory(XPCOM_DIRECTORY_PROVIDER_CATEGORY,
|
catman->EnumerateCategory(XPCOM_DIRECTORY_PROVIDER_CATEGORY,
|
||||||
getter_AddRefs(entries));
|
getter_AddRefs(entries));
|
||||||
|
|
||||||
nsCOMPtr<nsIUTF8StringEnumerator> strings(do_QueryInterface(entries));
|
for (auto& categoryEntry : SimpleEnumerator<nsICategoryEntry>(entries)) {
|
||||||
if (!strings) {
|
nsAutoCString contractID;
|
||||||
return;
|
categoryEntry->GetValue(contractID);
|
||||||
}
|
|
||||||
|
|
||||||
bool more;
|
if (nsCOMPtr<nsIDirectoryServiceProvider> provider = do_GetService(contractID.get())) {
|
||||||
while (NS_SUCCEEDED(strings->HasMore(&more)) && more) {
|
RegisterProvider(provider);
|
||||||
nsAutoCString entry;
|
|
||||||
strings->GetNext(entry);
|
|
||||||
|
|
||||||
nsCString contractID;
|
|
||||||
catman->GetCategoryEntry(XPCOM_DIRECTORY_PROVIDER_CATEGORY, entry,
|
|
||||||
contractID);
|
|
||||||
|
|
||||||
if (!contractID.IsVoid()) {
|
|
||||||
nsCOMPtr<nsIDirectoryServiceProvider> provider = do_GetService(contractID.get());
|
|
||||||
if (provider) {
|
|
||||||
RegisterProvider(provider);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user