-
-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathURLImpl.h
More file actions
133 lines (86 loc) · 4.5 KB
/
URLImpl.h
File metadata and controls
133 lines (86 loc) · 4.5 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
//
// Created by Osei Fortune on 15/011/2023.
//
#pragma once
#include <vector>
#include "ada/ada.h"
#include "Common.h"
using namespace ada;
namespace tns {
class URLImpl {
public:
URLImpl(url_aggregator url);
url_aggregator *GetURL();
static void Init(v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> globalTemplate);
static URLImpl *GetPointer(v8::Local<v8::Object> object);
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate);
static void Ctor(const v8::FunctionCallbackInfo<v8::Value> &args);
static void
GetHash(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
static void SetHash(v8::Local<v8::String> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void> &info);
static void
GetHost(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
static void SetHost(v8::Local<v8::String> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void> &info);
static void
GetHostName(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
static void SetHostName(v8::Local<v8::String> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void> &info);
static void
GetHref(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
static void SetHref(v8::Local<v8::String> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void> &info);
static void
GetOrigin(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
static void
GetPassword(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
static void SetPassword(v8::Local<v8::String> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void> &info);
static void
GetPathName(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
static void SetPathName(v8::Local<v8::String> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void> &info);
static void
GetPort(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
static void SetPort(v8::Local<v8::String> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void> &info);
static void
GetProtocol(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
static void SetProtocol(v8::Local<v8::String> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void> &info);
static void
GetSearch(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
static void SetSearch(v8::Local<v8::String> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void> &info);
static void
GetUserName(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value> &info);
static void SetUserName(v8::Local<v8::String> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void> &info);
static void ToString(const v8::FunctionCallbackInfo<v8::Value> &args);
static void CanParse(const v8::FunctionCallbackInfo<v8::Value> &args);
void BindFinalizer(v8::Isolate *isolate, const v8::Local<v8::Object> &object) {
v8::HandleScope scopedHandle(isolate);
weakHandle_.Reset(isolate, object);
weakHandle_.SetWeak(this, Finalizer, v8::WeakCallbackType::kParameter);
}
static void Finalizer(const v8::WeakCallbackInfo<URLImpl> &data) {
auto *pThis = data.GetParameter();
pThis->weakHandle_.Reset();
delete pThis;
}
private:
url_aggregator url_;
v8::Global<v8::Object> weakHandle_;
};
}