2013-07-03 11:24:32 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
* vim: set ts=4 sw=4 et 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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_jsipc_JavaScriptParent__
|
|
|
|
#define mozilla_jsipc_JavaScriptParent__
|
|
|
|
|
2014-05-17 03:40:36 +04:00
|
|
|
#include "JavaScriptBase.h"
|
2013-07-03 11:24:32 +04:00
|
|
|
#include "mozilla/jsipc/PJavaScriptParent.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace jsipc {
|
|
|
|
|
2014-05-17 03:40:36 +04:00
|
|
|
class JavaScriptParent : public JavaScriptBase<PJavaScriptParent>
|
2013-07-03 11:24:32 +04:00
|
|
|
{
|
|
|
|
public:
|
2016-10-19 01:58:33 +03:00
|
|
|
JavaScriptParent() : savedNextCPOWNumber_(1) {}
|
2014-05-17 03:40:37 +04:00
|
|
|
virtual ~JavaScriptParent();
|
2013-07-03 11:24:32 +04:00
|
|
|
|
|
|
|
bool init();
|
2015-03-29 01:22:11 +03:00
|
|
|
void trace(JSTracer* trc);
|
2014-02-05 20:39:59 +04:00
|
|
|
|
2015-03-29 01:22:11 +03:00
|
|
|
void drop(JSObject* obj);
|
2013-07-03 11:24:32 +04:00
|
|
|
|
2015-10-24 02:31:54 +03:00
|
|
|
bool allowMessage(JSContext* cx) override;
|
2016-10-19 01:58:33 +03:00
|
|
|
void afterProcessTask();
|
2014-05-29 05:05:22 +04:00
|
|
|
|
|
|
|
protected:
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool isParent() override { return true; }
|
2015-03-29 01:22:11 +03:00
|
|
|
virtual JSObject* scopeForTargetObjects() override;
|
2016-10-19 01:58:33 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
uint64_t savedNextCPOWNumber_;
|
2013-07-03 11:24:32 +04:00
|
|
|
};
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace jsipc
|
|
|
|
} // namespace mozilla
|
2013-07-03 11:24:32 +04:00
|
|
|
|
|
|
|
#endif // mozilla_jsipc_JavaScriptWrapper_h__
|
|
|
|
|