Skip to content

Commit 0158360

Browse files
committed
Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top level of a typical source code checkout. The only non-machine-generated part was modifying MFBT's moz.build to reflect the new naming. CLOSED TREE makes big refactorings like this a piece of cake. # The main substitution. find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \ xargs perl -p -i -e ' s/nsRefPtr\.h/RefPtr\.h/g; # handle includes s/nsRefPtr ?</RefPtr</g; # handle declarations and variables ' # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h. perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h # Handle nsRefPtr.h itself, a couple places that define constructors # from nsRefPtr, and code generators specially. We do this here, rather # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename # things like nsRefPtrHashtable. perl -p -i -e 's/nsRefPtr/RefPtr/g' \ mfbt/nsRefPtr.h \ xpcom/glue/nsCOMPtr.h \ xpcom/base/OwningNonNull.h \ ipc/ipdl/ipdl/lower.py \ ipc/ipdl/ipdl/builtin.py \ dom/bindings/Codegen.py \ python/lldbutils/lldbutils/utils.py # In our indiscriminate substitution above, we renamed # nsRefPtrGetterAddRefs, the class behind getter_AddRefs. Fix that up. find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \ xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g' if [ -d .git ]; then git mv mfbt/nsRefPtr.h mfbt/RefPtr.h else hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h fi --HG-- rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
1 parent 4837836 commit 0158360

File tree

3,177 files changed

+16667
-16667
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,177 files changed

+16667
-16667
lines changed

accessible/base/AccEvent.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class AccEvent
127127
bool mIsFromUserInput;
128128
uint32_t mEventType;
129129
EEventRule mEventRule;
130-
nsRefPtr<Accessible> mAccessible;
130+
RefPtr<Accessible> mAccessible;
131131

132132
friend class EventQueue;
133133
friend class AccReorderEvent;
@@ -237,8 +237,8 @@ class AccMutationEvent: public AccEvent
237237

238238
protected:
239239
nsCOMPtr<nsINode> mNode;
240-
nsRefPtr<Accessible> mParent;
241-
nsRefPtr<AccTextChangeEvent> mTextChangeEvent;
240+
RefPtr<Accessible> mParent;
241+
RefPtr<AccTextChangeEvent> mTextChangeEvent;
242242

243243
friend class EventQueue;
244244
};
@@ -268,8 +268,8 @@ class AccHideEvent: public AccMutationEvent
268268

269269
protected:
270270
bool mNeedsShutdown;
271-
nsRefPtr<Accessible> mNextSibling;
272-
nsRefPtr<Accessible> mPrevSibling;
271+
RefPtr<Accessible> mNextSibling;
272+
RefPtr<Accessible> mPrevSibling;
273273

274274
friend class EventQueue;
275275
};
@@ -397,7 +397,7 @@ class AccTextSelChangeEvent : public AccEvent
397397
bool IsCaretMoveOnly() const;
398398

399399
private:
400-
nsRefPtr<dom::Selection> mSel;
400+
RefPtr<dom::Selection> mSel;
401401
int32_t mReason;
402402

403403
friend class EventQueue;
@@ -432,8 +432,8 @@ class AccSelChangeEvent : public AccEvent
432432
Accessible* Widget() const { return mWidget; }
433433

434434
private:
435-
nsRefPtr<Accessible> mWidget;
436-
nsRefPtr<Accessible> mItem;
435+
RefPtr<Accessible> mWidget;
436+
RefPtr<Accessible> mItem;
437437
SelChangeType mSelChangeType;
438438
uint32_t mPreceedingCount;
439439
AccSelChangeEvent* mPackedEvent;
@@ -495,7 +495,7 @@ class AccVCChangeEvent : public AccEvent
495495
int32_t Reason() const { return mReason; }
496496

497497
private:
498-
nsRefPtr<Accessible> mOldAccessible;
498+
RefPtr<Accessible> mOldAccessible;
499499
int32_t mOldStart;
500500
int32_t mOldEnd;
501501
int16_t mReason;

