-
Notifications
You must be signed in to change notification settings - Fork 160
Expand file tree
/
Copy pathV8ObjectHolder.h
More file actions
71 lines (55 loc) · 1.8 KB
/
V8ObjectHolder.h
File metadata and controls
71 lines (55 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#pragma once
//-----------------------------------------------------------------------------
// forward declarations
//-----------------------------------------------------------------------------
class V8IsolateImpl;
//-----------------------------------------------------------------------------
// V8SharedObjectInfo
//-----------------------------------------------------------------------------
class V8SharedObjectInfo final: public SharedPtrTarget
{
public:
V8SharedObjectInfo(std::shared_ptr<v8::BackingStore>&& spBackingStore, size_t offset, size_t size, size_t length):
m_spBackingStore(std::move(spBackingStore)),
m_Offset(offset),
m_Size(size),
m_Length(length)
{
}
const std::shared_ptr<v8::BackingStore>& GetBackingStore() const
{
return m_spBackingStore;
}
size_t GetOffset() const
{
return m_Offset;
}
size_t GetSize() const
{
return m_Size;
}
size_t GetLength() const
{
return m_Length;
}
private:
std::shared_ptr<v8::BackingStore> m_spBackingStore;
size_t m_Offset;
size_t m_Size;
size_t m_Length;
};
//-----------------------------------------------------------------------------
// V8ObjectHolder
//-----------------------------------------------------------------------------
class V8ObjectHolder: public SharedPtrTarget
{
public:
virtual V8ObjectHolder* Clone() const = 0;
virtual bool IsSameIsolate(const SharedPtr<V8IsolateImpl>& spThat) const = 0;
virtual void* GetObject() const = 0;
virtual int32_t GetIdentityHash() const = 0;
virtual const SharedPtr<V8SharedObjectInfo>& GetSharedObjectInfo() const = 0;
virtual ~V8ObjectHolder() {}
};