14
14
#include " platform/v8_inspector/public/V8InspectorClient.h"
15
15
#include " platform/v8_inspector/public/V8InspectorSession.h"
16
16
#include " platform/v8_inspector/public/V8StackTrace.h"
17
- #include " platform/inspector_protocol/FrontendChannel.h"
18
- #include " platform/inspector_protocol/String16.h"
19
- #include " platform/inspector_protocol/Values.h"
17
+ #include " platform/inspector_protocol/InspectorProtocol.h"
20
18
21
19
#include " libplatform/libplatform.h"
22
20
@@ -196,7 +194,6 @@ class AgentImpl {
196
194
void OnInspectorConnectionIO (inspector_socket_t * socket);
197
195
void OnRemoteDataIO (inspector_socket_t * stream, ssize_t read,
198
196
const uv_buf_t * b);
199
- void PostMessages ();
200
197
void SetConnected (bool connected);
201
198
void DispatchMessages ();
202
199
void Write (int session_id, const String16& message);
@@ -285,7 +282,9 @@ class ChannelImpl final : public blink::protocol::FrontendChannel {
285
282
// Used in V8NodeInspector::currentTimeMS() below.
286
283
#define NANOS_PER_MSEC 1000000
287
284
288
- class V8NodeInspector : public blink ::V8InspectorClient {
285
+ using V8Inspector = v8_inspector::V8Inspector;
286
+
287
+ class V8NodeInspector : public v8_inspector ::V8InspectorClient {
289
288
public:
290
289
V8NodeInspector (AgentImpl* agent, node::Environment* env,
291
290
v8::Platform* platform)
@@ -294,10 +293,9 @@ class V8NodeInspector : public blink::V8InspectorClient {
294
293
platform_(platform),
295
294
terminated_(false ),
296
295
running_nested_loop_(false ),
297
- inspector_(
298
- blink::V8Inspector::create (env->isolate (), this)) {
296
+ inspector_(V8Inspector::create(env->isolate (), this)) {
299
297
inspector_->contextCreated (
300
- blink ::V8ContextInfo (env->context (), 1 , " NodeJS Main Context" ));
298
+ v8_inspector ::V8ContextInfo (env->context (), 1 , " NodeJS Main Context" ));
301
299
}
302
300
303
301
void runMessageLoopOnPause (int context_group_id) override {
@@ -338,7 +336,7 @@ class V8NodeInspector : public blink::V8InspectorClient {
338
336
session_->dispatchProtocolMessage (message);
339
337
}
340
338
341
- blink:: V8Inspector* inspector () {
339
+ V8Inspector* inspector () {
342
340
return inspector_.get ();
343
341
}
344
342
@@ -348,8 +346,8 @@ class V8NodeInspector : public blink::V8InspectorClient {
348
346
v8::Platform* platform_;
349
347
bool terminated_;
350
348
bool running_nested_loop_;
351
- std::unique_ptr<blink:: V8Inspector> inspector_;
352
- std::unique_ptr<blink ::V8InspectorSession> session_;
349
+ std::unique_ptr<V8Inspector> inspector_;
350
+ std::unique_ptr<v8_inspector ::V8InspectorSession> session_;
353
351
};
354
352
355
353
AgentImpl::AgentImpl (Environment* env) : port_(0 ),
@@ -416,10 +414,10 @@ void InspectorConsoleCall(const v8::FunctionCallbackInfo<v8::Value>& info) {
416
414
}
417
415
418
416
v8::TryCatch try_catch (info.GetIsolate ());
419
- node_method.As <v8::Function>()->Call (context,
420
- info.Holder (),
421
- call_args.size (),
422
- call_args.data ());
417
+ static_cast < void >( node_method.As <v8::Function>()->Call (context,
418
+ info.Holder (),
419
+ call_args.size (),
420
+ call_args.data () ));
423
421
CHECK (config_object->Delete (context, in_call_key).FromJust ());
424
422
if (try_catch.HasCaught ())
425
423
try_catch.ReThrow ();
@@ -509,7 +507,7 @@ String16 ToProtocolString(v8::Local<v8::Value> value) {
509
507
return String16 ();
510
508
}
511
509
v8::Local<v8::String> string_value = v8::Local<v8::String>::Cast (value);
512
- wstring buffer (string_value->Length (), ' \0 ' );
510
+ std::basic_string< uint16_t > buffer (string_value->Length (), ' \0 ' );
513
511
string_value->Write (&buffer[0 ], 0 , string_value->Length ());
514
512
return String16 (buffer);
515
513
}
@@ -522,7 +520,7 @@ void AgentImpl::FatalException(v8::Local<v8::Value> error,
522
520
v8::Local<v8::Context> context = env->context ();
523
521
524
522
int script_id = message->GetScriptOrigin ().ScriptID ()->Value ();
525
- std::unique_ptr<blink ::V8StackTrace> stack_trace =
523
+ std::unique_ptr<v8_inspector ::V8StackTrace> stack_trace =
526
524
inspector_->inspector ()->createStackTrace (message->GetStackTrace ());
527
525
528
526
if (stack_trace && !stack_trace->isEmpty () &&
@@ -591,7 +589,8 @@ void AgentImpl::OnRemoteDataIO(inspector_socket_t* socket,
591
589
// engages, node should wait for the run callback from the remote client
592
590
// and initiate its startup. This is a change to node.cc that should be
593
591
// upstreamed separately.
594
- if (wait_ && str.find (" \" Runtime.run\" " ) != std::string::npos) {
592
+ if (wait_&& str.find (" \" Runtime.runIfWaitingForDebugger\" " )
593
+ != std::string::npos) {
595
594
wait_ = false ;
596
595
uv_sem_post (&start_sem_);
597
596
}
0 commit comments