WrapperAnswer.h 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2. *
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  6. #ifndef mozilla_jsipc_WrapperAnswer_h_
  7. #define mozilla_jsipc_WrapperAnswer_h_
  8. #include "JavaScriptShared.h"
  9. namespace mozilla {
  10. namespace dom {
  11. class AutoJSAPI;
  12. } // namespace dom
  13. namespace jsipc {
  14. class WrapperAnswer : public virtual JavaScriptShared
  15. {
  16. public:
  17. bool RecvPreventExtensions(const ObjectId& objId, ReturnStatus* rs);
  18. bool RecvGetPropertyDescriptor(const ObjectId& objId, const JSIDVariant& id,
  19. ReturnStatus* rs,
  20. PPropertyDescriptor* out);
  21. bool RecvGetOwnPropertyDescriptor(const ObjectId& objId,
  22. const JSIDVariant& id,
  23. ReturnStatus* rs,
  24. PPropertyDescriptor* out);
  25. bool RecvDefineProperty(const ObjectId& objId, const JSIDVariant& id,
  26. const PPropertyDescriptor& flags, ReturnStatus* rs);
  27. bool RecvDelete(const ObjectId& objId, const JSIDVariant& id, ReturnStatus* rs);
  28. bool RecvHas(const ObjectId& objId, const JSIDVariant& id,
  29. ReturnStatus* rs, bool* foundp);
  30. bool RecvHasOwn(const ObjectId& objId, const JSIDVariant& id,
  31. ReturnStatus* rs, bool* foundp);
  32. bool RecvGet(const ObjectId& objId, const JSVariant& receiverVar,
  33. const JSIDVariant& id,
  34. ReturnStatus* rs, JSVariant* result);
  35. bool RecvSet(const ObjectId& objId, const JSIDVariant& id, const JSVariant& value,
  36. const JSVariant& receiverVar, ReturnStatus* rs);
  37. bool RecvIsExtensible(const ObjectId& objId, ReturnStatus* rs,
  38. bool* result);
  39. bool RecvCallOrConstruct(const ObjectId& objId, InfallibleTArray<JSParam>&& argv,
  40. const bool& construct, ReturnStatus* rs, JSVariant* result,
  41. nsTArray<JSParam>* outparams);
  42. bool RecvHasInstance(const ObjectId& objId, const JSVariant& v, ReturnStatus* rs, bool* bp);
  43. bool RecvGetBuiltinClass(const ObjectId& objId, ReturnStatus* rs,
  44. uint32_t* classValue);
  45. bool RecvIsArray(const ObjectId& objId, ReturnStatus* rs, uint32_t* ans);
  46. bool RecvClassName(const ObjectId& objId, nsCString* result);
  47. bool RecvGetPrototype(const ObjectId& objId, ReturnStatus* rs, ObjectOrNullVariant* result);
  48. bool RecvGetPrototypeIfOrdinary(const ObjectId& objId, ReturnStatus* rs, bool* isOrdinary,
  49. ObjectOrNullVariant* result);
  50. bool RecvRegExpToShared(const ObjectId& objId, ReturnStatus* rs, nsString* source, uint32_t* flags);
  51. bool RecvGetPropertyKeys(const ObjectId& objId, const uint32_t& flags,
  52. ReturnStatus* rs, nsTArray<JSIDVariant>* ids);
  53. bool RecvInstanceOf(const ObjectId& objId, const JSIID& iid,
  54. ReturnStatus* rs, bool* instanceof);
  55. bool RecvDOMInstanceOf(const ObjectId& objId, const int& prototypeID, const int& depth,
  56. ReturnStatus* rs, bool* instanceof);
  57. bool RecvDropObject(const ObjectId& objId);
  58. private:
  59. bool fail(dom::AutoJSAPI& jsapi, ReturnStatus* rs);
  60. bool ok(ReturnStatus* rs);
  61. bool ok(ReturnStatus* rs, const JS::ObjectOpResult& result);
  62. bool deadCPOW(dom::AutoJSAPI& jsapi, ReturnStatus* rs);
  63. };
  64. } // namespace jsipc
  65. } // namespace mozilla
  66. #endif