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