@@ -147,8 +147,8 @@ DispatchResponse TracingAgent::start(
147
147
std::set<std::string> categories_set;
148
148
protocol::Array<std::string>* categories =
149
149
traceConfig->getIncludedCategories ();
150
- for (size_t i = 0 ; i < categories->length (); i++)
151
- categories_set.insert (categories-> get (i) );
150
+ for (size_t i = 0 ; i < categories->size (); i++)
151
+ categories_set.insert ((*categories)[i] );
152
152
153
153
if (categories_set.empty ())
154
154
return DispatchResponse::Error (" At least one category should be enabled" );
@@ -172,29 +172,29 @@ DispatchResponse TracingAgent::stop() {
172
172
173
173
DispatchResponse TracingAgent::getCategories (
174
174
std::unique_ptr<protocol::Array<String>>* categories) {
175
- *categories = Array<String>:: create ();
175
+ *categories = std::make_unique< Array<String>> ();
176
176
protocol::Array<String>* categories_list = categories->get ();
177
177
// In alphabetical order
178
- categories_list->addItem (" node" );
179
- categories_list->addItem (" node.async_hooks" );
180
- categories_list->addItem (" node.bootstrap" );
181
- categories_list->addItem (" node.console" );
182
- categories_list->addItem (" node.dns.native" );
183
- categories_list->addItem (" node.environment" );
184
- categories_list->addItem (" node.fs.async" );
185
- categories_list->addItem (" node.fs.sync" );
186
- categories_list->addItem (" node.fs_dir.async" );
187
- categories_list->addItem (" node.fs_dir.sync" );
188
- categories_list->addItem (" node.http" );
189
- categories_list->addItem (" node.net.native" );
190
- categories_list->addItem (" node.perf" );
191
- categories_list->addItem (" node.perf.timerify" );
192
- categories_list->addItem (" node.perf.usertiming" );
193
- categories_list->addItem (" node.promises.rejections" );
194
- categories_list->addItem (" node.threadpoolwork.async" );
195
- categories_list->addItem (" node.threadpoolwork.sync" );
196
- categories_list->addItem (" node.vm.script" );
197
- categories_list->addItem (" v8" );
178
+ categories_list->emplace_back (" node" );
179
+ categories_list->emplace_back (" node.async_hooks" );
180
+ categories_list->emplace_back (" node.bootstrap" );
181
+ categories_list->emplace_back (" node.console" );
182
+ categories_list->emplace_back (" node.dns.native" );
183
+ categories_list->emplace_back (" node.environment" );
184
+ categories_list->emplace_back (" node.fs.async" );
185
+ categories_list->emplace_back (" node.fs.sync" );
186
+ categories_list->emplace_back (" node.fs_dir.async" );
187
+ categories_list->emplace_back (" node.fs_dir.sync" );
188
+ categories_list->emplace_back (" node.http" );
189
+ categories_list->emplace_back (" node.net.native" );
190
+ categories_list->emplace_back (" node.perf" );
191
+ categories_list->emplace_back (" node.perf.timerify" );
192
+ categories_list->emplace_back (" node.perf.usertiming" );
193
+ categories_list->emplace_back (" node.promises.rejections" );
194
+ categories_list->emplace_back (" node.threadpoolwork.async" );
195
+ categories_list->emplace_back (" node.threadpoolwork.sync" );
196
+ categories_list->emplace_back (" node.vm.script" );
197
+ categories_list->emplace_back (" v8" );
198
198
return DispatchResponse::OK ();
199
199
}
200
200
0 commit comments