@@ -16,6 +16,7 @@ namespace inspector {
16
16
17
17
using v8::EscapableHandleScope;
18
18
using v8::HandleScope;
19
+ using v8::Isolate;
19
20
using v8::Just;
20
21
using v8::Local;
21
22
using v8::Maybe;
@@ -29,31 +30,31 @@ using v8::Value;
29
30
Maybe<protocol::String> ObjectGetProtocolString (v8::Local<v8::Context> context,
30
31
Local<Object> object,
31
32
Local<v8::String> property) {
32
- HandleScope handle_scope (context-> GetIsolate ());
33
+ HandleScope handle_scope (Isolate::GetCurrent ());
33
34
Local<Value> value;
34
35
if (!object->Get (context, property).ToLocal (&value) || !value->IsString ()) {
35
36
return Nothing<protocol::String>();
36
37
}
37
38
Local<v8::String> str = value.As <v8::String>();
38
- return Just (ToProtocolString (context-> GetIsolate (), str));
39
+ return Just (ToProtocolString (Isolate::GetCurrent (), str));
39
40
}
40
41
41
42
// Get a protocol string property from the object.
42
43
Maybe<protocol::String> ObjectGetProtocolString (v8::Local<v8::Context> context,
43
44
Local<Object> object,
44
45
const char * property) {
45
- HandleScope handle_scope (context-> GetIsolate ());
46
+ HandleScope handle_scope (Isolate::GetCurrent ());
46
47
return ObjectGetProtocolString (
47
- context, object, OneByteString (context-> GetIsolate (), property));
48
+ context, object, OneByteString (Isolate::GetCurrent (), property));
48
49
}
49
50
50
51
// Get a protocol double property from the object.
51
52
Maybe<double > ObjectGetDouble (v8::Local<v8::Context> context,
52
53
Local<Object> object,
53
54
const char * property) {
54
- HandleScope handle_scope (context-> GetIsolate ());
55
+ HandleScope handle_scope (Isolate::GetCurrent ());
55
56
Local<Value> value;
56
- if (!object->Get (context, OneByteString (context-> GetIsolate (), property))
57
+ if (!object->Get (context, OneByteString (Isolate::GetCurrent (), property))
57
58
.ToLocal (&value) ||
58
59
!value->IsNumber ()) {
59
60
return Nothing<double >();
@@ -65,9 +66,9 @@ Maybe<double> ObjectGetDouble(v8::Local<v8::Context> context,
65
66
Maybe<int > ObjectGetInt (v8::Local<v8::Context> context,
66
67
Local<Object> object,
67
68
const char * property) {
68
- HandleScope handle_scope (context-> GetIsolate ());
69
+ HandleScope handle_scope (Isolate::GetCurrent ());
69
70
Local<Value> value;
70
- if (!object->Get (context, OneByteString (context-> GetIsolate (), property))
71
+ if (!object->Get (context, OneByteString (Isolate::GetCurrent (), property))
71
72
.ToLocal (&value) ||
72
73
!value->IsInt32 ()) {
73
74
return Nothing<int >();
@@ -79,9 +80,9 @@ Maybe<int> ObjectGetInt(v8::Local<v8::Context> context,
79
80
Maybe<bool > ObjectGetBool (v8::Local<v8::Context> context,
80
81
Local<Object> object,
81
82
const char * property) {
82
- HandleScope handle_scope (context-> GetIsolate ());
83
+ HandleScope handle_scope (Isolate::GetCurrent ());
83
84
Local<Value> value;
84
- if (!object->Get (context, OneByteString (context-> GetIsolate (), property))
85
+ if (!object->Get (context, OneByteString (Isolate::GetCurrent (), property))
85
86
.ToLocal (&value) ||
86
87
!value->IsBoolean ()) {
87
88
return Nothing<bool >();
@@ -93,9 +94,9 @@ Maybe<bool> ObjectGetBool(v8::Local<v8::Context> context,
93
94
MaybeLocal<v8::Object> ObjectGetObject (v8::Local<v8::Context> context,
94
95
Local<Object> object,
95
96
const char * property) {
96
- EscapableHandleScope handle_scope (context-> GetIsolate ());
97
+ EscapableHandleScope handle_scope (Isolate::GetCurrent ());
97
98
Local<Value> value;
98
- if (!object->Get (context, OneByteString (context-> GetIsolate (), property))
99
+ if (!object->Get (context, OneByteString (Isolate::GetCurrent (), property))
99
100
.ToLocal (&value) ||
100
101
!value->IsObject ()) {
101
102
return {};
@@ -106,7 +107,7 @@ MaybeLocal<v8::Object> ObjectGetObject(v8::Local<v8::Context> context,
106
107
// Create a protocol::Network::Headers from the v8 object.
107
108
std::unique_ptr<protocol::Network::Headers> createHeadersFromObject (
108
109
v8::Local<v8::Context> context, Local<Object> headers_obj) {
109
- HandleScope handle_scope (context-> GetIsolate ());
110
+ HandleScope handle_scope (Isolate::GetCurrent ());
110
111
111
112
std::unique_ptr<protocol::DictionaryValue> dict =
112
113
protocol::DictionaryValue::create ();
@@ -127,7 +128,7 @@ std::unique_ptr<protocol::Network::Headers> createHeadersFromObject(
127
128
.To (&property_value)) {
128
129
return {};
129
130
}
130
- dict->setString (ToProtocolString (context-> GetIsolate (), property_name),
131
+ dict->setString (ToProtocolString (Isolate::GetCurrent (), property_name),
131
132
property_value);
132
133
}
133
134
@@ -137,7 +138,7 @@ std::unique_ptr<protocol::Network::Headers> createHeadersFromObject(
137
138
// Create a protocol::Network::Request from the v8 object.
138
139
std::unique_ptr<protocol::Network::Request> createRequestFromObject (
139
140
v8::Local<v8::Context> context, Local<Object> request) {
140
- HandleScope handle_scope (context-> GetIsolate ());
141
+ HandleScope handle_scope (Isolate::GetCurrent ());
141
142
protocol::String url;
142
143
if (!ObjectGetProtocolString (context, request, " url" ).To (&url)) {
143
144
return {};
@@ -169,7 +170,7 @@ std::unique_ptr<protocol::Network::Request> createRequestFromObject(
169
170
// Create a protocol::Network::Response from the v8 object.
170
171
std::unique_ptr<protocol::Network::Response> createResponseFromObject (
171
172
v8::Local<v8::Context> context, Local<Object> response) {
172
- HandleScope handle_scope (context-> GetIsolate ());
173
+ HandleScope handle_scope (Isolate::GetCurrent ());
173
174
protocol::String url;
174
175
if (!ObjectGetProtocolString (context, response, " url" ).To (&url)) {
175
176
return {};
@@ -210,7 +211,7 @@ std::unique_ptr<protocol::Network::Response> createResponseFromObject(
210
211
211
212
std::unique_ptr<protocol::Network::WebSocketResponse> createWebSocketResponse (
212
213
v8::Local<v8::Context> context, Local<Object> response) {
213
- HandleScope handle_scope (context-> GetIsolate ());
214
+ HandleScope handle_scope (Isolate::GetCurrent ());
214
215
int status;
215
216
if (!ObjectGetInt (context, response, " status" ).To (&status)) {
216
217
return {};
0 commit comments