JavaScriptParent.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_JavaScriptParent__
  7. #define mozilla_jsipc_JavaScriptParent__
  8. #include "JavaScriptBase.h"
  9. #include "mozilla/jsipc/PJavaScriptParent.h"
  10. namespace mozilla {
  11. namespace jsipc {
  12. class JavaScriptParent : public JavaScriptBase<PJavaScriptParent>
  13. {
  14. public:
  15. JavaScriptParent() : savedNextCPOWNumber_(1) {}
  16. virtual ~JavaScriptParent();
  17. bool init();
  18. void trace(JSTracer* trc);
  19. void drop(JSObject* obj);
  20. bool allowMessage(JSContext* cx) override;
  21. void afterProcessTask();
  22. protected:
  23. virtual bool isParent() override { return true; }
  24. virtual JSObject* scopeForTargetObjects() override;
  25. private:
  26. uint64_t savedNextCPOWNumber_;
  27. };
  28. } // namespace jsipc
  29. } // namespace mozilla
  30. #endif // mozilla_jsipc_JavaScriptWrapper_h__