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 {
@@ -339,7 +337,7 @@ class V8NodeInspector : public blink::V8InspectorClient {
339
337
session_->dispatchProtocolMessage (message);
340
338
}
341
339
342
- blink:: V8Inspector* inspector () {
340
+ V8Inspector* inspector () {
343
341
return inspector_.get ();
344
342
}
345
343
@@ -349,8 +347,8 @@ class V8NodeInspector : public blink::V8InspectorClient {
349
347
v8::Platform* platform_;
350
348
bool terminated_;
351
349
bool running_nested_loop_;
352
- std::unique_ptr<blink:: V8Inspector> inspector_;
353
- std::unique_ptr<blink ::V8InspectorSession> session_;
350
+ std::unique_ptr<V8Inspector> inspector_;
351
+ std::unique_ptr<v8_inspector ::V8InspectorSession> session_;
354
352
};
355
353
356
354
AgentImpl::AgentImpl (Environment* env) : port_(0 ),
@@ -417,10 +415,10 @@ void InspectorConsoleCall(const v8::FunctionCallbackInfo<v8::Value>& info) {
417
415
}
418
416
419
417
v8::TryCatch try_catch (info.GetIsolate ());
420
- node_method.As <v8::Function>()->Call (context,
421
- info.Holder (),
422
- call_args.size (),
423
- call_args.data ());
418
+ static_cast < void >( node_method.As <v8::Function>()->Call (context,
419
+ info.Holder (),
420
+ call_args.size (),
421
+ call_args.data () ));
424
422
CHECK (config_object->Delete (context, in_call_key).FromJust ());
425
423
if (try_catch.HasCaught ())
426
424
try_catch.ReThrow ();
@@ -510,7 +508,7 @@ String16 ToProtocolString(v8::Local<v8::Value> value) {
510
508
return String16 ();
511
509
}
512
510
v8::Local<v8::String> string_value = v8::Local<v8::String>::Cast (value);
513
- wstring buffer (string_value->Length (), ' \0 ' );
511
+ std::basic_string< uint16_t > buffer (string_value->Length (), ' \0 ' );
514
512
string_value->Write (&buffer[0 ], 0 , string_value->Length ());
515
513
return String16 (buffer);
516
514
}
@@ -523,7 +521,7 @@ void AgentImpl::FatalException(v8::Local<v8::Value> error,
523
521
v8::Local<v8::Context> context = env->context ();
524
522
525
523
int script_id = message->GetScriptOrigin ().ScriptID ()->Value ();
526
- std::unique_ptr<blink ::V8StackTrace> stack_trace =
524
+ std::unique_ptr<v8_inspector ::V8StackTrace> stack_trace =
527
525
inspector_->inspector ()->createStackTrace (message->GetStackTrace ());
528
526
529
527
if (stack_trace && !stack_trace->isEmpty () &&
@@ -592,7 +590,8 @@ void AgentImpl::OnRemoteDataIO(inspector_socket_t* socket,
592
590
// engages, node should wait for the run callback from the remote client
593
591
// and initiate its startup. This is a change to node.cc that should be
594
592
// upstreamed separately.
595
- if (wait_ && str.find (" \" Runtime.run\" " ) != std::string::npos) {
593
+ if (wait_&& str.find (" \" Runtime.runIfWaitingForDebugger\" " )
594
+ != std::string::npos) {
596
595
wait_ = false ;
597
596
uv_sem_post (&start_sem_);
598
597
}
0 commit comments