| Index: test/inspector-protocol/inspector-client-impl.h
|
| diff --git a/test/inspector-protocol/inspector-client-impl.h b/test/inspector-protocol/inspector-client-impl.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b37775c7db4eaeb2f63666a09f3e86f3e8b0aea0
|
| --- /dev/null
|
| +++ b/test/inspector-protocol/inspector-client-impl.h
|
| @@ -0,0 +1,67 @@
|
| +// Copyright 2016 the V8 project authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef V8_TEST_INSPECTOR_PROTOCOL_INSPECTOR_CLIENT_IMPL_H_
|
| +#define V8_TEST_INSPECTOR_PROTOCOL_INSPECTOR_CLIENT_IMPL_H_
|
| +
|
| +#include "include/v8-inspector.h"
|
| +#include "include/v8.h"
|
| +#include "src/base/macros.h"
|
| +#include "test/inspector-protocol/task.h"
|
| +
|
| +namespace v8 {
|
| +namespace base {
|
| +class Semaphore;
|
| +} // base
|
| +} // v8
|
| +
|
| +namespace v8_inspector {
|
| +
|
| +class ChannelImpl;
|
| +
|
| +class V8InspectorClientImpl : public V8InspectorClient {
|
| + public:
|
| + V8InspectorClientImpl();
|
| + virtual ~V8InspectorClientImpl();
|
| +
|
| + void connect(ChannelImpl* channel, v8::Local<v8::Context>);
|
| +
|
| + // V8InspectorClient implementation.
|
| + v8::Local<v8::Context> ensureDefaultContextInGroup(int) override;
|
| + double currentTimeMS() override;
|
| + void runMessageLoopOnPause(int) override;
|
| + void quitMessageLoopOnPause() override;
|
| +
|
| + static V8Inspector* InspectorFromContext(v8::Local<v8::Context> context);
|
| + static V8InspectorSession* SessionFromContext(v8::Local<v8::Context> context);
|
| +
|
| + private:
|
| + std::unique_ptr<V8Inspector> inspector_;
|
| + std::unique_ptr<V8InspectorSession> session_;
|
| + v8::Isolate* isolate_;
|
| + v8::Global<v8::Context> context_;
|
| + bool running_message_loop_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(V8InspectorClientImpl);
|
| +};
|
| +
|
| +class ConnectTask : public Task {
|
| + public:
|
| + ConnectTask(V8InspectorClientImpl* client, ChannelImpl* channel,
|
| + v8::base::Semaphore* ready);
|
| + virtual ~ConnectTask() {}
|
| +
|
| + bool is_protocol_task() { return true; }
|
| +
|
| + void Run(v8::Isolate* isolate, const v8::Global<v8::Context>& context);
|
| +
|
| + private:
|
| + V8InspectorClientImpl* client_;
|
| + ChannelImpl* channel_;
|
| + v8::base::Semaphore* ready_;
|
| +};
|
| +
|
| +} // namespace v8_inspector
|
| +
|
| +#endif // V8_TEST_INSPECTOR_PROTOCOL_INSPECTOR_CLIENT_IMPL_H_
|
|
|