Skip to content

Commit

Permalink
Backed out 3 changesets (bug 1477579) for build bustages on xpcshell\…
Browse files Browse the repository at this point in the history
…selftest.py and crashtest failures on /components/nsComponentManager.cpp. CLOSED TREE

Backed out changeset aa9a8f18e98f (bug 1477579)
Backed out changeset 5fb0b7746a5d (bug 1477579)
Backed out changeset 8359f8fe4184 (bug 1477579)
  • Loading branch information
cristianbrindusan committed Jul 24, 2018
1 parent 616ee87 commit 91a3707
Show file tree
Hide file tree
Showing 21 changed files with 199 additions and 282 deletions.
3 changes: 2 additions & 1 deletion dom/base/nsContentUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6952,7 +6952,8 @@ nsContentUtils::FindInternalContentViewer(const nsACString& aType,

nsCString contractID;
nsresult rv = catMan->GetCategoryEntry("Gecko-Content-Viewers",
aType, contractID);
PromiseFlatCString(aType).get(),
getter_Copies(contractID));
if (NS_SUCCEEDED(rv)) {
docFactory = do_GetService(contractID.get());
if (docFactory && aLoaderType) {
Expand Down
4 changes: 2 additions & 2 deletions dom/base/nsDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1089,8 +1089,8 @@ nsExternalResourceMap::PendingLoad::SetupViewer(nsIRequest* aRequest,
do_GetService(NS_CATEGORYMANAGER_CONTRACTID);
NS_ENSURE_TRUE(catMan, NS_ERROR_NOT_AVAILABLE);
nsCString contractId;
nsresult rv = catMan->GetCategoryEntry("Gecko-Content-Viewers", type,
contractId);
nsresult rv = catMan->GetCategoryEntry("Gecko-Content-Viewers", type.get(),
getter_Copies(contractId));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDocumentLoaderFactory> docLoaderFactory =
do_GetService(contractId.get());
Expand Down
17 changes: 10 additions & 7 deletions dom/plugins/base/nsPluginHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2771,15 +2771,16 @@ nsPluginHost::RegisterWithCategoryManager(const nsCString& aMimeType,
return;
}

NS_NAMED_LITERAL_CSTRING(contractId,
"@mozilla.org/content/plugin/document-loader-factory;1");
const char *contractId =
"@mozilla.org/content/plugin/document-loader-factory;1";

if (aType == ePluginRegister) {
catMan->AddCategoryEntry("Gecko-Content-Viewers",
aMimeType,
aMimeType.get(),
contractId,
false, /* persist: broken by bug 193031 */
mOverrideInternalTypes);
mOverrideInternalTypes,
nullptr);
} else {
if (aType == ePluginMaybeUnregister) {
// Bail out if this type is still used by an enabled plugin
Expand All @@ -2793,10 +2794,12 @@ nsPluginHost::RegisterWithCategoryManager(const nsCString& aMimeType,
// Only delete the entry if a plugin registered for it
nsCString value;
nsresult rv = catMan->GetCategoryEntry("Gecko-Content-Viewers",
aMimeType, value);
if (NS_SUCCEEDED(rv) && value == contractId) {
aMimeType.get(),
getter_Copies(value));
if (NS_SUCCEEDED(rv) && strcmp(value.get(), contractId) == 0) {
catMan->DeleteCategoryEntry("Gecko-Content-Viewers",
aMimeType, true);
aMimeType.get(),
true);
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion dom/push/PushNotifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ PushDispatcher::DoNotifyObservers(nsISupports *aSubject, const char *aTopic,
do_GetService(NS_CATEGORYMANAGER_CONTRACTID);
if (catMan) {
nsCString contractId;
nsresult rv = catMan->GetCategoryEntry("push", mScope, contractId);
nsresult rv = catMan->GetCategoryEntry("push",
mScope.BeginReading(),
getter_Copies(contractId));
if (NS_SUCCEEDED(rv)) {
// Ensure the service is created - we don't need to do anything with
// it though - we assume the service constructor attaches a listener.
Expand Down
2 changes: 1 addition & 1 deletion gfx/thebes/gfxSVGGlyphs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ gfxSVGGlyphsDocument::SetupPresentation()
{
nsCOMPtr<nsICategoryManager> catMan = do_GetService(NS_CATEGORYMANAGER_CONTRACTID);
nsCString contractId;
nsresult rv = catMan->GetCategoryEntry("Gecko-Content-Viewers", "image/svg+xml", contractId);
nsresult rv = catMan->GetCategoryEntry("Gecko-Content-Viewers", "image/svg+xml", getter_Copies(contractId));
NS_ENSURE_SUCCESS(rv, rv);

nsCOMPtr<nsIDocumentLoaderFactory> docLoaderFactory =
Expand Down
2 changes: 1 addition & 1 deletion image/SVGDocumentWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ SVGDocumentWrapper::SetupViewer(nsIRequest* aRequest,
NS_ENSURE_TRUE(catMan, NS_ERROR_NOT_AVAILABLE);
nsCString contractId;
nsresult rv = catMan->GetCategoryEntry("Gecko-Content-Viewers", IMAGE_SVG_XML,
contractId);
getter_Copies(contractId));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDocumentLoaderFactory> docLoaderFactory =
do_GetService(contractId.get());
Expand Down
2 changes: 1 addition & 1 deletion layout/base/nsStyleSheetService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ nsStyleSheetService::RegisterFromEnumerator(nsICategoryManager *aManager,
icStr->GetData(name);

nsCString spec;
aManager->GetCategoryEntry(nsDependentCString(aCategory), name, spec);
aManager->GetCategoryEntry(aCategory, name.get(), getter_Copies(spec));

nsCOMPtr<nsIURI> uri;
NS_NewURI(getter_AddRefs(uri), spec);
Expand Down
8 changes: 5 additions & 3 deletions toolkit/components/commandlines/nsCommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,9 @@ nsCommandLine::EnumerateHandlers(EnumerateHandlersCallback aCallback, void *aClo
strenum->GetNext(entry);

nsCString contractID;
rv = catman->GetCategoryEntry("command-line-handler", entry,
contractID);
rv = catman->GetCategoryEntry("command-line-handler",
entry.get(),
getter_Copies(contractID));
if (NS_FAILED(rv))
continue;

Expand Down Expand Up @@ -561,7 +562,8 @@ nsCommandLine::EnumerateValidators(EnumerateValidatorsCallback aCallback, void *

nsCString contractID;
rv = catman->GetCategoryEntry("command-line-validator",
entry, contractID);
entry.get(),
getter_Copies(contractID));
if (contractID.IsVoid())
continue;

Expand Down
9 changes: 4 additions & 5 deletions toolkit/xre/nsAppStartupNotifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ NS_IMETHODIMP nsAppStartupNotifier::Observe(nsISupports *aSubject, const char *a
do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);

nsDependentCString topic(aTopic);

nsCOMPtr<nsISimpleEnumerator> enumerator;
rv = categoryManager->EnumerateCategory(topic,
rv = categoryManager->EnumerateCategory(aTopic,
getter_AddRefs(enumerator));
if (NS_FAILED(rv)) return rv;

Expand All @@ -46,8 +44,9 @@ NS_IMETHODIMP nsAppStartupNotifier::Observe(nsISupports *aSubject, const char *a
rv = category->GetData(categoryEntry);

nsCString contractId;
categoryManager->GetCategoryEntry(topic, categoryEntry,
contractId);
categoryManager->GetCategoryEntry(aTopic,
categoryEntry.get(),
getter_Copies(contractId));

if (NS_SUCCEEDED(rv)) {

Expand Down
3 changes: 2 additions & 1 deletion uriloader/base/nsURILoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,8 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest *request, nsISupports *
if (catman) {
nsCString contractidString;
rv = catman->GetCategoryEntry(NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY,
mContentType, contractidString);
mContentType.get(),
getter_Copies(contractidString));
if (NS_SUCCEEDED(rv) && !contractidString.IsEmpty()) {
LOG((" Listener contractid for '%s' is '%s'",
mContentType.get(), contractidString.get()));
Expand Down
3 changes: 2 additions & 1 deletion uriloader/exthandler/nsExternalHelperAppService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2693,7 +2693,8 @@ nsExternalHelperAppService::GetTypeFromExtension(const nsACString& aFileExt,
// Read the MIME type from the category entry, if available
nsCString type;
nsresult rv = catMan->GetCategoryEntry("ext-to-type-mapping",
lowercaseFileExt, type);
lowercaseFileExt.get(),
getter_Copies(type));
if (NS_SUCCEEDED(rv)) {
aContentType = type;
return NS_OK;
Expand Down
10 changes: 7 additions & 3 deletions xpcom/components/nsCategoryCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include "nsCategoryCache.h"

nsCategoryObserver::nsCategoryObserver(const nsACString& aCategory)
nsCategoryObserver::nsCategoryObserver(const char* aCategory)
: mCategory(aCategory)
, mCallback(nullptr)
, mClosure(nullptr)
Expand Down Expand Up @@ -43,7 +43,9 @@ nsCategoryObserver::nsCategoryObserver(const nsACString& aCategory)
strings->GetNext(entryName);

nsCString entryValue;
rv = catMan->GetCategoryEntry(aCategory, entryName, entryValue);
rv = catMan->GetCategoryEntry(aCategory,
entryName.get(),
getter_Copies(entryValue));
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsISupports> service = do_GetService(entryValue.get());
if (service) {
Expand Down Expand Up @@ -149,7 +151,9 @@ nsCategoryObserver::Observe(nsISupports* aSubject, const char* aTopic,
}

nsCString entryValue;
catMan->GetCategoryEntry(mCategory, str, entryValue);
catMan->GetCategoryEntry(mCategory.get(),
str.get(),
getter_Copies(entryValue));

nsCOMPtr<nsISupports> service = do_GetService(entryValue.get());

Expand Down
4 changes: 2 additions & 2 deletions xpcom/components/nsCategoryCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class nsCategoryObserver final : public nsIObserver
~nsCategoryObserver();

public:
explicit nsCategoryObserver(const nsACString& aCategory);
explicit nsCategoryObserver(const char* aCategory);

void ListenerDied();
void SetListener(void(aCallback)(void*), void* aClosure);
Expand Down Expand Up @@ -104,7 +104,7 @@ class nsCategoryCache final
// Lazy initialization, so that services in this category can't
// cause reentrant getService (bug 386376)
if (!mObserver) {
mObserver = new nsCategoryObserver(mCategoryName);
mObserver = new nsCategoryObserver(mCategoryName.get());
mObserver->SetListener(nsCategoryCache<T>::OnCategoryChanged, this);
}
}
Expand Down
Loading

0 comments on commit 91a3707

Please sign in to comment.