sync_util.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright 2015 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. #ifndef COMPONENTS_SYNC_BASE_SYNC_UTIL_H_
  5. #define COMPONENTS_SYNC_BASE_SYNC_UTIL_H_
  6. #include <string>
  7. #include "components/version_info/version_info.h"
  8. class GURL;
  9. namespace base {
  10. class CommandLine;
  11. }
  12. namespace syncer {
  13. namespace internal {
  14. // Default sync server URL. Visible for testing.
  15. inline constexpr char kSyncServerUrl[] =
  16. "https://clients4.google.com/chrome-sync";
  17. // Sync server URL for dev channel users. Visible for testing.
  18. inline constexpr char kSyncDevServerUrl[] =
  19. "https://clients4.google.com/chrome-sync/dev";
  20. // Formats user agent string from system string and channel. Visible for
  21. // testing.
  22. std::string FormatUserAgentForSync(const std::string& system,
  23. version_info::Channel channel);
  24. } // namespace internal
  25. GURL GetSyncServiceURL(const base::CommandLine& command_line,
  26. version_info::Channel channel);
  27. // Helper to construct a user agent string (ASCII) suitable for use by
  28. // the syncapi for any HTTP communication. This string is used by the sync
  29. // backend for classifying client types when calculating statistics.
  30. std::string MakeUserAgentForSync(version_info::Channel channel);
  31. } // namespace syncer
  32. #endif // COMPONENTS_SYNC_BASE_SYNC_UTIL_H_