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

Unified Diff: test/inspector/inspector-test.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 | « test/inspector/inspector-impl.cc ('k') | test/inspector/task-runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/inspector-test.cc
diff --git a/test/inspector/inspector-test.cc b/test/inspector/inspector-test.cc
index d4f465401632df6370c8ceb2041de4036b43c9f9..a3f42ede878df06f530d65f04cd7011c78a69a76 100644
--- a/test/inspector/inspector-test.cc
+++ b/test/inspector/inspector-test.cc
@@ -190,9 +190,8 @@ class UtilsExtension : public TaskRunner::SetupGlobalTask {
v8::internal::Vector<const char> chars;
v8::Isolate* isolate = args.GetIsolate();
if (ReadFile(isolate, args[0], &chars)) {
- ExecuteStringTask task(chars);
- v8::Global<v8::Context> context(isolate, isolate->GetCurrentContext());
- task.Run(isolate, context);
+ ExecuteStringTask(chars).RunOnTaskRunner(
+ TaskRunner::FromContext(isolate->GetCurrentContext()));
}
}
@@ -302,20 +301,19 @@ class SetTimeoutTask : public AsyncTask {
bool is_inspector_task() final { return false; }
- void AsyncRun(v8::Isolate* isolate,
- const v8::Global<v8::Context>& global_context) override {
- v8::MicrotasksScope microtasks_scope(isolate,
+ private:
+ void AsyncRun() override {
+ v8::MicrotasksScope microtasks_scope(isolate(),
v8::MicrotasksScope::kRunMicrotasks);
- v8::HandleScope handle_scope(isolate);
- v8::Local<v8::Context> context = global_context.Get(isolate);
+ v8::HandleScope handle_scope(isolate());
+ v8::Local<v8::Context> context = default_context();
v8::Context::Scope context_scope(context);
- v8::Local<v8::Function> function = function_.Get(isolate);
+ v8::Local<v8::Function> function = function_.Get(isolate());
v8::MaybeLocal<v8::Value> result;
result = function->Call(context, context->Global(), 0, nullptr);
}
- private:
v8::Global<v8::Function> function_;
};
« no previous file with comments | « test/inspector/inspector-impl.cc ('k') | test/inspector/task-runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698