rockot | 60d92c2 | 2017-03-21 06:35:23 | [diff] [blame] | 1 | // Copyright 2017 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 | |
Ken Rockot | 30f6a4a | 2020-09-17 08:34:01 | [diff] [blame] | 5 | #ifndef CONTENT_COMMON_SHARED_FILE_UTIL_H_ |
| 6 | #define CONTENT_COMMON_SHARED_FILE_UTIL_H_ |
rockot | 60d92c2 | 2017-03-21 06:35:23 | [diff] [blame] | 7 | |
| 8 | #include <map> |
| 9 | #include <string> |
| 10 | |
| 11 | #include "base/command_line.h" |
Henrique Nakashima | 78c1ce13 | 2018-12-12 19:16:32 | [diff] [blame] | 12 | #include "base/component_export.h" |
Anton Bikineev | f62d1bf | 2021-05-15 17:56:07 | [diff] [blame] | 13 | #include "third_party/abseil-cpp/absl/types/optional.h" |
rockot | 60d92c2 | 2017-03-21 06:35:23 | [diff] [blame] | 14 | |
Ken Rockot | 30f6a4a | 2020-09-17 08:34:01 | [diff] [blame] | 15 | namespace content { |
rockot | 60d92c2 | 2017-03-21 06:35:23 | [diff] [blame] | 16 | |
Lei Zhang | ed9be3a | 2021-11-17 22:01:18 | [diff] [blame] | 17 | class SharedFileSwitchValueBuilder final { |
rockot | 60d92c2 | 2017-03-21 06:35:23 | [diff] [blame] | 18 | public: |
| 19 | void AddEntry(const std::string& key_str, int key_id); |
| 20 | const std::string& switch_value() const { return switch_value_; } |
| 21 | |
| 22 | private: |
| 23 | std::string switch_value_; |
| 24 | }; |
| 25 | |
Anton Bikineev | f62d1bf | 2021-05-15 17:56:07 | [diff] [blame] | 26 | absl::optional<std::map<int, std::string>> ParseSharedFileSwitchValue( |
Henrique Nakashima | 78c1ce13 | 2018-12-12 19:16:32 | [diff] [blame] | 27 | const std::string& value); |
rockot | 60d92c2 | 2017-03-21 06:35:23 | [diff] [blame] | 28 | |
Ken Rockot | 30f6a4a | 2020-09-17 08:34:01 | [diff] [blame] | 29 | } // namespace content |
rockot | 60d92c2 | 2017-03-21 06:35:23 | [diff] [blame] | 30 | |
Ken Rockot | 30f6a4a | 2020-09-17 08:34:01 | [diff] [blame] | 31 | #endif // CONTENT_COMMON_SHARED_FILE_UTIL_H_ |