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

Unified Diff: test/inspector/inspector-impl.cc

Issue 2886903003: [inspector] Pass TaskRunner instead of Context to all tasks (Closed)
Patch Set: methods visibility Created 3 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/inspector/inspector-test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/inspector-impl.cc
diff --git a/test/inspector/inspector-impl.cc b/test/inspector/inspector-impl.cc
index 1090cb87847f1f529a2960ee7fccbddf9f195ef5..408f47529227e42eee5af6c5949e1e921eb25046 100644
--- a/test/inspector/inspector-impl.cc
+++ b/test/inspector/inspector-impl.cc
@@ -114,15 +114,13 @@ class ConnectTask : public TaskRunner::Task {
bool is_inspector_task() final { return true; }
- void Run(v8::Isolate* isolate,
- const v8::Global<v8::Context>& global_context) {
- v8::HandleScope handle_scope(isolate);
- v8::Local<v8::Context> context = global_context.Get(isolate);
- client_->connect(context);
+ private:
+ void Run() override {
+ v8::HandleScope handle_scope(isolate());
+ client_->connect(default_context());
if (ready_semaphore_) ready_semaphore_->Signal();
}
- private:
InspectorClientImpl* client_;
v8::base::Semaphore* ready_semaphore_;
};
@@ -138,13 +136,12 @@ class DisconnectTask : public TaskRunner::Task {
bool is_inspector_task() final { return true; }
- void Run(v8::Isolate* isolate,
- const v8::Global<v8::Context>& global_context) {
+ private:
+ void Run() override {
client_->disconnect(reset_inspector_);
if (ready_semaphore_) ready_semaphore_->Signal();
}
- private:
InspectorClientImpl* client_;
bool reset_inspector_;
v8::base::Semaphore* ready_semaphore_;
@@ -164,13 +161,12 @@ class CreateContextGroupTask : public TaskRunner::Task {
bool is_inspector_task() final { return true; }
- void Run(v8::Isolate* isolate,
- const v8::Global<v8::Context>& global_context) {
+ private:
+ void Run() override {
*context_group_id_ = client_->createContextGroup(setup_global_tasks_);
if (ready_semaphore_) ready_semaphore_->Signal();
}
- private:
InspectorClientImpl* client_;
TaskRunner::SetupGlobalTasks setup_global_tasks_;
v8::base::Semaphore* ready_semaphore_;
@@ -360,16 +356,15 @@ class SendMessageToBackendTask : public TaskRunner::Task {
bool is_inspector_task() final { return true; }
- void Run(v8::Isolate* isolate,
- const v8::Global<v8::Context>& global_context) override {
+ private:
+ void Run() override {
v8_inspector::V8InspectorSession* session = nullptr;
{
- v8::HandleScope handle_scope(isolate);
- v8::Local<v8::Context> context = global_context.Get(isolate);
+ v8::HandleScope handle_scope(isolate());
if (!context_group_id_) {
- session = InspectorClientImpl::SessionFromContext(context);
+ session = InspectorClientImpl::SessionFromContext(default_context());
} else {
- session = InspectorClientFromContext(context)
+ session = InspectorClientFromContext(default_context())
->sessions_[context_group_id_]
.get();
}
@@ -379,7 +374,6 @@ class SendMessageToBackendTask : public TaskRunner::Task {
session->dispatchProtocolMessage(message_view);
}
- private:
v8::internal::Vector<uint16_t> message_;
int context_group_id_;
};
« no previous file with comments | « no previous file | test/inspector/inspector-test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698