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_JavaScriptChild_h_
|
|
|
|
#define mozilla_jsipc_JavaScriptChild_h_
|
|
|
|
|
2014-05-17 03:40:36 +04:00
|
|
|
#include "JavaScriptBase.h"
|
2013-07-03 11:24:32 +04:00
|
|
|
#include "mozilla/jsipc/PJavaScriptChild.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace jsipc {
|
|
|
|
|
2014-05-17 03:40:36 +04:00
|
|
|
class JavaScriptChild : public JavaScriptBase<PJavaScriptChild>
|
2013-07-03 11:24:32 +04:00
|
|
|
{
|
|
|
|
public:
|
2015-03-29 01:22:11 +03:00
|
|
|
explicit JavaScriptChild(JSRuntime* rt);
|
2014-05-17 03:40:37 +04:00
|
|
|
virtual ~JavaScriptChild();
|
2013-07-03 11:24:32 +04:00
|
|
|
|
|
|
|
bool init();
|
2014-09-24 15:54:11 +04:00
|
|
|
void updateWeakPointers();
|
2013-07-03 11:24:32 +04:00
|
|
|
|
2015-03-29 01:22:11 +03:00
|
|
|
void drop(JSObject* obj);
|
2013-07-11 19:23:34 +04:00
|
|
|
|
2014-05-29 05:05:22 +04:00
|
|
|
protected:
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool isParent() override { return false; }
|
2015-03-29 01:22:11 +03:00
|
|
|
virtual JSObject* scopeForTargetObjects() override;
|
2014-05-29 05:05:22 +04:00
|
|
|
|
2013-07-03 11:24:32 +04:00
|
|
|
private:
|
2015-03-29 01:22:11 +03:00
|
|
|
bool fail(JSContext* cx, ReturnStatus* rs);
|
|
|
|
bool ok(ReturnStatus* rs);
|
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
|