Commit 89a69c82 authored by Nathan Froyd's avatar Nathan Froyd
Browse files

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.

 # 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
parent 45f70b7f
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ protected:
  bool mIsFromUserInput;
  uint32_t mEventType;
  EEventRule mEventRule;
  nsRefPtr<Accessible> mAccessible;
  RefPtr<Accessible> mAccessible;

  friend class EventQueue;
  friend class AccReorderEvent;
@@ -237,8 +237,8 @@ public:

protected:
  nsCOMPtr<nsINode> mNode;
  nsRefPtr<Accessible> mParent;
  nsRefPtr<AccTextChangeEvent> mTextChangeEvent;
  RefPtr<Accessible> mParent;
  RefPtr<AccTextChangeEvent> mTextChangeEvent;

  friend class EventQueue;
};
@@ -268,8 +268,8 @@ public:

protected:
  bool mNeedsShutdown;
  nsRefPtr<Accessible> mNextSibling;
  nsRefPtr<Accessible> mPrevSibling;
  RefPtr<Accessible> mNextSibling;
  RefPtr<Accessible> mPrevSibling;

  friend class EventQueue;
};
@@ -397,7 +397,7 @@ public:
  bool IsCaretMoveOnly() const;

private:
  nsRefPtr<dom::Selection> mSel;
  RefPtr<dom::Selection> mSel;
  int32_t mReason;

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

private:
  nsRefPtr<Accessible> mWidget;
  nsRefPtr<Accessible> mItem;
  RefPtr<Accessible> mWidget;
  RefPtr<Accessible> mItem;
  SelChangeType mSelChangeType;
  uint32_t mPreceedingCount;
  AccSelChangeEvent* mPackedEvent;
@@ -495,7 +495,7 @@ public:
  int32_t Reason() const { return mReason; }

private:
  nsRefPtr<Accessible> mOldAccessible;
  RefPtr<Accessible> mOldAccessible;
  int32_t mOldStart;
  int32_t mOldEnd;
  int16_t mReason;
+1 −1
Original line number Diff line number Diff line
@@ -394,7 +394,7 @@ ARIAOwnsIterator::Next()
Accessible*
SingleAccIterator::Next()
{
  nsRefPtr<Accessible> nextAcc;
  RefPtr<Accessible> nextAcc;
  mAcc.swap(nextAcc);
  if (!nextAcc || nextAcc->IsDefunct()) {
    return nullptr;
+1 −1
Original line number Diff line number Diff line
@@ -306,7 +306,7 @@ private:
  SingleAccIterator(const SingleAccIterator&);
  SingleAccIterator& operator = (const SingleAccIterator&);

  nsRefPtr<Accessible> mAcc;
  RefPtr<Accessible> mAcc;
};


+1 −1
Original line number Diff line number Diff line
@@ -427,7 +427,7 @@ DocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
  // We only create root accessibles for the true root, otherwise create a
  // doc accessible.
  nsIContent *rootElm = nsCoreUtils::GetRoleContent(aDocument);
  nsRefPtr<DocAccessible> docAcc = isRootDoc ?
  RefPtr<DocAccessible> docAcc = isRootDoc ?
    new RootAccessibleWrap(aDocument, rootElm, presShell) :
    new DocAccessibleWrap(aDocument, rootElm, presShell);

+2 −2
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ EventQueue::PushEvent(AccEvent* aEvent)
        ENameValueFlag nameFlag = parent->Name(name);
        // If name is obtained from subtree, fire name change event.
        if (nameFlag == eNameFromSubtree) {
          nsRefPtr<AccEvent> nameChangeEvent =
          RefPtr<AccEvent> nameChangeEvent =
            new AccEvent(nsIAccessibleEvent::EVENT_NAME_CHANGE, parent);
          PushEvent(nameChangeEvent);
        }
@@ -482,7 +482,7 @@ void
EventQueue::ProcessEventQueue()
{
  // Process only currently queued events.
  nsTArray<nsRefPtr<AccEvent> > events;
  nsTArray<RefPtr<AccEvent> > events;
  events.SwapElements(mEvents);

  uint32_t eventCount = events.Length();
Loading