@@ -16,6 +16,7 @@ namespace inspector {
1616
1717using v8::EscapableHandleScope;
1818using v8::HandleScope;
19+ using v8::Isolate;
1920using v8::Just;
2021using v8::Local;
2122using v8::Maybe;
@@ -29,31 +30,31 @@ using v8::Value;
2930Maybe<protocol::String> ObjectGetProtocolString (v8::Local<v8::Context> context,
3031 Local<Object> object,
3132 Local<v8::String> property) {
32- HandleScope handle_scope (context-> GetIsolate ());
33+ HandleScope handle_scope (Isolate::GetCurrent ());
3334 Local<Value> value;
3435 if (!object->Get (context, property).ToLocal (&value) || !value->IsString ()) {
3536 return Nothing<protocol::String>();
3637 }
3738 Local<v8::String> str = value.As <v8::String>();
38- return Just (ToProtocolString (context-> GetIsolate (), str));
39+ return Just (ToProtocolString (Isolate::GetCurrent (), str));
3940}
4041
4142// Get a protocol string property from the object.
4243Maybe<protocol::String> ObjectGetProtocolString (v8::Local<v8::Context> context,
4344 Local<Object> object,
4445 const char * property) {
45- HandleScope handle_scope (context-> GetIsolate ());
46+ HandleScope handle_scope (Isolate::GetCurrent ());
4647 return ObjectGetProtocolString (
47- context, object, OneByteString (context-> GetIsolate (), property));
48+ context, object, OneByteString (Isolate::GetCurrent (), property));
4849}
4950
5051// Get a protocol double property from the object.
5152Maybe<double > ObjectGetDouble (v8::Local<v8::Context> context,
5253 Local<Object> object,
5354 const char * property) {
54- HandleScope handle_scope (context-> GetIsolate ());
55+ HandleScope handle_scope (Isolate::GetCurrent ());
5556 Local<Value> value;
56- if (!object->Get (context, OneByteString (context-> GetIsolate (), property))
57+ if (!object->Get (context, OneByteString (Isolate::GetCurrent (), property))
5758 .ToLocal (&value) ||
5859 !value->IsNumber ()) {
5960 return Nothing<double >();
@@ -65,9 +66,9 @@ Maybe<double> ObjectGetDouble(v8::Local<v8::Context> context,
6566Maybe<int > ObjectGetInt (v8::Local<v8::Context> context,
6667 Local<Object> object,
6768 const char * property) {
68- HandleScope handle_scope (context-> GetIsolate ());
69+ HandleScope handle_scope (Isolate::GetCurrent ());
6970 Local<Value> value;
70- if (!object->Get (context, OneByteString (context-> GetIsolate (), property))
71+ if (!object->Get (context, OneByteString (Isolate::GetCurrent (), property))
7172 .ToLocal (&value) ||
7273 !value->IsInt32 ()) {
7374 return Nothing<int >();
@@ -79,9 +80,9 @@ Maybe<int> ObjectGetInt(v8::Local<v8::Context> context,
7980Maybe<bool > ObjectGetBool (v8::Local<v8::Context> context,
8081 Local<Object> object,
8182 const char * property) {
82- HandleScope handle_scope (context-> GetIsolate ());
83+ HandleScope handle_scope (Isolate::GetCurrent ());
8384 Local<Value> value;
84- if (!object->Get (context, OneByteString (context-> GetIsolate (), property))
85+ if (!object->Get (context, OneByteString (Isolate::GetCurrent (), property))
8586 .ToLocal (&value) ||
8687 !value->IsBoolean ()) {
8788 return Nothing<bool >();
@@ -93,9 +94,9 @@ Maybe<bool> ObjectGetBool(v8::Local<v8::Context> context,
9394MaybeLocal<v8::Object> ObjectGetObject (v8::Local<v8::Context> context,
9495 Local<Object> object,
9596 const char * property) {
96- EscapableHandleScope handle_scope (context-> GetIsolate ());
97+ EscapableHandleScope handle_scope (Isolate::GetCurrent ());
9798 Local<Value> value;
98- if (!object->Get (context, OneByteString (context-> GetIsolate (), property))
99+ if (!object->Get (context, OneByteString (Isolate::GetCurrent (), property))
99100 .ToLocal (&value) ||
100101 !value->IsObject ()) {
101102 return {};
@@ -106,7 +107,7 @@ MaybeLocal<v8::Object> ObjectGetObject(v8::Local<v8::Context> context,
106107// Create a protocol::Network::Headers from the v8 object.
107108std::unique_ptr<protocol::Network::Headers> createHeadersFromObject (
108109 v8::Local<v8::Context> context, Local<Object> headers_obj) {
109- HandleScope handle_scope (context-> GetIsolate ());
110+ HandleScope handle_scope (Isolate::GetCurrent ());
110111
111112 std::unique_ptr<protocol::DictionaryValue> dict =
112113 protocol::DictionaryValue::create ();
@@ -127,7 +128,7 @@ std::unique_ptr<protocol::Network::Headers> createHeadersFromObject(
127128 .To (&property_value)) {
128129 return {};
129130 }
130- dict->setString (ToProtocolString (context-> GetIsolate (), property_name),
131+ dict->setString (ToProtocolString (Isolate::GetCurrent (), property_name),
131132 property_value);
132133 }
133134
@@ -137,7 +138,7 @@ std::unique_ptr<protocol::Network::Headers> createHeadersFromObject(
137138// Create a protocol::Network::Request from the v8 object.
138139std::unique_ptr<protocol::Network::Request> createRequestFromObject (
139140 v8::Local<v8::Context> context, Local<Object> request) {
140- HandleScope handle_scope (context-> GetIsolate ());
141+ HandleScope handle_scope (Isolate::GetCurrent ());
141142 protocol::String url;
142143 if (!ObjectGetProtocolString (context, request, " url" ).To (&url)) {
143144 return {};
@@ -169,7 +170,7 @@ std::unique_ptr<protocol::Network::Request> createRequestFromObject(
169170// Create a protocol::Network::Response from the v8 object.
170171std::unique_ptr<protocol::Network::Response> createResponseFromObject (
171172 v8::Local<v8::Context> context, Local<Object> response) {
172- HandleScope handle_scope (context-> GetIsolate ());
173+ HandleScope handle_scope (Isolate::GetCurrent ());
173174 protocol::String url;
174175 if (!ObjectGetProtocolString (context, response, " url" ).To (&url)) {
175176 return {};
@@ -210,7 +211,7 @@ std::unique_ptr<protocol::Network::Response> createResponseFromObject(
210211
211212std::unique_ptr<protocol::Network::WebSocketResponse> createWebSocketResponse (
212213 v8::Local<v8::Context> context, Local<Object> response) {
213- HandleScope handle_scope (context-> GetIsolate ());
214+ HandleScope handle_scope (Isolate::GetCurrent ());
214215 int status;
215216 if (!ObjectGetInt (context, response, " status" ).To (&status)) {
216217 return {};
0 commit comments