Skip to content

Commit 8a72cf2

Browse files
committed
Bug 1390428 (part 2, attempt 2) - Remove more nsXPIDLCString local variables. r=erahm.
--HG-- extra : rebase_source : 69d58b0cfb56efc6b03d8e2d7be2ce3c3e6cd843
1 parent 6a1689d commit 8a72cf2

36 files changed

+208
-197
lines changed

dom/base/nsContentUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7132,12 +7132,12 @@ nsContentUtils::FindInternalContentViewer(const nsACString& aType,
71327132

71337133
nsCOMPtr<nsIDocumentLoaderFactory> docFactory;
71347134

7135-
nsXPIDLCString contractID;
7135+
nsCString contractID;
71367136
nsresult rv = catMan->GetCategoryEntry("Gecko-Content-Viewers",
71377137
PromiseFlatCString(aType).get(),
71387138
getter_Copies(contractID));
71397139
if (NS_SUCCEEDED(rv)) {
7140-
docFactory = do_GetService(contractID);
7140+
docFactory = do_GetService(contractID.get());
71417141
if (docFactory && aLoaderType) {
71427142
if (contractID.EqualsLiteral(CONTENT_DLF_CONTRACTID))
71437143
*aLoaderType = TYPE_CONTENT;

dom/base/nsDOMClassInfo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -806,9 +806,9 @@ nsDOMClassInfo::PostCreatePrototype(JSContext * cx, JSObject * aProto)
806806
getter_AddRefs(if_info));
807807

808808
if (if_info) {
809-
nsXPIDLCString name;
809+
nsCString name;
810810
if_info->GetName(getter_Copies(name));
811-
NS_ASSERTION(nsCRT::strcmp(CutPrefix(name), mData->mClass.name) == 0,
811+
NS_ASSERTION(nsCRT::strcmp(CutPrefix(name.get()), mData->mClass.name) == 0,
812812
"Class name and proto chain interface name mismatch!");
813813
}
814814
}
@@ -959,11 +959,11 @@ DefineInterfaceConstants(JSContext *cx, JS::Handle<JSObject*> obj, const nsIID *
959959

960960
JS::Rooted<JS::Value> v(cx);
961961
for (i = parent_constant_count; i < constant_count; i++) {
962-
nsXPIDLCString name;
962+
nsCString name;
963963
rv = if_info->GetConstant(i, &v, getter_Copies(name));
964964
NS_ENSURE_TRUE(NS_SUCCEEDED(rv), rv);
965965

966-
if (!::JS_DefineProperty(cx, obj, name, v,
966+
if (!::JS_DefineProperty(cx, obj, name.get(), v,
967967
JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT,
968968
JS_STUBGETTER, JS_STUBSETTER)) {
969969
return NS_ERROR_UNEXPECTED;

dom/base/nsDocument.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,12 +1007,12 @@ nsExternalResourceMap::PendingLoad::SetupViewer(nsIRequest* aRequest,
10071007
nsCOMPtr<nsICategoryManager> catMan =
10081008
do_GetService(NS_CATEGORYMANAGER_CONTRACTID);
10091009
NS_ENSURE_TRUE(catMan, NS_ERROR_NOT_AVAILABLE);
1010-
nsXPIDLCString contractId;
1010+
nsCString contractId;
10111011
nsresult rv = catMan->GetCategoryEntry("Gecko-Content-Viewers", type.get(),
10121012
getter_Copies(contractId));
10131013
NS_ENSURE_SUCCESS(rv, rv);
10141014
nsCOMPtr<nsIDocumentLoaderFactory> docLoaderFactory =
1015-
do_GetService(contractId);
1015+
do_GetService(contractId.get());
10161016
NS_ENSURE_TRUE(docLoaderFactory, NS_ERROR_NOT_AVAILABLE);
10171017

10181018
nsCOMPtr<nsIContentViewer> viewer;

dom/base/nsScriptNameSpaceManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ nsScriptNameSpaceManager::OperateCategoryEntryHash(nsICategoryManager* aCategory
315315
return NS_OK;
316316
}
317317

318-
nsXPIDLCString contractId;
318+
nsCString contractId;
319319
rv = aCategoryManager->GetCategoryEntry(aCategory, categoryEntry.get(),
320320
getter_Copies(contractId));
321321
NS_ENSURE_SUCCESS(rv, rv);
@@ -325,7 +325,7 @@ nsScriptNameSpaceManager::OperateCategoryEntryHash(nsICategoryManager* aCategory
325325
NS_ENSURE_SUCCESS(rv, rv);
326326

327327
nsCID *cidPtr;
328-
rv = registrar->ContractIDToCID(contractId, &cidPtr);
328+
rv = registrar->ContractIDToCID(contractId.get(), &cidPtr);
329329

330330
if (NS_FAILED(rv)) {
331331
NS_WARNING("Bad contract id registed with the script namespace manager");

dom/plugins/base/nsPluginHost.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,11 +2708,11 @@ nsPluginHost::RegisterWithCategoryManager(const nsCString& aMimeType,
27082708
}
27092709

27102710
// Only delete the entry if a plugin registered for it
2711-
nsXPIDLCString value;
2711+
nsCString value;
27122712
nsresult rv = catMan->GetCategoryEntry("Gecko-Content-Viewers",
27132713
aMimeType.get(),
27142714
getter_Copies(value));
2715-
if (NS_SUCCEEDED(rv) && strcmp(value, contractId) == 0) {
2715+
if (NS_SUCCEEDED(rv) && strcmp(value.get(), contractId) == 0) {
27162716
catMan->DeleteCategoryEntry("Gecko-Content-Viewers",
27172717
aMimeType.get(),
27182718
true);

dom/push/PushNotifier.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,14 +313,14 @@ PushDispatcher::DoNotifyObservers(nsISupports *aSubject, const char *aTopic,
313313
nsCOMPtr<nsICategoryManager> catMan =
314314
do_GetService(NS_CATEGORYMANAGER_CONTRACTID);
315315
if (catMan) {
316-
nsXPIDLCString contractId;
316+
nsCString contractId;
317317
nsresult rv = catMan->GetCategoryEntry("push",
318318
mScope.BeginReading(),
319319
getter_Copies(contractId));
320320
if (NS_SUCCEEDED(rv)) {
321321
// Ensure the service is created - we don't need to do anything with
322322
// it though - we assume the service constructor attaches a listener.
323-
nsCOMPtr<nsISupports> service = do_GetService(contractId);
323+
nsCOMPtr<nsISupports> service = do_GetService(contractId.get());
324324
}
325325
}
326326
return obsService->NotifyObservers(aSubject, aTopic,

extensions/pref/autoconfig/src/nsReadConfig.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ NS_IMETHODIMP nsReadConfig::Observe(nsISupports *aSubject, const char *aTopic, c
116116
nsresult nsReadConfig::readConfigFile()
117117
{
118118
nsresult rv = NS_OK;
119-
nsXPIDLCString lockFileName;
120-
nsXPIDLCString lockVendor;
119+
nsCString lockFileName;
120+
nsCString lockVendor;
121121
uint32_t fileNameLen = 0;
122122

123123
nsCOMPtr<nsIPrefBranch> defaultPrefBranch;
@@ -193,18 +193,18 @@ nsresult nsReadConfig::readConfigFile()
193193
// If vendor is not nullptr, do this check
194194
if (NS_SUCCEEDED(rv)) {
195195

196-
fileNameLen = strlen(lockFileName);
196+
fileNameLen = strlen(lockFileName.get());
197197

198198
// lockVendor and lockFileName should be the same with the addtion of
199199
// .cfg to the filename by checking this post reading of the cfg file
200200
// this value can be set within the cfg file adding a level of security.
201201

202-
if (PL_strncmp(lockFileName, lockVendor, fileNameLen - 4) != 0)
202+
if (PL_strncmp(lockFileName.get(), lockVendor.get(), fileNameLen - 4) != 0)
203203
return NS_ERROR_FAILURE;
204204
}
205205

206206
// get the value of the autoconfig url
207-
nsXPIDLCString urlName;
207+
nsCString urlName;
208208
rv = prefBranch->GetCharPref("autoadmin.global_config_url",
209209
getter_Copies(urlName));
210210
if (NS_SUCCEEDED(rv) && !urlName.IsEmpty()) {
@@ -214,7 +214,7 @@ nsresult nsReadConfig::readConfigFile()
214214
if (NS_FAILED(rv))
215215
return NS_ERROR_OUT_OF_MEMORY;
216216

217-
rv = mAutoConfig->SetConfigURL(urlName);
217+
rv = mAutoConfig->SetConfigURL(urlName.get());
218218
if (NS_FAILED(rv))
219219
return NS_ERROR_FAILURE;
220220

gfx/thebes/gfxSVGGlyphs.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,12 @@ nsresult
136136
gfxSVGGlyphsDocument::SetupPresentation()
137137
{
138138
nsCOMPtr<nsICategoryManager> catMan = do_GetService(NS_CATEGORYMANAGER_CONTRACTID);
139-
nsXPIDLCString contractId;
139+
nsCString contractId;
140140
nsresult rv = catMan->GetCategoryEntry("Gecko-Content-Viewers", "image/svg+xml", getter_Copies(contractId));
141141
NS_ENSURE_SUCCESS(rv, rv);
142142

143-
nsCOMPtr<nsIDocumentLoaderFactory> docLoaderFactory = do_GetService(contractId);
143+
nsCOMPtr<nsIDocumentLoaderFactory> docLoaderFactory =
144+
do_GetService(contractId.get());
144145
NS_ASSERTION(docLoaderFactory, "Couldn't get DocumentLoaderFactory");
145146

146147
nsCOMPtr<nsIContentViewer> viewer;

image/SVGDocumentWrapper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,12 @@ SVGDocumentWrapper::SetupViewer(nsIRequest* aRequest,
331331
nsCOMPtr<nsICategoryManager> catMan =
332332
do_GetService(NS_CATEGORYMANAGER_CONTRACTID);
333333
NS_ENSURE_TRUE(catMan, NS_ERROR_NOT_AVAILABLE);
334-
nsXPIDLCString contractId;
334+
nsCString contractId;
335335
nsresult rv = catMan->GetCategoryEntry("Gecko-Content-Viewers", IMAGE_SVG_XML,
336336
getter_Copies(contractId));
337337
NS_ENSURE_SUCCESS(rv, rv);
338338
nsCOMPtr<nsIDocumentLoaderFactory> docLoaderFactory =
339-
do_GetService(contractId);
339+
do_GetService(contractId.get());
340340
NS_ENSURE_TRUE(docLoaderFactory, NS_ERROR_NOT_AVAILABLE);
341341

342342
nsCOMPtr<nsIContentViewer> viewer;

intl/strres/nsStringBundle.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ nsStringBundleService::FormatStatusMessage(nsresult aStatus,
670670
nsresult rv;
671671
uint32_t i, argCount = 0;
672672
nsCOMPtr<nsIStringBundle> bundle;
673-
nsXPIDLCString stringBundleURL;
673+
nsCString stringBundleURL;
674674

675675
// XXX hack for mailnews who has already formatted their messages:
676676
if (aStatus == NS_OK && aStatusArg) {
@@ -713,7 +713,7 @@ nsStringBundleService::FormatStatusMessage(nsresult aStatus,
713713
rv = mErrorService->GetErrorStringBundle(NS_ERROR_GET_MODULE(aStatus),
714714
getter_Copies(stringBundleURL));
715715
if (NS_SUCCEEDED(rv)) {
716-
getStringBundle(stringBundleURL, getter_AddRefs(bundle));
716+
getStringBundle(stringBundleURL.get(), getter_AddRefs(bundle));
717717
rv = FormatWithBundle(bundle, aStatus, argCount, argArray, result);
718718
}
719719
if (NS_FAILED(rv)) {

0 commit comments

Comments
 (0)