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

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

Issue 2737603006: [inspector] added createContextGroup for tests (Closed)
Patch Set: a Created 3 years, 9 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/runtime/create-context-expected.txt ('k') | test/inspector/task-runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/task-runner.h
diff --git a/test/inspector/task-runner.h b/test/inspector/task-runner.h
index 73d0f0430ee75fa73cfa382c81a85ef7cd59fa4b..9bb135efb91095c1d53ae2e36f704702abfde536 100644
--- a/test/inspector/task-runner.h
+++ b/test/inspector/task-runner.h
@@ -52,6 +52,10 @@ class TaskRunner : public v8::base::Thread {
static TaskRunner* FromContext(v8::Local<v8::Context>);
+ v8::Local<v8::Context> NewContextGroup();
+ v8::Local<v8::Context> GetContext(int context_group_id);
+ static int GetContextGroupId(v8::Local<v8::Context> context);
+
void Terminate();
void RegisterModule(v8::internal::Vector<uint16_t> name,
@@ -61,7 +65,7 @@ class TaskRunner : public v8::base::Thread {
v8::Local<v8::Module> referrer);
private:
- void InitializeContext();
+ void InitializeIsolate();
Task* GetNext(bool only_protocol);
v8::ExtensionConfiguration* extensions_;
@@ -69,7 +73,8 @@ class TaskRunner : public v8::base::Thread {
v8::base::Semaphore* ready_semaphore_;
v8::Isolate* isolate_;
- v8::Global<v8::Context> context_;
+ intptr_t last_context_group_id_ = 0;
+ std::map<intptr_t, v8::Global<v8::Context>> contexts_;
// deferred_queue_ combined with queue_ (in this order) have all tasks in the
// correct order. Sometimes we skip non-protocol tasks by moving them from
« no previous file with comments | « test/inspector/runtime/create-context-expected.txt ('k') | test/inspector/task-runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698