Files
palemoon27/dom/bindings/CallbackFunction.h
T
roytam1 904e3bdf3a import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1183915 - Put images dragged from content processes in the drag data in the parent. r=smaug (72906fab07)
- Bug 1192394 - Force an image load whenever the thumbnail file changes. r=adw (c194d868f9)
- let-var (f5e9a53170)
- Bug 1250109 - Change DOMEventTargetHelper subclasses to not assume that GetOwner() is non-null, since it can be nulled out by navigation. r=bzbarsky (deb440c2a4)
- Bug 911216 - Part 1: Add tests directly testing content Promise constructor resolved with chrome Promise. r=bz (1b2f1ec6b8)
- Bug 911216 - Part 2: Add self-hosting intrinsic for calling wrapped functions without wrapper security checks. r=efaust,bholley (de086e8422)
- Bug 911216 - Part 3: Allow wrapped self-hosted functions and intrinsics in the callFunction debug check. r=efaust (c02e6337fe)
- Bug 1251921 - Do not call debugger hooks with half-initialized frame if InterpeterFrame::prologue fails. (r=jorendorff) (9873720345)
- Bug 1256342. Fix typed array iteration to work correctly over Xrays. r=till (6a7f5c12c6)
- Bug 1256376. Fix forEach on typed arrays to work over Xrays from web extension sandboxes. r=till (ab19703ab5)
- Bug 911216 - Part 4: Add self-hosting intrinsic for creating arrays in other compartments. r=efaust (37b14521fb)
- Bug 1233497 - Temporarily allow unsafe CPOWs in Promise-backend.js and Task.jsm. r=billm (d2672a456a)
- Bug 1225041 - Implement ES6 Annex B.3.5 for direct eval. (r=jorendorff) (daf24f0e34)
- Bug 1254185 - Deal with missing arguments assigned to block bindings. (r=jimb) (3ce53dcd06)
- Bug 1250506 - check if node is acceptable as a child before creating an accessible for it, r=davidb (5960ba726d)
- Bug 1251941 - aria::GetRoleMap should take element, r=davidb (e9ee4e20ea)
- Bug 1251944 - get rid of nsCoreUtils::GetRoleContent, r=davidb (a2bf199bb4)
- Bug 1257030 - Add support for supplying preexisting stack instead of capturing one for use as the async parent stack of CallbackObject. r=bz,tromey (a4ddb41fac)
- Bug 1232291 - Non-used header in MessagePortService.*, r=smaug (1e2398e314)
- Bug 1255655 - Const-ify sWAIRoleMaps. r=tbsaunde. (09653e44af)
- align (24667f7952)
- Bug 1253438 - Expose Push observer notification topics. r=markh (b62a068d4b)
2024-03-16 12:29:41 +08:00

65 lines
1.9 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* A common base class for representing WebIDL callback function types in C++.
*
* This class implements common functionality like lifetime
* management, initialization with the callable, and setup of the call
* environment. Subclasses corresponding to particular callback
* function types should provide a Call() method that actually does
* the call.
*/
#ifndef mozilla_dom_CallbackFunction_h
#define mozilla_dom_CallbackFunction_h
#include "mozilla/dom/CallbackObject.h"
namespace mozilla {
namespace dom {
class CallbackFunction : public CallbackObject
{
public:
// See CallbackObject for an explanation of the arguments.
explicit CallbackFunction(JSContext* aCx, JS::Handle<JSObject*> aCallable,
nsIGlobalObject* aIncumbentGlobal)
: CallbackObject(aCx, aCallable, aIncumbentGlobal)
{
}
// See CallbackObject for an explanation of the arguments.
explicit CallbackFunction(JS::Handle<JSObject*> aCallable,
JS::Handle<JSObject*> aAsyncStack,
nsIGlobalObject* aIncumbentGlobal)
: CallbackObject(aCallable, aAsyncStack, aIncumbentGlobal)
{
}
JS::Handle<JSObject*> Callable() const
{
return Callback();
}
bool HasGrayCallable() const
{
// Play it safe in case this gets called after unlink.
return mCallback && JS::ObjectIsMarkedGray(mCallback);
}
protected:
explicit CallbackFunction(CallbackFunction* aCallbackFunction)
: CallbackObject(aCallbackFunction)
{
}
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_CallbackFunction_h