Bug 1386411 - Part 2: Devirtualize and inline nsISelection::AsSelection(); r=bzbarsky

nsISelection is builtinclass, so this method doesn't need to be virtual.
This commit is contained in:
Ehsan Akhgari 2017-08-01 17:12:57 -04:00
Родитель ace85f9311
Коммит 1774c1cc7d
2 изменённых файлов: 11 добавлений и 6 удалений

Просмотреть файл

@ -73,8 +73,6 @@ public:
NS_DECL_NSISELECTION
NS_DECL_NSISELECTIONPRIVATE
virtual Selection* AsSelection() override { return this; }
nsresult EndBatchChangesInternal(int16_t aReason = nsISelectionListener::NO_REASON);
nsIDocument* GetParentObject() const;
@ -519,4 +517,10 @@ public:
} // namespace dom
} // namespace mozilla
inline mozilla::dom::Selection*
nsISelection::AsSelection()
{
return static_cast<mozilla::dom::Selection*>(this);
}
#endif // mozilla_Selection_h__

Просмотреть файл

@ -161,10 +161,11 @@ interface nsISelection : nsISupports
%{C++
/**
* AsSelection() returns a pointer to Selection class if the instance is
* derived from it. Otherwise, nullptr but it should never happen
* since Selection is the only class implementing nsISelection.
* AsSelection() returns a pointer to Selection class.
*
* In order to avoid circular dependency issues, this method is defined
* in mozilla/dom/Selection.h. Consumers need to #include that header.
*/
virtual mozilla::dom::Selection* AsSelection() = 0;
inline mozilla::dom::Selection* AsSelection();
%}
};