Bug 1386411 - Part 6: Add a more efficient nsISelectionController::GetSelection() API for retrieving native Selection objects; r=bzbarsky
This API avoids needless refcounting and QueryInterface overhead.
This commit is contained in:
@@ -296,6 +296,7 @@ public:
|
||||
NS_IMETHOD GetSelectionFlags(int16_t *aOutEnable) override;
|
||||
NS_IMETHOD GetSelection(RawSelectionType aRawSelectionType,
|
||||
nsISelection** aSelection) override;
|
||||
NS_IMETHODIMP_(Selection*) GetSelection(RawSelectionType aRawSelectionType) override;
|
||||
NS_IMETHOD ScrollSelectionIntoView(RawSelectionType aRawSelectionType,
|
||||
int16_t aRegion, int16_t aFlags) override;
|
||||
NS_IMETHOD RepaintSelection(RawSelectionType aRawSelectionType) override;
|
||||
@@ -432,6 +433,12 @@ nsTextInputSelectionImpl::GetSelection(RawSelectionType aRawSelectionType,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(Selection*)
|
||||
nsTextInputSelectionImpl::GetSelection(RawSelectionType aRawSelectionType)
|
||||
{
|
||||
return GetSelection(ToSelectionType(aRawSelectionType));
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsTextInputSelectionImpl::ScrollSelectionIntoView(
|
||||
RawSelectionType aRawSelectionType,
|
||||
|
||||
Reference in New Issue
Block a user