OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "test/inspector/inspector-impl.h" | 5 #include "test/inspector/inspector-impl.h" |
6 | 6 |
7 #include "include/v8.h" | 7 #include "include/v8.h" |
8 | 8 |
9 #include "src/vector.h" | 9 #include "src/vector.h" |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 const int kInspectorClientIndex = v8::Context::kDebugIdIndex + 1; | 13 const int kInspectorClientIndex = 0; |
14 | 14 |
15 class ChannelImpl final : public v8_inspector::V8Inspector::Channel { | 15 class ChannelImpl final : public v8_inspector::V8Inspector::Channel { |
16 public: | 16 public: |
17 explicit ChannelImpl(InspectorClientImpl::FrontendChannel* frontend_channel) | 17 explicit ChannelImpl(InspectorClientImpl::FrontendChannel* frontend_channel) |
18 : frontend_channel_(frontend_channel) {} | 18 : frontend_channel_(frontend_channel) {} |
19 virtual ~ChannelImpl() = default; | 19 virtual ~ChannelImpl() = default; |
20 | 20 |
21 private: | 21 private: |
22 void sendResponse( | 22 void sendResponse( |
23 int callId, | 23 int callId, |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 } | 341 } |
342 | 342 |
343 void SendMessageToBackendExtension::SendMessageToBackend( | 343 void SendMessageToBackendExtension::SendMessageToBackend( |
344 const v8::FunctionCallbackInfo<v8::Value>& args) { | 344 const v8::FunctionCallbackInfo<v8::Value>& args) { |
345 CHECK(backend_task_runner_); | 345 CHECK(backend_task_runner_); |
346 CHECK(args.Length() == 2 && args[0]->IsString() && args[1]->IsInt32()); | 346 CHECK(args.Length() == 2 && args[0]->IsString() && args[1]->IsInt32()); |
347 v8::Local<v8::String> message = args[0].As<v8::String>(); | 347 v8::Local<v8::String> message = args[0].As<v8::String>(); |
348 backend_task_runner_->Append(new SendMessageToBackendTask( | 348 backend_task_runner_->Append(new SendMessageToBackendTask( |
349 ToVector(message), args[1].As<v8::Int32>()->Value())); | 349 ToVector(message), args[1].As<v8::Int32>()->Value())); |
350 } | 350 } |
OLD | NEW |