Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: test/inspector/inspector-impl.cc

Issue 2527473004: [inspector] removed old v8_inspector::Channel API (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/d8.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 = v8::Context::kDebugIdIndex + 1;
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 sendProtocolResponse(int callId, 22 void sendResponse(
23 const v8_inspector::StringView& message) override { 23 int callId,
24 frontend_channel_->SendMessageToFrontend(message); 24 std::unique_ptr<v8_inspector::StringBuffer> message) override {
25 frontend_channel_->SendMessageToFrontend(message->string());
25 } 26 }
26 void sendProtocolNotification( 27 void sendNotification(
27 const v8_inspector::StringView& message) override { 28 std::unique_ptr<v8_inspector::StringBuffer> message) override {
28 frontend_channel_->SendMessageToFrontend(message); 29 frontend_channel_->SendMessageToFrontend(message->string());
29 } 30 }
30 void flushProtocolNotifications() override {} 31 void flushProtocolNotifications() override {}
31 32
32 InspectorClientImpl::FrontendChannel* frontend_channel_; 33 InspectorClientImpl::FrontendChannel* frontend_channel_;
33 DISALLOW_COPY_AND_ASSIGN(ChannelImpl); 34 DISALLOW_COPY_AND_ASSIGN(ChannelImpl);
34 }; 35 };
35 36
36 InspectorClientImpl* InspectorClientFromContext( 37 InspectorClientImpl* InspectorClientFromContext(
37 v8::Local<v8::Context> context) { 38 v8::Local<v8::Context> context) {
38 InspectorClientImpl* inspector_client = static_cast<InspectorClientImpl*>( 39 InspectorClientImpl* inspector_client = static_cast<InspectorClientImpl*>(
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 isolate, SendMessageToBackendExtension::SendMessageToBackend); 194 isolate, SendMessageToBackendExtension::SendMessageToBackend);
194 } 195 }
195 196
196 void SendMessageToBackendExtension::SendMessageToBackend( 197 void SendMessageToBackendExtension::SendMessageToBackend(
197 const v8::FunctionCallbackInfo<v8::Value>& args) { 198 const v8::FunctionCallbackInfo<v8::Value>& args) {
198 CHECK(backend_task_runner_); 199 CHECK(backend_task_runner_);
199 CHECK(args.Length() == 1 && args[0]->IsString()); 200 CHECK(args.Length() == 1 && args[0]->IsString());
200 v8::Local<v8::String> message = args[0].As<v8::String>(); 201 v8::Local<v8::String> message = args[0].As<v8::String>();
201 backend_task_runner_->Append(new SendMessageToBackendTask(ToVector(message))); 202 backend_task_runner_->Append(new SendMessageToBackendTask(ToVector(message)));
202 } 203 }
OLDNEW
« no previous file with comments | « src/d8.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698