зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1434686 part 1. Introduce a mozilla::IgnoreErrors which can be used as a temporary to pass to an ErrorResult& arg when the error should be ignored. r=mystor
Once bug 1434689 is fixed, we can mark this thing as being required to be a temporary. MozReview-Commit-ID: 7VX0XSYVOc4
This commit is contained in:
Родитель
275f452928
Коммит
f7f6285330
|
@ -602,6 +602,21 @@ class IgnoredErrorResult :
|
|||
{
|
||||
};
|
||||
|
||||
// A class for use when an ErrorResult should just automatically be
|
||||
// ignored. This is designed to be passed as a temporary only, like
|
||||
// so:
|
||||
//
|
||||
// foo->Bar(IgnoreErrors());
|
||||
class IgnoreErrors {
|
||||
public:
|
||||
operator ErrorResult&() && { return mInner; }
|
||||
private:
|
||||
// We don't use an ErrorResult member here so we don't make two separate calls
|
||||
// to SuppressException (one from us, one from the ErrorResult destructor
|
||||
// after asserting).
|
||||
binding_danger::TErrorResult<binding_danger::JustSuppressCleanupPolicy> mInner;
|
||||
};
|
||||
|
||||
namespace dom {
|
||||
namespace binding_detail {
|
||||
class FastErrorResult :
|
||||
|
|
|
@ -336,6 +336,7 @@ function extraRootedPointers()
|
|||
|
||||
'mozilla::ErrorResult',
|
||||
'mozilla::IgnoredErrorResult',
|
||||
'mozilla::IgnoreErrors',
|
||||
'mozilla::dom::binding_detail::FastErrorResult',
|
||||
];
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче