js/ipc/JavaScriptParent.h
author Coroiu Cristina <ccoroiu@mozilla.com>
Fri, 13 Apr 2018 19:49:14 +0300
changeset 469282 bab10eeb6799a277b7237851293041cbec55a370
parent 363801 99bf3401b43f4f621c91facce91f729688941317
child 488920 ad30dc53e38ec41adc99f81fd8a5102ecf7775fd
permissions -rw-r--r--
Backed out 4 changesets (bug 1453480) for failing browser-chrome at browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_site_data.js on a CLOSED TREE Backed out changeset 623b37fe0fe8 (bug 1453480) Backed out changeset a3c36fa7ac0c (bug 1453480) Backed out changeset 46a634d6853c (bug 1453480) Backed out changeset 658fedb903d0 (bug 1453480)

/* -*- 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__

#include "JavaScriptBase.h"
#include "mozilla/jsipc/PJavaScriptParent.h"

namespace mozilla {
namespace jsipc {

class JavaScriptParent : public JavaScriptBase<PJavaScriptParent>
{
  public:
    JavaScriptParent() : savedNextCPOWNumber_(1) {}
    virtual ~JavaScriptParent();

    bool init();
    void trace(JSTracer* trc);

    void drop(JSObject* obj);

    bool allowMessage(JSContext* cx) override;
    void afterProcessTask();

  protected:
    virtual bool isParent() override { return true; }
    virtual JSObject* scopeForTargetObjects() override;

  private:
    uint64_t savedNextCPOWNumber_;
};

} // namespace jsipc
} // namespace mozilla

#endif // mozilla_jsipc_JavaScriptWrapper_h__