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