зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1313150 - Remove |weak| parameter from nsIMutableArray methods. r=froydnj
MozReview-Commit-ID: 7JoD4VYzZp3 --HG-- extra : rebase_source : 5db437f1c34608aa223916874d62b48c59baeae8
This commit is contained in:
Родитель
5f6fdc1ef0
Коммит
dbd92543c6
|
@ -21,7 +21,7 @@ nsAccessibleRelation::nsAccessibleRelation(uint32_t aType,
|
|||
mTargets = do_CreateInstance(NS_ARRAY_CONTRACTID);
|
||||
Accessible* targetAcc = nullptr;
|
||||
while ((targetAcc = aRel->Next()))
|
||||
mTargets->AppendElement(static_cast<nsIAccessible*>(ToXPC(targetAcc)), false);
|
||||
mTargets->AppendElement(static_cast<nsIAccessible*>(ToXPC(targetAcc)));
|
||||
}
|
||||
|
||||
nsAccessibleRelation::nsAccessibleRelation(uint32_t aType,
|
||||
|
@ -31,8 +31,7 @@ nsAccessibleRelation::nsAccessibleRelation(uint32_t aType,
|
|||
mTargets = do_CreateInstance(NS_ARRAY_CONTRACTID);
|
||||
for (uint32_t idx = 0; idx < aTargets->Length(); ++idx) {
|
||||
mTargets->AppendElement(
|
||||
static_cast<nsIAccessible*>(ToXPC(aTargets->ElementAt(idx))),
|
||||
false);
|
||||
static_cast<nsIAccessible*>(ToXPC(aTargets->ElementAt(idx))));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ xpcAccessible::GetChildren(nsIArray** aChildren)
|
|||
uint32_t childCount = IntlGeneric().ChildCount();
|
||||
for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
AccessibleOrProxy child = IntlGeneric().ChildAt(childIdx);
|
||||
children->AppendElement(static_cast<nsIAccessible*>(ToXPC(child)), false);
|
||||
children->AppendElement(static_cast<nsIAccessible*>(ToXPC(child)));
|
||||
}
|
||||
|
||||
children.forget(aChildren);
|
||||
|
@ -555,7 +555,7 @@ xpcAccessible::GetRelations(nsIArray** aRelations)
|
|||
uint32_t targets = 0;
|
||||
relation->GetTargetsCount(&targets);
|
||||
if (targets)
|
||||
relations->AppendElement(relation, false);
|
||||
relations->AppendElement(relation);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -540,8 +540,7 @@ xpcAccessibleHyperText::GetSelectionRanges(nsIArray** aRanges)
|
|||
Intl()->SelectionRanges(&ranges);
|
||||
uint32_t len = ranges.Length();
|
||||
for (uint32_t idx = 0; idx < len; idx++)
|
||||
xpcRanges->AppendElement(new xpcAccessibleTextRange(Move(ranges[idx])),
|
||||
false);
|
||||
xpcRanges->AppendElement(new xpcAccessibleTextRange(Move(ranges[idx])));
|
||||
|
||||
xpcRanges.forget(aRanges);
|
||||
return NS_OK;
|
||||
|
@ -565,8 +564,7 @@ xpcAccessibleHyperText::GetVisibleRanges(nsIArray** aRanges)
|
|||
Intl()->VisibleRanges(&ranges);
|
||||
uint32_t len = ranges.Length();
|
||||
for (uint32_t idx = 0; idx < len; idx++)
|
||||
xpcRanges->AppendElement(new xpcAccessibleTextRange(Move(ranges[idx])),
|
||||
false);
|
||||
xpcRanges->AppendElement(new xpcAccessibleTextRange(Move(ranges[idx])));
|
||||
|
||||
xpcRanges.forget(aRanges);
|
||||
return NS_OK;
|
||||
|
|
|
@ -34,7 +34,7 @@ xpcAccessibleSelectable::GetSelectedItems(nsIArray** aSelectedItems)
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
for (uint32_t idx = 0; idx < itemCount; idx++)
|
||||
xpcItems->AppendElement(static_cast<nsIAccessible*>(ToXPC(items[idx])), false);
|
||||
xpcItems->AppendElement(static_cast<nsIAccessible*>(ToXPC(items[idx])));
|
||||
|
||||
NS_ADDREF(*aSelectedItems = xpcItems);
|
||||
return NS_OK;
|
||||
|
|
|
@ -279,7 +279,7 @@ xpcAccessibleTable::GetSelectedCells(nsIArray** aSelectedCells)
|
|||
uint32_t totalCount = cellsArray.Length();
|
||||
for (uint32_t idx = 0; idx < totalCount; idx++) {
|
||||
Accessible* cell = cellsArray.ElementAt(idx);
|
||||
selCells->AppendElement(static_cast<nsIAccessible*>(ToXPC(cell)), false);
|
||||
selCells->AppendElement(static_cast<nsIAccessible*>(ToXPC(cell)));
|
||||
}
|
||||
|
||||
NS_ADDREF(*aSelectedCells = selCells);
|
||||
|
|
|
@ -115,8 +115,7 @@ xpcAccessibleTableCell::GetColumnHeaderCells(nsIArray** aHeaderCells)
|
|||
NS_ENSURE_TRUE(cells, NS_ERROR_FAILURE);
|
||||
|
||||
for (uint32_t idx = 0; idx < headerCells.Length(); idx++) {
|
||||
cells->AppendElement(static_cast<nsIAccessible*>(ToXPC(headerCells[idx])),
|
||||
false);
|
||||
cells->AppendElement(static_cast<nsIAccessible*>(ToXPC(headerCells[idx])));
|
||||
}
|
||||
|
||||
NS_ADDREF(*aHeaderCells = cells);
|
||||
|
@ -139,8 +138,7 @@ xpcAccessibleTableCell::GetRowHeaderCells(nsIArray** aHeaderCells)
|
|||
NS_ENSURE_TRUE(cells, NS_ERROR_FAILURE);
|
||||
|
||||
for (uint32_t idx = 0; idx < headerCells.Length(); idx++) {
|
||||
cells->AppendElement(static_cast<nsIAccessible*>(ToXPC(headerCells[idx])),
|
||||
false);
|
||||
cells->AppendElement(static_cast<nsIAccessible*>(ToXPC(headerCells[idx])));
|
||||
}
|
||||
|
||||
NS_ADDREF(*aHeaderCells = cells);
|
||||
|
|
|
@ -87,7 +87,7 @@ xpcAccessibleTextRange::GetEmbeddedChildren(nsIArray** aList)
|
|||
|
||||
uint32_t len = objects.Length();
|
||||
for (uint32_t idx = 0; idx < len; idx++)
|
||||
xpcList->AppendElement(static_cast<nsIAccessible*>(ToXPC(objects[idx])), false);
|
||||
xpcList->AppendElement(static_cast<nsIAccessible*>(ToXPC(objects[idx])));
|
||||
|
||||
xpcList.forget(aList);
|
||||
|
||||
|
|
|
@ -6848,7 +6848,7 @@ nsDocShell::RefreshURI(nsIURI* aURI, int32_t aDelay, bool aRepeat,
|
|||
if (busyFlags & BUSY_FLAGS_BUSY || (!mIsActive && mDisableMetaRefreshWhenInactive)) {
|
||||
// We don't want to create the timer right now. Instead queue up the request
|
||||
// and trigger the timer in EndPageLoad() or whenever we become active.
|
||||
mRefreshURIList->AppendElement(refreshTimer, /*weak =*/ false);
|
||||
mRefreshURIList->AppendElement(refreshTimer);
|
||||
} else {
|
||||
// There is no page loading going on right now. Create the
|
||||
// timer and fire it right away.
|
||||
|
@ -6860,7 +6860,7 @@ nsDocShell::RefreshURI(nsIURI* aURI, int32_t aDelay, bool aRepeat,
|
|||
NS_NewTimerWithCallback(refreshTimer, aDelay, nsITimer::TYPE_ONE_SHOT,
|
||||
win->TabGroup()->EventTargetFor(TaskCategory::Network)));
|
||||
|
||||
mRefreshURIList->AppendElement(timer, /*weak =*/ false); // owning timer ref
|
||||
mRefreshURIList->AppendElement(timer); // owning timer ref
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -7287,7 +7287,7 @@ nsDocShell::SuspendRefreshURIs()
|
|||
NS_ASSERTION(rt,
|
||||
"RefreshURIList timer callbacks should only be RefreshTimer objects");
|
||||
|
||||
mRefreshURIList->ReplaceElementAt(rt, i, /*weak =*/ false);
|
||||
mRefreshURIList->ReplaceElementAt(rt, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7352,7 +7352,7 @@ nsDocShell::RefreshURIFromQueue()
|
|||
// its corresponding timer object, so that in case another
|
||||
// load comes through before the timer can go off, the timer will
|
||||
// get cancelled in CancelRefreshURITimer()
|
||||
mRefreshURIList->ReplaceElementAt(timer, n, /*weak =*/ false);
|
||||
mRefreshURIList->ReplaceElementAt(timer, n);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -256,7 +256,7 @@ ContentPermissionType::GetOptions(nsIArray** aOptions)
|
|||
rv = isupportsString->SetData(mOptions[i]);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = options->AppendElement(isupportsString, false);
|
||||
rv = options->AppendElement(isupportsString);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
|
@ -276,7 +276,7 @@ nsContentPermissionUtils::ConvertPermissionRequestToArray(nsTArray<PermissionReq
|
|||
new ContentPermissionType(aSrcArray[i].type(),
|
||||
aSrcArray[i].access(),
|
||||
aSrcArray[i].options());
|
||||
aDesArray->AppendElement(cpt, false);
|
||||
aDesArray->AppendElement(cpt);
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ nsContentPermissionUtils::CreatePermissionArray(const nsACString& aType,
|
|||
RefPtr<ContentPermissionType> permType = new ContentPermissionType(aType,
|
||||
aAccess,
|
||||
aOptions);
|
||||
types->AppendElement(permType, false);
|
||||
types->AppendElement(permType);
|
||||
types.forget(aTypesArray);
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -2523,7 +2523,7 @@ nsDOMWindowUtils::AudioDevices(uint16_t aSide, nsIArray** aDevices)
|
|||
? CubebUtils::Side::Input
|
||||
: CubebUtils::Side::Output);
|
||||
for (auto device: collection) {
|
||||
devices->AppendElement(device, false);
|
||||
devices->AppendElement(device);
|
||||
}
|
||||
|
||||
devices.forget(aDevices);
|
||||
|
|
|
@ -432,7 +432,7 @@ nsScriptErrorBase::GetNotes(nsIArray** aNotes)
|
|||
|
||||
uint32_t len = mNotes.Length();
|
||||
for (uint32_t i = 0; i < len; i++)
|
||||
array->AppendElement(mNotes[i], false);
|
||||
array->AppendElement(mNotes[i]);
|
||||
array.forget(aNotes);
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -968,7 +968,7 @@ DataTransfer::GetTransferables(nsILoadContext* aLoadContext)
|
|||
for (uint32_t i = 0; i < count; i++) {
|
||||
nsCOMPtr<nsITransferable> transferable = GetTransferable(i, aLoadContext);
|
||||
if (transferable) {
|
||||
transArray->AppendElement(transferable, /*weak =*/ false);
|
||||
transArray->AppendElement(transferable);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -397,7 +397,7 @@ EventListenerService::NotifyAboutMainThreadListenerChangeInternal(dom::EventTarg
|
|||
mPendingListenerChangesSet.LookupForAdd(aTarget).OrInsert(
|
||||
[this, aTarget] () {
|
||||
EventListenerChange* c = new EventListenerChange(aTarget);
|
||||
mPendingListenerChanges->AppendElement(c, false);
|
||||
mPendingListenerChanges->AppendElement(c);
|
||||
return c;
|
||||
});
|
||||
changes->AddChangedListenerName(aName);
|
||||
|
|
|
@ -1917,8 +1917,7 @@ HTMLFormElement::CheckFormValidity(nsIMutableArray* aInvalidElements) const
|
|||
// Add all unhandled invalid controls to aInvalidElements if the caller
|
||||
// requested them.
|
||||
if (defaultAction && aInvalidElements) {
|
||||
aInvalidElements->AppendElement(ToSupports(sortedControls[i]),
|
||||
false);
|
||||
aInvalidElements->AppendElement(ToSupports(sortedControls[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -170,7 +170,7 @@ nsIConstraintValidation::ReportValidity()
|
|||
|
||||
nsCOMPtr<nsIMutableArray> invalidElements =
|
||||
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
|
||||
invalidElements->AppendElement(content, false);
|
||||
invalidElements->AppendElement(content);
|
||||
|
||||
NS_ENSURE_SUCCESS(rv, true);
|
||||
nsCOMPtr<nsISupports> inst;
|
||||
|
|
|
@ -2518,7 +2518,7 @@ MediaManager::GetUserMedia(nsPIDOMWindowInner* aWindow,
|
|||
nsCOMPtr<nsIMutableArray> devicesCopy = nsArray::Create(); // before we give up devices below
|
||||
if (!askPermission) {
|
||||
for (auto& device : **devices) {
|
||||
nsresult rv = devicesCopy->AppendElement(device, /*weak =*/ false);
|
||||
nsresult rv = devicesCopy->AppendElement(device);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return;
|
||||
}
|
||||
|
@ -3317,7 +3317,7 @@ MediaManager::GetActiveMediaCaptureWindows(nsIArray** aArray)
|
|||
if (winListener->CapturingVideo() || winListener->CapturingAudio() ||
|
||||
winListener->CapturingScreen() || winListener->CapturingWindow() ||
|
||||
winListener->CapturingApplication()) {
|
||||
array->AppendElement(window, /*weak =*/ false);
|
||||
array->AppendElement(window);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -192,7 +192,7 @@ PaymentDetailsModifier::Create(const IPCPaymentDetailsModifier& aIPCModifier,
|
|||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
rv = items->AppendElement(additionalItem, false);
|
||||
rv = items->AppendElement(additionalItem);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ PaymentDetails::Create(const IPCPaymentDetails& aIPCDetails,
|
|||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
rv = items->AppendElement(item, false);
|
||||
rv = items->AppendElement(item);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
@ -379,7 +379,7 @@ PaymentDetails::Create(const IPCPaymentDetails& aIPCDetails,
|
|||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
rv = options->AppendElement(option, false);
|
||||
rv = options->AppendElement(option);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
@ -397,7 +397,7 @@ PaymentDetails::Create(const IPCPaymentDetails& aIPCDetails,
|
|||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
rv = detailsModifiers->AppendElement(detailsModifier, false);
|
||||
rv = detailsModifiers->AppendElement(detailsModifier);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ PaymentRequestParent::RecvRequestPayment(const IPCPaymentActionRequest& aRequest
|
|||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return IPC_FAIL_NO_REASON(this);
|
||||
}
|
||||
rv = methodData->AppendElement(method, false);
|
||||
rv = methodData->AppendElement(method);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return IPC_FAIL_NO_REASON(this);
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ PresentationDeviceManager::GetAvailableDevices(nsIArray* aPresentationUrls, nsIA
|
|||
nsCOMPtr<nsIMutableArray> devices = do_CreateInstance(NS_ARRAY_CONTRACTID);
|
||||
for (uint32_t i = 0; i < mDevices.Length(); ++i) {
|
||||
if (presentationUrls.IsEmpty()) {
|
||||
devices->AppendElement(mDevices[i], false);
|
||||
devices->AppendElement(mDevices[i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -193,7 +193,7 @@ PresentationDeviceManager::GetAvailableDevices(nsIArray* aPresentationUrls, nsIA
|
|||
if (NS_SUCCEEDED(mDevices[i]->IsRequestedUrlSupported(presentationUrls[j],
|
||||
&isSupported)) &&
|
||||
isSupported) {
|
||||
devices->AppendElement(mDevices[i], false);
|
||||
devices->AppendElement(mDevices[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ ConvertURLArrayHelper(const nsTArray<nsString>& aUrls, nsIArray** aResult)
|
|||
return rv;
|
||||
}
|
||||
|
||||
rv = urls->AppendElement(isupportsString, false);
|
||||
rv = urls->AppendElement(isupportsString);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -174,7 +174,7 @@ TCPPresentationChannelDescription::GetTcpAddress(nsIArray** aRetVal)
|
|||
}
|
||||
address->SetData(mAddress);
|
||||
|
||||
array->AppendElement(address, false);
|
||||
array->AppendElement(address);
|
||||
array.forget(aRetVal);
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -3734,7 +3734,7 @@ ServiceWorkerManager::GetAllRegistrations(nsIArray** aResult)
|
|||
continue;
|
||||
}
|
||||
|
||||
array->AppendElement(reg, false);
|
||||
array->AppendElement(reg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1402,7 +1402,7 @@ nsXULTemplateBuilder::LoadDataSourceUrls(nsIDocument* aDocument,
|
|||
getter_AddRefs(dsnode));
|
||||
|
||||
if (dsnode)
|
||||
uriList->AppendElement(dsnode, false);
|
||||
uriList->AppendElement(dsnode);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1420,7 +1420,7 @@ nsXULTemplateBuilder::LoadDataSourceUrls(nsIDocument* aDocument,
|
|||
if (!isTrusted && NS_FAILED(docPrincipal->CheckMayLoad(uri, true, false)))
|
||||
continue;
|
||||
|
||||
uriList->AppendElement(uri, false);
|
||||
uriList->AppendElement(uri);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMNode> rootNode = do_QueryInterface(mRoot);
|
||||
|
|
|
@ -2765,7 +2765,7 @@ HTMLEditor::GetLinkedObjects(nsIArray** aNodeList)
|
|||
nsCOMPtr<nsIURIRefObject> refObject;
|
||||
rv = NS_NewHTMLURIRefObject(getter_AddRefs(refObject), node);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nodes->AppendElement(refObject, false);
|
||||
nodes->AppendElement(refObject);
|
||||
}
|
||||
}
|
||||
iter->Next();
|
||||
|
@ -3060,7 +3060,7 @@ HTMLEditor::GetEmbeddedObjects(nsIArray** aNodeList)
|
|||
(element->IsHTMLElement(nsGkAtoms::body) &&
|
||||
element->HasAttr(kNameSpaceID_None, nsGkAtoms::background))) {
|
||||
nsCOMPtr<nsIDOMNode> domNode = do_QueryInterface(node);
|
||||
nodes->AppendElement(domNode, false);
|
||||
nodes->AppendElement(domNode);
|
||||
}
|
||||
}
|
||||
iter->Next();
|
||||
|
|
|
@ -232,7 +232,7 @@ nsStringBundle::GetCombinedEnumeration(nsIStringBundleOverride* aOverrideStrings
|
|||
|
||||
rv = overrideEnumerator->GetNext(getter_AddRefs(supports));
|
||||
if (NS_SUCCEEDED(rv))
|
||||
resultArray->AppendElement(supports, false);
|
||||
resultArray->AppendElement(supports);
|
||||
|
||||
rv = overrideEnumerator->HasMoreElements(&hasMore);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -261,7 +261,7 @@ nsStringBundle::GetCombinedEnumeration(nsIStringBundleOverride* aOverrideStrings
|
|||
|
||||
// if it isn't there, then it is safe to append
|
||||
if (NS_FAILED(rv))
|
||||
resultArray->AppendElement(propElement, false);
|
||||
resultArray->AppendElement(propElement);
|
||||
}
|
||||
|
||||
rv = propEnumerator->HasMoreElements(&hasMore);
|
||||
|
|
|
@ -259,7 +259,7 @@ inDOMUtils::GetCSSStyleRules(nsIDOMElement *aElement,
|
|||
if (decl) {
|
||||
css::Rule* owningRule = decl->GetOwningRule();
|
||||
if (owningRule) {
|
||||
rules->AppendElement(owningRule, /*weak =*/ false);
|
||||
rules->AppendElement(owningRule);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -310,7 +310,7 @@ inDOMUtils::GetCSSStyleRules(nsIDOMElement *aElement,
|
|||
}
|
||||
}
|
||||
if (rule) {
|
||||
rules->AppendElement(static_cast<css::Rule*>(rule), false);
|
||||
rules->AppendElement(static_cast<css::Rule*>(rule));
|
||||
} else {
|
||||
MOZ_ASSERT_UNREACHABLE("We should be able to map a raw rule to a rule");
|
||||
}
|
||||
|
@ -1070,7 +1070,7 @@ inDOMUtils::GetBindingURLs(nsIDOMElement *aElement, nsIArray **_retval)
|
|||
nsXBLBinding *binding = content->GetXBLBinding();
|
||||
|
||||
while (binding) {
|
||||
urls->AppendElement(binding->PrototypeBinding()->BindingURI(), false);
|
||||
urls->AppendElement(binding->PrototypeBinding()->BindingURI());
|
||||
binding = binding->GetBaseBinding();
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ nsLayoutDebugCLH::Handle(nsICommandLine* aCmdLine)
|
|||
NS_ENSURE_TRUE(scriptableURL, NS_ERROR_FAILURE);
|
||||
|
||||
scriptableURL->SetData(url);
|
||||
argsArray->AppendElement(scriptableURL, /*weak =*/ false);
|
||||
argsArray->AppendElement(scriptableURL);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIWindowWatcher> wwatch =
|
||||
|
|
|
@ -296,7 +296,7 @@ BackgroundFileSaver::GetSignatureInfo(nsIArray** aSignatureInfo)
|
|||
}
|
||||
nsCOMPtr<nsIMutableArray> sigArray = do_CreateInstance(NS_ARRAY_CONTRACTID);
|
||||
for (int i = 0; i < mSignatureInfo.Count(); ++i) {
|
||||
sigArray->AppendElement(mSignatureInfo[i], false);
|
||||
sigArray->AppendElement(mSignatureInfo[i]);
|
||||
}
|
||||
*aSignatureInfo = sigArray;
|
||||
NS_IF_ADDREF(*aSignatureInfo);
|
||||
|
|
|
@ -2300,7 +2300,7 @@ nsCookieService::CreatePurgeList(nsICookie2* aCookie)
|
|||
{
|
||||
nsCOMPtr<nsIMutableArray> removedList =
|
||||
do_CreateInstance(NS_ARRAY_CONTRACTID);
|
||||
removedList->AppendElement(aCookie, false);
|
||||
removedList->AppendElement(aCookie);
|
||||
return removedList.forget();
|
||||
}
|
||||
|
||||
|
@ -4651,7 +4651,7 @@ nsCookieService::PurgeCookies(int64_t aCurrentTimeInUsec)
|
|||
|
||||
// check if the cookie has expired
|
||||
if (cookie->Expiry() <= currentTime) {
|
||||
removedList->AppendElement(cookie, false);
|
||||
removedList->AppendElement(cookie);
|
||||
COOKIE_LOGEVICTED(cookie, "Cookie expired");
|
||||
|
||||
// remove from list; do not increment our iterator
|
||||
|
@ -4694,7 +4694,7 @@ nsCookieService::PurgeCookies(int64_t aCurrentTimeInUsec)
|
|||
purgeList.Sort(CompareCookiesByIndex());
|
||||
for (PurgeList::index_type i = purgeList.Length(); i--; ) {
|
||||
nsCookie *cookie = purgeList[i].Cookie();
|
||||
removedList->AppendElement(cookie, false);
|
||||
removedList->AppendElement(cookie);
|
||||
COOKIE_LOGEVICTED(cookie, "Cookie too old");
|
||||
|
||||
RemoveCookieFromList(purgeList[i], paramsArray);
|
||||
|
|
|
@ -110,13 +110,13 @@ nsNSSDialogs::ConfirmDownloadCACert(nsIInterfaceRequestor* ctx,
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsresult rv = argArray->AppendElement(cert, false);
|
||||
nsresult rv = argArray->AppendElement(cert);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIWritablePropertyBag2> retVals = new nsHashPropertyBag();
|
||||
rv = argArray->AppendElement(retVals, false);
|
||||
rv = argArray->AppendElement(retVals);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ nsNSSDialogs::ChooseCertificate(nsIInterfaceRequestor* ctx,
|
|||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
rv = argArray->AppendElement(hostnameVariant, false);
|
||||
rv = argArray->AppendElement(hostnameVariant);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ nsNSSDialogs::ChooseCertificate(nsIInterfaceRequestor* ctx,
|
|||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
rv = argArray->AppendElement(organizationVariant, false);
|
||||
rv = argArray->AppendElement(organizationVariant);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ nsNSSDialogs::ChooseCertificate(nsIInterfaceRequestor* ctx,
|
|||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
rv = argArray->AppendElement(issuerOrgVariant, false);
|
||||
rv = argArray->AppendElement(issuerOrgVariant);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
@ -224,18 +224,18 @@ nsNSSDialogs::ChooseCertificate(nsIInterfaceRequestor* ctx,
|
|||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
rv = argArray->AppendElement(portVariant, false);
|
||||
rv = argArray->AppendElement(portVariant);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = argArray->AppendElement(certList, false);
|
||||
rv = argArray->AppendElement(certList);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIWritablePropertyBag2> retVals = new nsHashPropertyBag();
|
||||
rv = argArray->AppendElement(retVals, false);
|
||||
rv = argArray->AppendElement(retVals);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -200,7 +200,7 @@ PKCS11ModuleDB::ListModules(nsISimpleEnumerator** _retval)
|
|||
for (SECMODModuleList* list = SECMOD_GetDefaultModuleList(); list;
|
||||
list = list->next) {
|
||||
nsCOMPtr<nsIPKCS11Module> module = new nsPKCS11Module(list->module);
|
||||
nsresult rv = array->AppendElement(module, false);
|
||||
nsresult rv = array->AppendElement(module);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ PKCS11ModuleDB::ListModules(nsISimpleEnumerator** _retval)
|
|||
for (SECMODModuleList* list = SECMOD_GetDeadModuleList(); list;
|
||||
list = list->next) {
|
||||
nsCOMPtr<nsIPKCS11Module> module = new nsPKCS11Module(list->module);
|
||||
nsresult rv = array->AppendElement(module, false);
|
||||
nsresult rv = array->AppendElement(module);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -1121,7 +1121,7 @@ nsCertTree::GetCellText(int32_t row, nsITreeColumn* col,
|
|||
nsCOMPtr<nsISupportsString> text(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
text->SetData(_retval);
|
||||
mCellText->ReplaceElementAt(text, arrayIndex, false);
|
||||
mCellText->ReplaceElementAt(text, arrayIndex);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -174,7 +174,7 @@ buildASN1ObjectFromDER(unsigned char *data,
|
|||
printableItem->SetData((char*)data, len);
|
||||
}
|
||||
data += len;
|
||||
parentObjects->AppendElement(asn1Obj, false);
|
||||
parentObjects->AppendElement(asn1Obj);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -1627,13 +1627,13 @@ ProcessSECAlgorithmID(SECAlgorithmID* algID, nsIASN1Sequence** retSequence)
|
|||
printableItem->SetDisplayValue(text);
|
||||
nsCOMPtr<nsIMutableArray> asn1Objects;
|
||||
sequence->GetASN1Objects(getter_AddRefs(asn1Objects));
|
||||
asn1Objects->AppendElement(printableItem, false);
|
||||
asn1Objects->AppendElement(printableItem);
|
||||
GetPIPNSSBundleString("CertDumpAlgID", text);
|
||||
printableItem->SetDisplayName(text);
|
||||
|
||||
printableItem = new nsNSSASN1PrintableItem();
|
||||
|
||||
asn1Objects->AppendElement(printableItem, false);
|
||||
asn1Objects->AppendElement(printableItem);
|
||||
GetPIPNSSBundleString("CertDumpParams", text);
|
||||
printableItem->SetDisplayName(text);
|
||||
if ((algOIDTag == SEC_OID_ANSIX962_EC_PUBLIC_KEY) &&
|
||||
|
@ -1683,7 +1683,7 @@ ProcessTime(PRTime dispTime,
|
|||
printableItem->SetDisplayName(nsDependentString(displayName));
|
||||
nsCOMPtr<nsIMutableArray> asn1Objects;
|
||||
parentSequence->GetASN1Objects(getter_AddRefs(asn1Objects));
|
||||
asn1Objects->AppendElement(printableItem, false);
|
||||
asn1Objects->AppendElement(printableItem);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1706,7 +1706,7 @@ ProcessSubjectPublicKeyInfo(CERTSubjectPublicKeyInfo* spki,
|
|||
sequenceItem->SetDisplayName(text);
|
||||
nsCOMPtr<nsIMutableArray> asn1Objects;
|
||||
spkiSequence->GetASN1Objects(getter_AddRefs(asn1Objects));
|
||||
asn1Objects->AppendElement(sequenceItem, false);
|
||||
asn1Objects->AppendElement(sequenceItem);
|
||||
|
||||
nsCOMPtr<nsIASN1PrintableItem> printableItem = new nsNSSASN1PrintableItem();
|
||||
|
||||
|
@ -1769,10 +1769,10 @@ ProcessSubjectPublicKeyInfo(CERTSubjectPublicKeyInfo* spki,
|
|||
printableItem->SetDisplayValue(text);
|
||||
GetPIPNSSBundleString("CertDumpSubjPubKey", text);
|
||||
printableItem->SetDisplayName(text);
|
||||
asn1Objects->AppendElement(printableItem, false);
|
||||
asn1Objects->AppendElement(printableItem);
|
||||
|
||||
parentSequence->GetASN1Objects(getter_AddRefs(asn1Objects));
|
||||
asn1Objects->AppendElement(spkiSequence, false);
|
||||
asn1Objects->AppendElement(spkiSequence);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1796,10 +1796,10 @@ ProcessExtensions(CERTCertExtension** extensions,
|
|||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
asn1Objects->AppendElement(newExtension, false);
|
||||
asn1Objects->AppendElement(newExtension);
|
||||
}
|
||||
parentSequence->GetASN1Objects(getter_AddRefs(asn1Objects));
|
||||
asn1Objects->AppendElement(extensionSequence, false);
|
||||
asn1Objects->AppendElement(extensionSequence);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1869,12 +1869,12 @@ nsNSSCertificate::CreateTBSCertificateASN1Struct(nsIASN1Sequence** retSequence)
|
|||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
asn1Objects->AppendElement(printableItem, false);
|
||||
asn1Objects->AppendElement(printableItem);
|
||||
|
||||
rv = ProcessSerialNumberDER(mCert->serialNumber, printableItem);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
asn1Objects->AppendElement(printableItem, false);
|
||||
asn1Objects->AppendElement(printableItem);
|
||||
|
||||
nsCOMPtr<nsIASN1Sequence> algID;
|
||||
rv = ProcessSECAlgorithmID(&mCert->signature, getter_AddRefs(algID));
|
||||
|
@ -1883,7 +1883,7 @@ nsNSSCertificate::CreateTBSCertificateASN1Struct(nsIASN1Sequence** retSequence)
|
|||
|
||||
GetPIPNSSBundleString("CertDumpSigAlg", text);
|
||||
algID->SetDisplayName(text);
|
||||
asn1Objects->AppendElement(algID, false);
|
||||
asn1Objects->AppendElement(algID);
|
||||
|
||||
nsString value;
|
||||
ProcessName(&mCert->issuer, getter_Copies(value));
|
||||
|
@ -1893,12 +1893,12 @@ nsNSSCertificate::CreateTBSCertificateASN1Struct(nsIASN1Sequence** retSequence)
|
|||
printableItem->SetDisplayValue(value);
|
||||
GetPIPNSSBundleString("CertDumpIssuer", text);
|
||||
printableItem->SetDisplayName(text);
|
||||
asn1Objects->AppendElement(printableItem, false);
|
||||
asn1Objects->AppendElement(printableItem);
|
||||
|
||||
nsCOMPtr<nsIASN1Sequence> validitySequence = new nsNSSASN1Sequence();
|
||||
GetPIPNSSBundleString("CertDumpValidity", text);
|
||||
validitySequence->SetDisplayName(text);
|
||||
asn1Objects->AppendElement(validitySequence, false);
|
||||
asn1Objects->AppendElement(validitySequence);
|
||||
GetPIPNSSBundleString("CertDumpNotBefore", text);
|
||||
nsCOMPtr<nsIX509CertValidity> validityData;
|
||||
GetValidity(getter_AddRefs(validityData));
|
||||
|
@ -1923,7 +1923,7 @@ nsNSSCertificate::CreateTBSCertificateASN1Struct(nsIASN1Sequence** retSequence)
|
|||
printableItem->SetDisplayName(text);
|
||||
ProcessName(&mCert->subject, getter_Copies(value));
|
||||
printableItem->SetDisplayValue(value);
|
||||
asn1Objects->AppendElement(printableItem, false);
|
||||
asn1Objects->AppendElement(printableItem);
|
||||
|
||||
rv = ProcessSubjectPublicKeyInfo(&mCert->subjectPublicKeyInfo, sequence);
|
||||
if (NS_FAILED(rv))
|
||||
|
@ -1945,7 +1945,7 @@ nsNSSCertificate::CreateTBSCertificateASN1Struct(nsIASN1Sequence** retSequence)
|
|||
printableItem->SetDisplayValue(text);
|
||||
GetPIPNSSBundleString("CertDumpIssuerUniqueID", text);
|
||||
printableItem->SetDisplayName(text);
|
||||
asn1Objects->AppendElement(printableItem, false);
|
||||
asn1Objects->AppendElement(printableItem);
|
||||
}
|
||||
|
||||
if (mCert->subjectID.data) {
|
||||
|
@ -1962,7 +1962,7 @@ nsNSSCertificate::CreateTBSCertificateASN1Struct(nsIASN1Sequence** retSequence)
|
|||
printableItem->SetDisplayValue(text);
|
||||
GetPIPNSSBundleString("CertDumpSubjectUniqueID", text);
|
||||
printableItem->SetDisplayName(text);
|
||||
asn1Objects->AppendElement(printableItem, false);
|
||||
asn1Objects->AppendElement(printableItem);
|
||||
}
|
||||
if (mCert->extensions) {
|
||||
rv = ProcessExtensions(mCert->extensions, sequence);
|
||||
|
@ -2003,7 +2003,7 @@ nsNSSCertificate::CreateASN1Struct(nsIASN1Object** aRetVal)
|
|||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
asn1Objects->AppendElement(sequence, false);
|
||||
asn1Objects->AppendElement(sequence);
|
||||
nsCOMPtr<nsIASN1Sequence> algID;
|
||||
|
||||
rv = ProcessSECAlgorithmID(&mCert->signatureWrap.signatureAlgorithm,
|
||||
|
@ -2013,7 +2013,7 @@ nsNSSCertificate::CreateASN1Struct(nsIASN1Object** aRetVal)
|
|||
nsString text;
|
||||
GetPIPNSSBundleString("CertDumpSigAlg", text);
|
||||
algID->SetDisplayName(text);
|
||||
asn1Objects->AppendElement(algID, false);
|
||||
asn1Objects->AppendElement(algID);
|
||||
nsCOMPtr<nsIASN1PrintableItem> printableItem = new nsNSSASN1PrintableItem();
|
||||
GetPIPNSSBundleString("CertDumpCertSig", text);
|
||||
printableItem->SetDisplayName(text);
|
||||
|
@ -2027,7 +2027,7 @@ nsNSSCertificate::CreateASN1Struct(nsIASN1Object** aRetVal)
|
|||
text.Truncate();
|
||||
ProcessRawBytes(&temp, text);
|
||||
printableItem->SetDisplayValue(text);
|
||||
asn1Objects->AppendElement(printableItem, false);
|
||||
asn1Objects->AppendElement(printableItem);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -660,7 +660,7 @@ UniqueCERTCertListToMutableArray(/*in*/ UniqueCERTCertList& nssChain,
|
|||
!CERT_LIST_END(node, nssChain.get());
|
||||
node = CERT_LIST_NEXT(node)) {
|
||||
nsCOMPtr<nsIX509Cert> cert = nsNSSCertificate::Create(node->cert);
|
||||
nsresult rv = array->AppendElement(cert, false);
|
||||
nsresult rv = array->AppendElement(cert);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -473,7 +473,7 @@ nsNSSCertificateDB::ImportCertificates(uint8_t* data, uint32_t length,
|
|||
if (!cert) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsresult rv = array->AppendElement(cert, false);
|
||||
nsresult rv = array->AppendElement(cert);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -2428,7 +2428,7 @@ ClientAuthDataRunnable::RunOnTargetThread()
|
|||
goto loser;
|
||||
}
|
||||
|
||||
rv = certArray->AppendElement(tempCert, false);
|
||||
rv = certArray->AppendElement(tempCert);
|
||||
if (NS_FAILED(rv)) {
|
||||
goto loser;
|
||||
}
|
||||
|
|
|
@ -355,7 +355,7 @@ nsPKCS11Module::ListSlots(nsISimpleEnumerator** _retval)
|
|||
for (int i = 0; i < mModule->slotCount; i++) {
|
||||
if (mModule->slots[i]) {
|
||||
nsCOMPtr<nsIPKCS11Slot> slot = new nsPKCS11Slot(mModule->slots[i]);
|
||||
rv = array->AppendElement(slot, false);
|
||||
rv = array->AppendElement(slot);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -235,35 +235,35 @@ nsXULAlerts::ShowAlertWithIconURI(nsIAlertNotification* aAlert,
|
|||
NS_ENSURE_TRUE(scriptableImageUrl, NS_ERROR_FAILURE);
|
||||
|
||||
scriptableImageUrl->SetData(imageUrl);
|
||||
rv = argsArray->AppendElement(scriptableImageUrl, /*weak =*/ false);
|
||||
rv = argsArray->AppendElement(scriptableImageUrl);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsISupportsString> scriptableAlertTitle (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
|
||||
NS_ENSURE_TRUE(scriptableAlertTitle, NS_ERROR_FAILURE);
|
||||
|
||||
scriptableAlertTitle->SetData(title);
|
||||
rv = argsArray->AppendElement(scriptableAlertTitle, /*weak =*/ false);
|
||||
rv = argsArray->AppendElement(scriptableAlertTitle);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsISupportsString> scriptableAlertText (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
|
||||
NS_ENSURE_TRUE(scriptableAlertText, NS_ERROR_FAILURE);
|
||||
|
||||
scriptableAlertText->SetData(text);
|
||||
rv = argsArray->AppendElement(scriptableAlertText, /*weak =*/ false);
|
||||
rv = argsArray->AppendElement(scriptableAlertText);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsISupportsPRBool> scriptableIsClickable (do_CreateInstance(NS_SUPPORTS_PRBOOL_CONTRACTID));
|
||||
NS_ENSURE_TRUE(scriptableIsClickable, NS_ERROR_FAILURE);
|
||||
|
||||
scriptableIsClickable->SetData(textClickable);
|
||||
rv = argsArray->AppendElement(scriptableIsClickable, /*weak =*/ false);
|
||||
rv = argsArray->AppendElement(scriptableIsClickable);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsISupportsString> scriptableAlertCookie (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
|
||||
NS_ENSURE_TRUE(scriptableAlertCookie, NS_ERROR_FAILURE);
|
||||
|
||||
scriptableAlertCookie->SetData(cookie);
|
||||
rv = argsArray->AppendElement(scriptableAlertCookie, /*weak =*/ false);
|
||||
rv = argsArray->AppendElement(scriptableAlertCookie);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsISupportsPRInt32> scriptableOrigin (do_CreateInstance(NS_SUPPORTS_PRINT32_CONTRACTID));
|
||||
|
@ -273,28 +273,28 @@ nsXULAlerts::ShowAlertWithIconURI(nsIAlertNotification* aAlert,
|
|||
LookAndFeel::GetInt(LookAndFeel::eIntID_AlertNotificationOrigin);
|
||||
scriptableOrigin->SetData(origin);
|
||||
|
||||
rv = argsArray->AppendElement(scriptableOrigin, /*weak =*/ false);
|
||||
rv = argsArray->AppendElement(scriptableOrigin);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsISupportsString> scriptableBidi (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
|
||||
NS_ENSURE_TRUE(scriptableBidi, NS_ERROR_FAILURE);
|
||||
|
||||
scriptableBidi->SetData(bidi);
|
||||
rv = argsArray->AppendElement(scriptableBidi, /*weak =*/ false);
|
||||
rv = argsArray->AppendElement(scriptableBidi);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsISupportsString> scriptableLang (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
|
||||
NS_ENSURE_TRUE(scriptableLang, NS_ERROR_FAILURE);
|
||||
|
||||
scriptableLang->SetData(lang);
|
||||
rv = argsArray->AppendElement(scriptableLang, /*weak =*/ false);
|
||||
rv = argsArray->AppendElement(scriptableLang);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsISupportsPRBool> scriptableRequireInteraction (do_CreateInstance(NS_SUPPORTS_PRBOOL_CONTRACTID));
|
||||
NS_ENSURE_TRUE(scriptableRequireInteraction, NS_ERROR_FAILURE);
|
||||
|
||||
scriptableRequireInteraction->SetData(requireInteraction);
|
||||
rv = argsArray->AppendElement(scriptableRequireInteraction, /*weak =*/ false);
|
||||
rv = argsArray->AppendElement(scriptableRequireInteraction);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Alerts with the same name should replace the old alert in the same position.
|
||||
|
@ -305,7 +305,7 @@ nsXULAlerts::ShowAlertWithIconURI(nsIAlertNotification* aAlert,
|
|||
mozIDOMWindowProxy* previousAlert = mNamedWindows.GetWeak(name);
|
||||
replacedWindow->SetData(previousAlert);
|
||||
replacedWindow->SetDataIID(&NS_GET_IID(mozIDOMWindowProxy));
|
||||
rv = argsArray->AppendElement(replacedWindow, /*weak =*/ false);
|
||||
rv = argsArray->AppendElement(replacedWindow);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (requireInteraction) {
|
||||
|
@ -320,7 +320,7 @@ nsXULAlerts::ShowAlertWithIconURI(nsIAlertNotification* aAlert,
|
|||
nsCOMPtr<nsISupports> iSupports(do_QueryInterface(alertObserver));
|
||||
ifptr->SetData(iSupports);
|
||||
ifptr->SetDataIID(&NS_GET_IID(nsIObserver));
|
||||
rv = argsArray->AppendElement(ifptr, /*weak =*/ false);
|
||||
rv = argsArray->AppendElement(ifptr);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// The source contains the host and port of the site that sent the
|
||||
|
@ -328,7 +328,7 @@ nsXULAlerts::ShowAlertWithIconURI(nsIAlertNotification* aAlert,
|
|||
nsCOMPtr<nsISupportsString> scriptableAlertSource (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
|
||||
NS_ENSURE_TRUE(scriptableAlertSource, NS_ERROR_FAILURE);
|
||||
scriptableAlertSource->SetData(source);
|
||||
rv = argsArray->AppendElement(scriptableAlertSource, /*weak =*/ false);
|
||||
rv = argsArray->AppendElement(scriptableAlertSource);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsISupportsCString> scriptableIconURL (do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID));
|
||||
|
@ -339,7 +339,7 @@ nsXULAlerts::ShowAlertWithIconURI(nsIAlertNotification* aAlert,
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
scriptableIconURL->SetData(iconURL);
|
||||
}
|
||||
rv = argsArray->AppendElement(scriptableIconURL, /*weak =*/ false);
|
||||
rv = argsArray->AppendElement(scriptableIconURL);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<mozIDOMWindowProxy> newWindow;
|
||||
|
|
|
@ -1583,7 +1583,7 @@ FeedProcessor.prototype = {
|
|||
|
||||
// If it's an array, re-set the last element
|
||||
if (isArray)
|
||||
container.replaceElementAt(element, container.length - 1, false);
|
||||
container.replaceElementAt(element, container.length - 1);
|
||||
},
|
||||
|
||||
_prefixForNS: function FP_prefixForNS(uri) {
|
||||
|
|
|
@ -545,7 +545,7 @@ nsFileView::GetSelectedFiles(nsIArray** aFiles)
|
|||
}
|
||||
|
||||
if (curFile)
|
||||
fileArray->AppendElement(curFile, false);
|
||||
fileArray->AppendElement(curFile);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -465,7 +465,7 @@ nsPerformanceSnapshot::GetComponentsData(nsIArray * *aComponents)
|
|||
nsCOMPtr<nsIMutableArray> components = do_CreateInstance(NS_ARRAY_CONTRACTID);
|
||||
for (size_t i = 0; i < length; ++i) {
|
||||
nsCOMPtr<nsIPerformanceStats> stats = mComponentsData[i];
|
||||
mozilla::DebugOnly<nsresult> rv = components->AppendElement(stats, false);
|
||||
mozilla::DebugOnly<nsresult> rv = components->AppendElement(stats);
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
||||
}
|
||||
components.forget(aComponents);
|
||||
|
|
|
@ -70,9 +70,9 @@ NS_IMETHODIMP nsPrintProgress::OpenProgressDialog(mozIDOMWindowProxy *parent,
|
|||
ifptr->SetData(static_cast<nsIPrintProgress*>(this));
|
||||
ifptr->SetDataIID(&NS_GET_IID(nsIPrintProgress));
|
||||
|
||||
array->AppendElement(ifptr, /*weak =*/ false);
|
||||
array->AppendElement(ifptr);
|
||||
|
||||
array->AppendElement(parameters, /*weak =*/ false);
|
||||
array->AppendElement(parameters);
|
||||
|
||||
// We will set the opener of the dialog to be the nsIDOMWindow for the
|
||||
// browser XUL window itself, as opposed to the content. That way, the
|
||||
|
|
|
@ -214,17 +214,17 @@ nsPrintingPromptService::DoDialog(mozIDOMWindowProxy *aParent,
|
|||
|
||||
nsCOMPtr<nsISupports> psSupports(do_QueryInterface(aPS));
|
||||
NS_ASSERTION(psSupports, "PrintSettings must be a supports");
|
||||
array->AppendElement(psSupports, /*weak =*/ false);
|
||||
array->AppendElement(psSupports);
|
||||
|
||||
if (aWebBrowserPrint) {
|
||||
nsCOMPtr<nsISupports> wbpSupports(do_QueryInterface(aWebBrowserPrint));
|
||||
NS_ASSERTION(wbpSupports, "nsIWebBrowserPrint must be a supports");
|
||||
array->AppendElement(wbpSupports, /*weak =*/ false);
|
||||
array->AppendElement(wbpSupports);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISupports> blkSupps(do_QueryInterface(aParamBlock));
|
||||
NS_ASSERTION(blkSupps, "IOBlk must be a supports");
|
||||
array->AppendElement(blkSupps, /*weak =*/ false);
|
||||
array->AppendElement(blkSupps);
|
||||
|
||||
nsCOMPtr<mozIDOMWindowProxy> dialog;
|
||||
nsresult rv = mWatcher->OpenWindow(aParent, aChromeURL, "_blank",
|
||||
|
|
|
@ -98,9 +98,9 @@ NS_IMETHODIMP nsPrintProgress::OpenProgressDialog(mozIDOMWindowProxy *parent,
|
|||
ifptr->SetData(static_cast<nsIPrintProgress*>(this));
|
||||
ifptr->SetDataIID(&NS_GET_IID(nsIPrintProgress));
|
||||
|
||||
array->AppendElement(ifptr, /*weak =*/ false);
|
||||
array->AppendElement(ifptr);
|
||||
|
||||
array->AppendElement(parameters, /*weak = */ false);
|
||||
array->AppendElement(parameters);
|
||||
|
||||
// We will set the opener of the dialog to be the nsIDOMWindow for the
|
||||
// browser XUL window itself, as opposed to the content. That way, the
|
||||
|
|
|
@ -66,7 +66,7 @@ nsUrlClassifierCacheEntry::GetMatches(nsIArray** aMatches)
|
|||
nsCOMPtr<nsIMutableArray> array(do_CreateInstance(NS_ARRAY_CONTRACTID));
|
||||
|
||||
for (uint32_t i = 0;i < matches.Length(); i++) {
|
||||
array->AppendElement(matches[i], false);
|
||||
array->AppendElement(matches[i]);
|
||||
}
|
||||
|
||||
NS_ADDREF(*aMatches = array);
|
||||
|
@ -98,7 +98,7 @@ nsUrlClassifierCacheInfo::GetEntries(nsIArray** aEntries)
|
|||
nsCOMPtr<nsIMutableArray> array(do_CreateInstance(NS_ARRAY_CONTRACTID));
|
||||
|
||||
for (uint32_t i = 0;i < entries.Length(); i++) {
|
||||
array->AppendElement(entries[i], false);
|
||||
array->AppendElement(entries[i]);
|
||||
}
|
||||
|
||||
NS_ADDREF(*aEntries = array);
|
||||
|
|
|
@ -330,7 +330,7 @@ ConvertArgsToArray(nsISupports* aArguments)
|
|||
do_CreateInstance(NS_ARRAY_CONTRACTID);
|
||||
NS_ENSURE_TRUE(singletonArray, nullptr);
|
||||
|
||||
nsresult rv = singletonArray->AppendElement(aArguments, /* aWeak = */ false);
|
||||
nsresult rv = singletonArray->AppendElement(aArguments);
|
||||
NS_ENSURE_SUCCESS(rv, nullptr);
|
||||
|
||||
return singletonArray.forget();
|
||||
|
|
|
@ -201,7 +201,7 @@ function onFinish() {
|
|||
var profileLock = profile.lock(null);
|
||||
|
||||
var dialogParams = window.arguments[0].QueryInterface(I.nsIDialogParamBlock);
|
||||
dialogParams.objects.insertElementAt(profileLock, 0, false);
|
||||
dialogParams.objects.insertElementAt(profileLock, 0);
|
||||
}
|
||||
|
||||
// Exit the wizard.
|
||||
|
|
|
@ -95,7 +95,7 @@ function acceptDialog() {
|
|||
|
||||
return false;
|
||||
}
|
||||
gDialogParams.objects.insertElementAt(profileLock.nsIProfileLock, 0, false);
|
||||
gDialogParams.objects.insertElementAt(profileLock.nsIProfileLock, 0);
|
||||
|
||||
gProfileService.selectedProfile = selectedProfile.profile;
|
||||
gProfileService.defaultProfile = selectedProfile.profile;
|
||||
|
|
|
@ -190,7 +190,7 @@ nsGConfService::GetStringList(const nsACString &aKey, nsIArray** aResult)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
obj->SetData(NS_ConvertUTF8toUTF16((const char*)l->data));
|
||||
items->AppendElement(obj, false);
|
||||
items->AppendElement(obj);
|
||||
g_free(l->data);
|
||||
}
|
||||
|
||||
|
|
|
@ -283,7 +283,7 @@ nsGSettingsCollection::GetStringList(const nsACString& aKey, nsIArray** aResult)
|
|||
nsCOMPtr<nsISupportsCString> obj(do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID));
|
||||
if (obj) {
|
||||
obj->SetData(nsDependentCString(*p_gs_strings));
|
||||
items->AppendElement(obj, false);
|
||||
items->AppendElement(obj);
|
||||
}
|
||||
p_gs_strings++;
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ static inline void CopyHanderInfoTonsIHandlerInfo(HandlerInfo info, nsIHandlerIn
|
|||
aHandlerInfo->SetPreferredApplicationHandler(preferredApp);
|
||||
nsCOMPtr<nsIMutableArray> possibleHandlers;
|
||||
aHandlerInfo->GetPossibleApplicationHandlers(getter_AddRefs(possibleHandlers));
|
||||
possibleHandlers->AppendElement(preferredApp, false);
|
||||
possibleHandlers->AppendElement(preferredApp);
|
||||
}
|
||||
ContentHandlerService::~ContentHandlerService()
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@ NS_IMPL_ISUPPORTS(ProxyHandlerInfo, nsIHandlerInfo)
|
|||
ProxyHandlerInfo::ProxyHandlerInfo(const HandlerInfo& aHandlerInfo) : mHandlerInfo(aHandlerInfo), mPossibleApps(do_CreateInstance(NS_ARRAY_CONTRACTID))
|
||||
{
|
||||
for (auto& happ : aHandlerInfo.possibleApplicationHandlers()) {
|
||||
mPossibleApps->AppendElement(new RemoteHandlerApp(happ), false);
|
||||
mPossibleApps->AppendElement(new RemoteHandlerApp(happ));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -377,7 +377,7 @@ nsMIMEInfoAndroid::nsMIMEInfoAndroid(const nsACString& aMIMEType) :
|
|||
mPrefApp = new nsMIMEInfoAndroid::SystemChooser(this);
|
||||
nsresult rv;
|
||||
mHandlerApps = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
|
||||
mHandlerApps->AppendElement(mPrefApp, false);
|
||||
mHandlerApps->AppendElement(mPrefApp);
|
||||
}
|
||||
|
||||
#define SYSTEMCHOOSER_NAME u"Android chooser"
|
||||
|
|
|
@ -2028,7 +2028,7 @@ nsExternalAppHandler::OnSaveComplete(nsIBackgroundFileSaver *aSaver,
|
|||
LOG(("nsExternalAppHandler: Got %zu redirects\n",
|
||||
loadInfo->RedirectChain().Length()));
|
||||
for (nsIRedirectHistoryEntry* entry : loadInfo->RedirectChain()) {
|
||||
redirectChain->AppendElement(entry, false);
|
||||
redirectChain->AppendElement(entry);
|
||||
}
|
||||
mRedirects = redirectChain;
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ nsMIMEInfoUnix::GetPossibleApplicationHandlers(nsIMutableArray ** aPossibleAppHa
|
|||
nsContentHandlerApp* app =
|
||||
new nsContentHandlerApp(nsString((char16_t*)actions[i].name().data()),
|
||||
mSchemeOrType, actions[i]);
|
||||
mPossibleApplications->AppendElement(app, false);
|
||||
mPossibleApplications->AppendElement(app);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -523,7 +523,7 @@ void nsMIMEInfoWin::ProcessPath(nsCOMPtr<nsIMutableArray>& appList,
|
|||
return;
|
||||
|
||||
// Save in our main tracking arrays
|
||||
appList->AppendElement(aApp, false);
|
||||
appList->AppendElement(aApp);
|
||||
trackList.AppendElement(lower);
|
||||
}
|
||||
|
||||
|
|
|
@ -794,7 +794,7 @@ nsOfflineManifestItem::AddNamespace(uint32_t namespaceType,
|
|||
rv = ns->Init(namespaceType, namespaceSpec, data);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = mNamespaces->AppendElement(ns, false);
|
||||
rv = mNamespaces->AppendElement(ns);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -252,7 +252,7 @@ getHandlersFromStringArray(JNIEnv *aJNIEnv, jobjectArray jArr, jsize aLen,
|
|||
CreateAndroidHandlerApp(name, className, packageName,
|
||||
className, aMimeType, aAction);
|
||||
|
||||
aHandlersArray->AppendElement(app, false);
|
||||
aHandlersArray->AppendElement(app);
|
||||
if (aDefaultApp && isDefault.Length() > 0)
|
||||
*aDefaultApp = app;
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ nsHTMLFormatConverter :: AddFlavorToList ( nsCOMPtr<nsIMutableArray>& inList, co
|
|||
// add to list as an nsISupports so the correct interface gets the addref
|
||||
// in AppendElement()
|
||||
nsCOMPtr<nsISupports> genericFlavor ( do_QueryInterface(dataFlavor) );
|
||||
inList->AppendElement ( genericFlavor, /*weak =*/ false);
|
||||
inList->AppendElement ( genericFlavor );
|
||||
}
|
||||
return rv;
|
||||
|
||||
|
|
|
@ -274,7 +274,7 @@ nsTransferable::GetTransferDataFlavors()
|
|||
if ( flavorWrapper ) {
|
||||
flavorWrapper->SetData ( data.GetFlavor() );
|
||||
nsCOMPtr<nsISupports> genericWrapper ( do_QueryInterface(flavorWrapper) );
|
||||
array->AppendElement( genericWrapper, /*weak =*/ false );
|
||||
array->AppendElement( genericWrapper );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -557,7 +557,7 @@ nsTransferable::FlavorsTransferableCanImport(nsIArray **_retval)
|
|||
|
||||
if (GetDataForFlavor (mDataArray, flavorStr.get())
|
||||
== mDataArray.NoIndex) // Don't append if already in intrinsic list
|
||||
array->AppendElement (flavorWrapper, /*weak =*/ false);
|
||||
array->AppendElement (flavorWrapper);
|
||||
} // foreach flavor that can be converted to
|
||||
}
|
||||
} // if a converter exists
|
||||
|
@ -602,7 +602,7 @@ nsTransferable::FlavorsTransferableCanExport(nsIArray **_retval)
|
|||
|
||||
if (GetDataForFlavor (mDataArray, flavorStr.get())
|
||||
== mDataArray.NoIndex) // Don't append if already in intrinsic list
|
||||
array->AppendElement (flavorWrapper, /*weak =*/ false);
|
||||
array->AppendElement (flavorWrapper);
|
||||
} // foreach flavor that can be converted to
|
||||
}
|
||||
} // if a converter exists
|
||||
|
|
|
@ -587,7 +587,7 @@ nsresult JumpListBuilder::TransferIObjectArrayToIMutableArray(IObjectArray *objA
|
|||
pItem->Release();
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
removedItems->AppendElement(item, false);
|
||||
removedItems->AppendElement(item);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
|
|
|
@ -133,11 +133,11 @@ nsPrintDialogServiceWin::DoDialog(mozIDOMWindowProxy* aParent,
|
|||
|
||||
nsCOMPtr<nsISupports> psSupports(do_QueryInterface(aPS));
|
||||
NS_ASSERTION(psSupports, "PrintSettings must be a supports");
|
||||
array->AppendElement(psSupports, /*weak =*/false);
|
||||
array->AppendElement(psSupports);
|
||||
|
||||
nsCOMPtr<nsISupports> blkSupps(do_QueryInterface(aParamBlock));
|
||||
NS_ASSERTION(blkSupps, "IOBlk must be a supports");
|
||||
array->AppendElement(blkSupps, /*weak =*/false);
|
||||
array->AppendElement(blkSupps);
|
||||
|
||||
nsCOMPtr<mozIDOMWindowProxy> dialog;
|
||||
nsresult rv = mWatcher->OpenWindow(aParent,
|
||||
|
|
|
@ -1952,7 +1952,7 @@ nsComponentManagerImpl::GetManifestLocations(nsIArray** aLocations)
|
|||
nsCOMPtr<nsIURI> uri;
|
||||
rv = NS_NewURI(getter_AddRefs(uri), uriString);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
locations->AppendElement(uri, false);
|
||||
locations->AppendElement(uri);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
#include "nsArray.h"
|
||||
#include "nsArrayEnumerator.h"
|
||||
#include "nsIWeakReference.h"
|
||||
#include "nsIWeakReferenceUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
// used by IndexOf()
|
||||
|
@ -112,23 +110,9 @@ nsArrayBase::Enumerate(nsISimpleEnumerator** aResult)
|
|||
// nsIMutableArray implementation
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsArrayBase::AppendElement(nsISupports* aElement, bool aWeak)
|
||||
nsArrayBase::AppendElement(nsISupports* aElement)
|
||||
{
|
||||
bool result;
|
||||
if (aWeak) {
|
||||
nsCOMPtr<nsIWeakReference> elementRef = do_GetWeakReference(aElement);
|
||||
NS_ASSERTION(elementRef,
|
||||
"AppendElement: Trying to use weak references on an object that doesn't support it");
|
||||
if (!elementRef) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
result = mArray.AppendObject(elementRef);
|
||||
}
|
||||
|
||||
else {
|
||||
// add the object directly
|
||||
result = mArray.AppendObject(aElement);
|
||||
}
|
||||
bool result = mArray.AppendObject(aElement);
|
||||
return result ? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -140,38 +124,16 @@ nsArrayBase::RemoveElementAt(uint32_t aIndex)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsArrayBase::InsertElementAt(nsISupports* aElement, uint32_t aIndex, bool aWeak)
|
||||
nsArrayBase::InsertElementAt(nsISupports* aElement, uint32_t aIndex)
|
||||
{
|
||||
nsCOMPtr<nsISupports> elementRef;
|
||||
if (aWeak) {
|
||||
elementRef = do_GetWeakReference(aElement);
|
||||
NS_ASSERTION(elementRef,
|
||||
"InsertElementAt: Trying to use weak references on an object that doesn't support it");
|
||||
if (!elementRef) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
} else {
|
||||
elementRef = aElement;
|
||||
}
|
||||
bool result = mArray.InsertObjectAt(elementRef, aIndex);
|
||||
bool result = mArray.InsertObjectAt(aElement, aIndex);
|
||||
return result ? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsArrayBase::ReplaceElementAt(nsISupports* aElement, uint32_t aIndex, bool aWeak)
|
||||
nsArrayBase::ReplaceElementAt(nsISupports* aElement, uint32_t aIndex)
|
||||
{
|
||||
nsCOMPtr<nsISupports> elementRef;
|
||||
if (aWeak) {
|
||||
elementRef = do_GetWeakReference(aElement);
|
||||
NS_ASSERTION(elementRef,
|
||||
"ReplaceElementAt: Trying to use weak references on an object that doesn't support it");
|
||||
if (!elementRef) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
} else {
|
||||
elementRef = aElement;
|
||||
}
|
||||
mArray.ReplaceObjectAt(elementRef, aIndex);
|
||||
mArray.ReplaceObjectAt(aElement, aIndex);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ nsHashPropertyBagBase::GetEnumerator(nsISimpleEnumerator** aResult)
|
|||
const nsAString& key = iter.Key();
|
||||
nsIVariant* data = iter.UserData();
|
||||
nsSimpleProperty* sprop = new nsSimpleProperty(key, data);
|
||||
propertyArray->AppendElement(sprop, false);
|
||||
propertyArray->AppendElement(sprop);
|
||||
}
|
||||
|
||||
return NS_NewArrayEnumerator(aResult, propertyArray);
|
||||
|
|
|
@ -29,14 +29,8 @@ interface nsIMutableArray : nsIArrayExtensions
|
|||
* Append an element at the end of the array.
|
||||
*
|
||||
* @param element The element to append.
|
||||
* @param weak Whether or not to store the element using a weak
|
||||
* reference.
|
||||
* @throws NS_ERROR_FAILURE when a weak reference is requested,
|
||||
* but the element does not support
|
||||
* nsIWeakReference.
|
||||
*/
|
||||
void appendElement(in nsISupports element,
|
||||
[optional] in boolean weak);
|
||||
void appendElement(in nsISupports element);
|
||||
|
||||
/**
|
||||
* removeElementAt()
|
||||
|
@ -67,13 +61,8 @@ interface nsIMutableArray : nsIArrayExtensions
|
|||
* of the array, the new element is appended.
|
||||
* An index lower than 0 or higher than the current
|
||||
* length of the array is invalid and will be ignored.
|
||||
*
|
||||
* @throws NS_ERROR_FAILURE when a weak reference is requested,
|
||||
* but the element does not support
|
||||
* nsIWeakReference.
|
||||
*/
|
||||
void insertElementAt(in nsISupports element, in unsigned long index,
|
||||
in boolean weak);
|
||||
void insertElementAt(in nsISupports element, in unsigned long index);
|
||||
|
||||
/**
|
||||
* replaceElementAt()
|
||||
|
@ -90,16 +79,8 @@ interface nsIMutableArray : nsIArrayExtensions
|
|||
* of the array, empty elements are appended followed
|
||||
* by the new element at the specified position.
|
||||
* An index lower than 0 is invalid and will be ignored.
|
||||
*
|
||||
* @param weak Whether or not to store the new element using a weak
|
||||
* reference.
|
||||
*
|
||||
* @throws NS_ERROR_FAILURE when a weak reference is requested,
|
||||
* but the element does not support
|
||||
* nsIWeakReference.
|
||||
*/
|
||||
void replaceElementAt(in nsISupports element, in unsigned long index,
|
||||
in boolean weak);
|
||||
void replaceElementAt(in nsISupports element, in unsigned long index);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -43,7 +43,7 @@ function test_insert_at_beginning() {
|
|||
do_check_eq(5, arr.length);
|
||||
var str = new SupportsString();
|
||||
str.data = "hello";
|
||||
arr.insertElementAt(str, 0, false);
|
||||
arr.insertElementAt(str, 0);
|
||||
do_check_eq(6, arr.length);
|
||||
var obj = arr.queryElementAt(0, Ci.nsISupportsString);
|
||||
do_check_eq(str, obj);
|
||||
|
@ -61,17 +61,17 @@ function test_replace_element() {
|
|||
var str = new SupportsString();
|
||||
str.data = "hello";
|
||||
// replace first element
|
||||
arr.replaceElementAt(str, 0, false);
|
||||
arr.replaceElementAt(str, 0);
|
||||
do_check_eq(5, arr.length);
|
||||
var obj = arr.queryElementAt(0, Ci.nsISupportsString);
|
||||
do_check_eq(str, obj);
|
||||
// replace last element
|
||||
arr.replaceElementAt(str, arr.length - 1, false);
|
||||
arr.replaceElementAt(str, arr.length - 1);
|
||||
do_check_eq(5, arr.length);
|
||||
obj = arr.queryElementAt(arr.length - 1, Ci.nsISupportsString);
|
||||
do_check_eq(str, obj);
|
||||
// replace after last element, should insert empty elements
|
||||
arr.replaceElementAt(str, 9, false);
|
||||
arr.replaceElementAt(str, 9);
|
||||
do_check_eq(10, arr.length);
|
||||
obj = arr.queryElementAt(9, Ci.nsISupportsString);
|
||||
do_check_eq(str, obj);
|
||||
|
|
|
@ -844,7 +844,7 @@ nsHTTPIndex::GetTargets(nsIRDFResource *aSource, nsIRDFResource *aProperty, bool
|
|||
if (NS_FAILED(idx_rv))
|
||||
{
|
||||
// add aSource into list of connections to make
|
||||
mConnectionList->AppendElement(aSource, /*weak =*/ false);
|
||||
mConnectionList->AppendElement(aSource);
|
||||
|
||||
// if we don't have a timer about to fire, create one
|
||||
// which should fire as soon as possible (out-of-band)
|
||||
|
@ -878,9 +878,9 @@ nsHTTPIndex::AddElement(nsIRDFResource *parent, nsIRDFResource *prop, nsIRDFNode
|
|||
}
|
||||
|
||||
// order required: parent, prop, then child
|
||||
mNodeList->AppendElement(parent, /*weak =*/ false);
|
||||
mNodeList->AppendElement(prop, /*weak =*/ false);
|
||||
mNodeList->AppendElement(child, /*weak = */ false);
|
||||
mNodeList->AppendElement(parent);
|
||||
mNodeList->AppendElement(prop);
|
||||
mNodeList->AppendElement(child);
|
||||
|
||||
if (!mTimer)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче