@@ -14,18 +14,19 @@ class WorkerStartedRequest : public Request {
14
14
uint64_t id,
15
15
const std::string& url,
16
16
std::shared_ptr<node::inspector::MainThreadHandle> worker_thread,
17
- bool waiting)
17
+ bool waiting,
18
+ const std::string& title_prefix)
18
19
: id_(id),
19
- info_ (BuildWorkerTitle(id), url, worker_thread),
20
+ info_ (BuildWorkerTitle(id, title_prefix ), url, worker_thread),
20
21
waiting_(waiting) {}
21
22
void Call (MainThreadInterface* thread) override {
22
23
auto manager = thread->inspector_agent ()->GetWorkerManager ();
23
24
manager->WorkerStarted (id_, info_, waiting_);
24
25
}
25
26
26
27
private:
27
- static std::string BuildWorkerTitle (int id) {
28
- return " Worker " + std::to_string (id);
28
+ static std::string BuildWorkerTitle (int id, const std::string& title_prefix ) {
29
+ return title_prefix + " Worker " + std::to_string (id);
29
30
}
30
31
31
32
uint64_t id_;
@@ -57,11 +58,13 @@ ParentInspectorHandle::ParentInspectorHandle(
57
58
uint64_t id,
58
59
const std::string& url,
59
60
std::shared_ptr<MainThreadHandle> parent_thread,
60
- bool wait_for_connect)
61
+ bool wait_for_connect,
62
+ const std::string& title_prefix)
61
63
: id_(id),
62
64
url_(url),
63
65
parent_thread_(parent_thread),
64
- wait_(wait_for_connect) {}
66
+ wait_(wait_for_connect),
67
+ title_prefix_(title_prefix) {}
65
68
66
69
ParentInspectorHandle::~ParentInspectorHandle () {
67
70
parent_thread_->Post (
@@ -71,7 +74,7 @@ ParentInspectorHandle::~ParentInspectorHandle() {
71
74
void ParentInspectorHandle::WorkerStarted (
72
75
std::shared_ptr<MainThreadHandle> worker_thread, bool waiting) {
73
76
std::unique_ptr<Request> request (
74
- new WorkerStartedRequest (id_, url_, worker_thread, waiting));
77
+ new WorkerStartedRequest (id_, url_, worker_thread, waiting, title_prefix_ ));
75
78
parent_thread_->Post (std::move (request));
76
79
}
77
80
@@ -97,9 +100,9 @@ void WorkerManager::WorkerStarted(uint64_t session_id,
97
100
}
98
101
99
102
std::unique_ptr<ParentInspectorHandle> WorkerManager::NewParentHandle (
100
- uint64_t thread_id, const std::string& url) {
103
+ uint64_t thread_id, const std::string& url, const std::string& title_prefix ) {
101
104
bool wait = !delegates_waiting_on_start_.empty ();
102
- return std::make_unique<ParentInspectorHandle>(thread_id, url, thread_, wait );
105
+ return std::make_unique<ParentInspectorHandle>(thread_id, url, thread_, wait , title_prefix );
103
106
}
104
107
105
108
void WorkerManager::RemoveAttachDelegate (int id) {
0 commit comments