зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
ace85f9311
Коммит
1774c1cc7d
|
@ -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();
|
||||
%}
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче