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

Unified Diff: test/inspector/task-runner.cc

Issue 2832723004: [test/inspector] remove any usage of v8::Extension (Closed)
Patch Set: ac Created 3 years, 8 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
« test/inspector/inspector-test.cc ('K') | « test/inspector/task-runner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/task-runner.cc
diff --git a/test/inspector/task-runner.cc b/test/inspector/task-runner.cc
index 577ab306c72d5654b32fa0ffbcb00f03455c53de..39bf1ffe86dd6975b6b4fb78edb592b8dc3d1697 100644
--- a/test/inspector/task-runner.cc
+++ b/test/inspector/task-runner.cc
@@ -32,11 +32,11 @@ v8::internal::Vector<uint16_t> ToVector(v8::Local<v8::String> str) {
} // namespace
-TaskRunner::TaskRunner(v8::ExtensionConfiguration* extensions,
+TaskRunner::TaskRunner(TaskRunner::SetupGlobalTasks setup_global_tasks,
bool catch_exceptions,
v8::base::Semaphore* ready_semaphore)
: Thread(Options("Task Runner")),
- extensions_(extensions),
+ setup_global_tasks_(std::move(setup_global_tasks)),
catch_exceptions_(catch_exceptions),
ready_semaphore_(ready_semaphore),
isolate_(nullptr),
@@ -55,15 +55,20 @@ void TaskRunner::InitializeIsolate() {
isolate_->SetMicrotasksPolicy(v8::MicrotasksPolicy::kScoped);
v8::Isolate::Scope isolate_scope(isolate_);
v8::HandleScope handle_scope(isolate_);
- NewContextGroup();
+ NewContextGroup(setup_global_tasks_);
if (ready_semaphore_) ready_semaphore_->Signal();
}
-v8::Local<v8::Context> TaskRunner::NewContextGroup() {
+v8::Local<v8::Context> TaskRunner::NewContextGroup(
+ const TaskRunner::SetupGlobalTasks& setup_global_tasks) {
v8::Local<v8::ObjectTemplate> global_template =
v8::ObjectTemplate::New(isolate_);
+ for (auto it = setup_global_tasks.begin(); it != setup_global_tasks.end();
+ ++it) {
+ (*it)->Run(isolate_, global_template);
+ }
v8::Local<v8::Context> context =
- v8::Context::New(isolate_, extensions_, global_template);
+ v8::Context::New(isolate_, nullptr, global_template);
context->SetAlignedPointerInEmbedderData(kTaskRunnerIndex, this);
intptr_t context_group_id = ++last_context_group_id_;
// Should be 2-byte aligned.
« test/inspector/inspector-test.cc ('K') | « test/inspector/task-runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698