Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Unified Diff: services/service_manager/embedder/shared_file_util.cc

Issue 2763883002: Revert of Move some basic early process init into Service Manager (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/service_manager/embedder/shared_file_util.h ('k') | services/service_manager/embedder/switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/service_manager/embedder/shared_file_util.cc
diff --git a/services/service_manager/embedder/shared_file_util.cc b/services/service_manager/embedder/shared_file_util.cc
deleted file mode 100644
index 2081c24a03f8c7555e652e1db37bcb47342f8395..0000000000000000000000000000000000000000
--- a/services/service_manager/embedder/shared_file_util.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "services/service_manager/embedder/shared_file_util.h"
-
-#include "base/strings/string_number_conversions.h"
-#include "base/strings/string_split.h"
-
-namespace service_manager {
-
-void SharedFileSwitchValueBuilder::AddEntry(const std::string& key_str,
- int key_id) {
- if (!switch_value_.empty()) {
- switch_value_ += ",";
- }
- switch_value_ += key_str, switch_value_ += ":";
- switch_value_ += base::IntToString(key_id);
-}
-
-base::Optional<std::map<int, std::string>> ParseSharedFileSwitchValue(
- const std::string& value) {
- std::map<int, std::string> values;
- std::vector<std::string> string_pairs = base::SplitString(
- value, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
- for (const auto& pair : string_pairs) {
- size_t colon_position = pair.find(":");
- if (colon_position == std::string::npos || colon_position == 0 ||
- colon_position == pair.size() - 1) {
- DLOG(ERROR) << "Found invalid entry parsing shared file string value:"
- << pair;
- return base::nullopt;
- }
- std::string key = pair.substr(0, colon_position);
- std::string number_string =
- pair.substr(colon_position + 1, std::string::npos);
- int key_int;
- if (!base::StringToInt(number_string, &key_int)) {
- DLOG(ERROR) << "Found invalid entry parsing shared file string value:"
- << number_string << " (not an int).";
- return base::nullopt;
- }
-
- values[key_int] = key;
- }
- return base::make_optional(std::move(values));
-}
-
-} // namespace service_manager
« no previous file with comments | « services/service_manager/embedder/shared_file_util.h ('k') | services/service_manager/embedder/switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698