| 499 | } |
| 500 | |
| 501 | int Server::AddBuiltinServices() { |
| 502 | // Firstly add services shown in tabs. |
| 503 | if (AddBuiltinService(new (std::nothrow) StatusService)) { |
| 504 | LOG(ERROR) << "Fail to add StatusService"; |
| 505 | return -1; |
| 506 | } |
| 507 | if (AddBuiltinService(new (std::nothrow) VarsService)) { |
| 508 | LOG(ERROR) << "Fail to add VarsService"; |
| 509 | return -1; |
| 510 | } |
| 511 | if (AddBuiltinService(new (std::nothrow) ConnectionsService)) { |
| 512 | LOG(ERROR) << "Fail to add ConnectionsService"; |
| 513 | return -1; |
| 514 | } |
| 515 | if (AddBuiltinService(new (std::nothrow) FlagsService)) { |
| 516 | LOG(ERROR) << "Fail to add FlagsService"; |
| 517 | return -1; |
| 518 | } |
| 519 | if (AddBuiltinService(new (std::nothrow) RpczService)) { |
| 520 | LOG(ERROR) << "Fail to add RpczService"; |
| 521 | return -1; |
| 522 | } |
| 523 | if (AddBuiltinService(new (std::nothrow) HotspotsService)) { |
| 524 | LOG(ERROR) << "Fail to add HotspotsService"; |
| 525 | return -1; |
| 526 | } |
| 527 | if (AddBuiltinService(new (std::nothrow) IndexService)) { |
| 528 | LOG(ERROR) << "Fail to add IndexService"; |
| 529 | return -1; |
| 530 | } |
| 531 | |
| 532 | // Add other services. |
| 533 | if (AddBuiltinService(new (std::nothrow) VersionService(this))) { |
| 534 | LOG(ERROR) << "Fail to add VersionService"; |
| 535 | return -1; |
| 536 | } |
| 537 | if (AddBuiltinService(new (std::nothrow) HealthService)) { |
| 538 | LOG(ERROR) << "Fail to add HealthService"; |
| 539 | return -1; |
| 540 | } |
| 541 | if (AddBuiltinService(new (std::nothrow) ProtobufsService(this))) { |
| 542 | LOG(ERROR) << "Fail to add ProtobufsService"; |
| 543 | return -1; |
| 544 | } |
| 545 | if (AddBuiltinService(new (std::nothrow) BadMethodService)) { |
| 546 | LOG(ERROR) << "Fail to add BadMethodService"; |
| 547 | return -1; |
| 548 | } |
| 549 | if (AddBuiltinService(new (std::nothrow) ListService(this))) { |
| 550 | LOG(ERROR) << "Fail to add ListService"; |
| 551 | return -1; |
| 552 | } |
| 553 | if (AddBuiltinService(new (std::nothrow) PrometheusMetricsService)) { |
| 554 | LOG(ERROR) << "Fail to add MetricsService"; |
| 555 | return -1; |
| 556 | } |
| 557 | if (FLAGS_enable_threads_service && |
| 558 | AddBuiltinService(new (std::nothrow) ThreadsService)) { |
no outgoing calls