channels_states.cc 1015 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "components/invalidation/impl/channels_states.h"
  5. namespace invalidation {
  6. const char* FcmChannelStateToString(FcmChannelState state) {
  7. switch (state) {
  8. case FcmChannelState::NOT_STARTED:
  9. return "NOT_STARTED";
  10. case FcmChannelState::ENABLED:
  11. return "ENABLED";
  12. case FcmChannelState::NO_INSTANCE_ID_TOKEN:
  13. return "NO_INSTANCE_ID_TOKEN";
  14. }
  15. }
  16. const char* SubscriptionChannelStateToString(SubscriptionChannelState state) {
  17. switch (state) {
  18. case SubscriptionChannelState::NOT_STARTED:
  19. return "NOT_STARTED";
  20. case SubscriptionChannelState::ENABLED:
  21. return "ENABLED";
  22. case SubscriptionChannelState::ACCESS_TOKEN_FAILURE:
  23. return "ACCESS_TOKEN_FAILURE";
  24. case SubscriptionChannelState::SUBSCRIPTION_FAILURE:
  25. return "SUBSCRIPTION_FAILURE";
  26. }
  27. }
  28. } // namespace invalidation