accessible/base/AccIterator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ ARIAOwnsIterator::Next()
394394
Accessible*
395395
SingleAccIterator::Next()
396396
{
397-
nsRefPtr<Accessible> nextAcc;
397+
RefPtr<Accessible> nextAcc;
398398
mAcc.swap(nextAcc);
399399
if (!nextAcc || nextAcc->IsDefunct()) {
400400
return nullptr;

accessible/base/AccIterator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ class SingleAccIterator : public AccIterable
306306
SingleAccIterator(const SingleAccIterator&);
307307
SingleAccIterator& operator = (const SingleAccIterator&);
308308

309-
nsRefPtr<Accessible> mAcc;
309+
RefPtr<Accessible> mAcc;
310310
};
311311

312312

accessible/base/DocManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ DocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
427427
// We only create root accessibles for the true root, otherwise create a
428428
// doc accessible.
429429
nsIContent *rootElm = nsCoreUtils::GetRoleContent(aDocument);
430-
nsRefPtr<DocAccessible> docAcc = isRootDoc ?
430+
RefPtr<DocAccessible> docAcc = isRootDoc ?
431431
new RootAccessibleWrap(aDocument, rootElm, presShell) :
432432
new DocAccessibleWrap(aDocument, rootElm, presShell);
433433

accessible/base/EventQueue.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ EventQueue::PushEvent(AccEvent* aEvent)
6161
ENameValueFlag nameFlag = parent->Name(name);
6262
// If name is obtained from subtree, fire name change event.
6363
if (nameFlag == eNameFromSubtree) {
64-
nsRefPtr<AccEvent> nameChangeEvent =
64+
RefPtr<AccEvent> nameChangeEvent =
6565
new AccEvent(nsIAccessibleEvent::EVENT_NAME_CHANGE, parent);
6666
PushEvent(nameChangeEvent);
6767
}
@@ -482,7 +482,7 @@ void
482482
EventQueue::ProcessEventQueue()
483483
{
484484
// Process only currently queued events.
485-
nsTArray<nsRefPtr<AccEvent> > events;
485+
nsTArray<RefPtr<AccEvent> > events;
486486
events.SwapElements(mEvents);
487487

488488
uint32_t eventCount = events.Length();

accessible/base/EventQueue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class EventQueue
7979
* Pending events array. Don't make this an nsAutoTArray; we use
8080
* SwapElements() on it.
8181
*/
82-
nsTArray<nsRefPtr<AccEvent> > mEvents;
82+
nsTArray<RefPtr<AccEvent> > mEvents;
8383
};
8484

8585
} // namespace a11y

