invalidation_helper.cc 671 B

1234567891011121314151617181920212223242526
  1. // Copyright 2014 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/sync/base/invalidation_helper.h"
  5. #include <string>
  6. #include "base/logging.h"
  7. namespace syncer {
  8. invalidation::TopicSet ModelTypeSetToTopicSet(ModelTypeSet model_types) {
  9. invalidation::TopicSet topics;
  10. for (ModelType type : model_types) {
  11. invalidation::Topic topic;
  12. if (!RealModelTypeToNotificationType(type, &topic)) {
  13. DLOG(WARNING) << "Invalid model type " << type;
  14. continue;
  15. }
  16. topics.insert(topic);
  17. }
  18. return topics;
  19. }
  20. } // namespace syncer