1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_asmjscache_asmjscache_h
8 #define mozilla_dom_asmjscache_asmjscache_h
10 #include "ipc/IPCMessageUtils.h"
11 #include "js/TypeDecls.h"
12 #include "js/Vector.h"
23 namespace asmjscache
{
25 class PAsmJSCacheEntryChild
;
26 class PAsmJSCacheEntryParent
;
35 // Implementation of AsmJSCacheOps, installed by nsJSEnvironment:
38 OpenEntryForRead(JS::Handle
<JSObject
*> aGlobal
,
42 const uint8_t** aMemory
,
45 CloseEntryForRead(JS::Handle
<JSObject
*> aGlobal
,
47 const uint8_t* aMemory
,
50 OpenEntryForWrite(JS::Handle
<JSObject
*> aGlobal
,
57 CloseEntryForWrite(JS::Handle
<JSObject
*> aGlobal
,
62 GetBuildId(js::Vector
<char>* aBuildId
);
64 // Called from QuotaManager.cpp:
69 // Called from ipc/ContentParent.cpp:
71 PAsmJSCacheEntryParent
*
72 AllocEntryParent(OpenMode aOpenMode
, uint32_t aSizeToWrite
,
73 nsIPrincipal
* aPrincipal
);
76 DeallocEntryParent(PAsmJSCacheEntryParent
* aActor
);
78 // Called from ipc/ContentChild.cpp:
81 DeallocEntryChild(PAsmJSCacheEntryChild
* aActor
);
83 } // namespace asmjscache
85 } // namespace mozilla
90 struct ParamTraits
<mozilla::dom::asmjscache::OpenMode
> :
91 public EnumSerializer
<mozilla::dom::asmjscache::OpenMode
,
92 mozilla::dom::asmjscache::eOpenForRead
,
93 mozilla::dom::asmjscache::NUM_OPEN_MODES
>
98 #endif // mozilla_dom_asmjscache_asmjscache_h