accessible/base/FocusManager.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ FocusManager::DispatchFocusEvent(DocAccessible* aDocument,
218218
{
219219
NS_PRECONDITION(aDocument, "No document for focused accessible!");
220220
if (aDocument) {
221-
nsRefPtr<AccEvent> event =
221+
RefPtr<AccEvent> event =
222222
new AccEvent(nsIAccessibleEvent::EVENT_FOCUS, aTarget,
223223
eAutoDetect, AccEvent::eCoalesceOfSameType);
224224
aDocument->FireDelayedEvent(event);
@@ -331,7 +331,7 @@ FocusManager::ProcessFocusEvent(AccEvent* aEvent)
331331
if (ARIAMenubar != mActiveARIAMenubar) {
332332
// Leaving ARIA menu. Fire menu_end event on current menubar.
333333
if (mActiveARIAMenubar) {
334-
nsRefPtr<AccEvent> menuEndEvent =
334+
RefPtr<AccEvent> menuEndEvent =
335335
new AccEvent(nsIAccessibleEvent::EVENT_MENU_END, mActiveARIAMenubar,
336336
aEvent->FromUserInput());
337337
nsEventShell::FireEvent(menuEndEvent);
@@ -341,15 +341,15 @@ FocusManager::ProcessFocusEvent(AccEvent* aEvent)
341341

342342
// Entering ARIA menu. Fire menu_start event.
343343
if (mActiveARIAMenubar) {
344-
nsRefPtr<AccEvent> menuStartEvent =
344+
RefPtr<AccEvent> menuStartEvent =
345345
new AccEvent(nsIAccessibleEvent::EVENT_MENU_START,
346346
mActiveARIAMenubar, aEvent->FromUserInput());
347347
nsEventShell::FireEvent(menuStartEvent);
348348
}
349349
}
350350
} else if (mActiveARIAMenubar) {
351351
// Focus left a menu. Fire menu_end event.
352-
nsRefPtr<AccEvent> menuEndEvent =
352+
RefPtr<AccEvent> menuEndEvent =
353353
new AccEvent(nsIAccessibleEvent::EVENT_MENU_END, mActiveARIAMenubar,
354354
aEvent->FromUserInput());
355355
nsEventShell::FireEvent(menuEndEvent);
@@ -367,7 +367,7 @@ FocusManager::ProcessFocusEvent(AccEvent* aEvent)
367367
// offset before the caret move event is handled.
368368
SelectionMgr()->ResetCaretOffset();
369369

370-
nsRefPtr<AccEvent> focusEvent =
370+
RefPtr<AccEvent> focusEvent =
371371
new AccEvent(nsIAccessibleEvent::EVENT_FOCUS, target, aEvent->FromUserInput());
372372
nsEventShell::FireEvent(focusEvent);
373373

accessible/base/FocusManager.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ class FocusManager
124124
nsIDocument* FocusedDOMDocument() const;
125125

126126
private:
127-
nsRefPtr<Accessible> mActiveItem;
128-
nsRefPtr<Accessible> mActiveARIAMenubar;
127+
RefPtr<Accessible> mActiveItem;
128+
RefPtr<Accessible> mActiveARIAMenubar;
129129
};
130130

131131
} // namespace a11y

accessible/base/NotificationController.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ NotificationController::ScheduleContentInsertion(Accessible* aContainer,
101101
nsIContent* aStartChildNode,
102102
nsIContent* aEndChildNode)
103103
{
104-
nsRefPtr<ContentInsertion> insertion = new ContentInsertion(mDocument,
104+
RefPtr<ContentInsertion> insertion = new ContentInsertion(mDocument,
105105
aContainer);
106106
if (insertion && insertion->InitChildList(aStartChildNode, aEndChildNode) &&
107107
mContentInsertions.AppendElement(insertion)) {
@@ -193,7 +193,7 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
193193
// document accessible.
194194

195195
// Process only currently queued content inserted notifications.
196-
nsTArray<nsRefPtr<ContentInsertion> > contentInsertions;
196+
nsTArray<RefPtr<ContentInsertion> > contentInsertions;
197197
contentInsertions.SwapElements(mContentInsertions);
198198

199199
uint32_t insertionCount = contentInsertions.Length();
@@ -291,7 +291,7 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
291291

292292
// Bind hanging child documents.
293293
uint32_t hangingDocCnt = mHangingChildDocuments.Length();
294-
nsTArray<nsRefPtr<DocAccessible>> newChildDocs;
294+
nsTArray<RefPtr<DocAccessible>> newChildDocs;
295295
for (uint32_t idx = 0; idx < hangingDocCnt; idx++) {
296296
DocAccessible* childDoc = mHangingChildDocuments[idx];
297297
if (childDoc->IsDefunct())
@@ -337,7 +337,7 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
337337
}
338338

339339
// Process only currently queued generic notifications.
340-
nsTArray < nsRefPtr<Notification> > notifications;
340+
nsTArray < RefPtr<Notification> > notifications;
341341
notifications.SwapElements(mNotifications);
342342

343343
uint32_t notificationCount = notifications.Length();

accessible/base/NotificationController.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class TNotification : public Notification
8181

8282
Class* mInstance;
8383
Callback mCallback;
84-
Tuple<nsRefPtr<Args> ...> mArgs;
84+
Tuple<RefPtr<Args> ...> mArgs;
8585
};
8686

8787
/**
@@ -161,7 +161,7 @@ class NotificationController final : public EventQueue,
161161
return;
162162
}
163163

164-
nsRefPtr<Notification> notification =
164+
RefPtr<Notification> notification =
165165
new TNotification<Class, Arg>(aInstance, aMethod, aArg);
166166
if (notification && mNotifications.AppendElement(notification))
167167
ScheduleProcessing();
@@ -177,7 +177,7 @@ class NotificationController final : public EventQueue,
177177
inline void ScheduleNotification(Class* aInstance,
178178
typename TNotification<Class>::Callback aMethod)
179179
{
180-
nsRefPtr<Notification> notification =
180+
RefPtr<Notification> notification =
181181
new TNotification<Class>(aInstance, aMethod);
182182
if (notification && mNotifications.AppendElement(notification))
183183
ScheduleProcessing();
@@ -227,7 +227,7 @@ class NotificationController final : public EventQueue,
227227
/**
228228
* Child documents that needs to be bound to the tree.
229229
*/
230-
nsTArray<nsRefPtr<DocAccessible> > mHangingChildDocuments;
230+
nsTArray<RefPtr<DocAccessible> > mHangingChildDocuments;
231231

232232
/**
233233
* Storage for content inserted notification information.
@@ -257,7 +257,7 @@ class NotificationController final : public EventQueue,
257257
DocAccessible* mDocument;
258258

259259
// The container accessible that content insertion occurs within.
260-
nsRefPtr<Accessible> mContainer;
260+
RefPtr<Accessible> mContainer;
261261

262262
// Array of inserted contents.
263263
nsTArray<nsCOMPtr<nsIContent> > mInsertedContent;
@@ -267,7 +267,7 @@ class NotificationController final : public EventQueue,
267267
* A pending accessible tree update notifications for content insertions.
268268
* Don't make this an nsAutoTArray; we use SwapElements() on it.
269269
*/
270-
nsTArray<nsRefPtr<ContentInsertion> > mContentInsertions;
270+
nsTArray<RefPtr<ContentInsertion> > mContentInsertions;
271271

272272
template<class T>
273273
class nsCOMPtrHashKey : public PLDHashEntryHdr
@@ -302,7 +302,7 @@ class NotificationController final : public EventQueue,
302302
* Other notifications like DOM events. Don't make this an nsAutoTArray; we
303303
* use SwapElements() on it.
304304
*/
305-
nsTArray<nsRefPtr<Notification> > mNotifications;
305+
nsTArray<RefPtr<Notification> > mNotifications;
306306
};
307307

308308
} // namespace a11y

0 commit comments

Comments
 (0)