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

Unified Diff: chrome/common/service_process_util.cc

Issue 982883003: Use fixed socket name instead of SecureSocketWithKey (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed histogram Created 5 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
Index: chrome/common/service_process_util.cc
diff --git a/chrome/common/service_process_util.cc b/chrome/common/service_process_util.cc
index 6f9844d6e0564c09b9b01e88688fec5af5156796..f9a990a4ad8e862e80731d9f89af931f5b5ebdba 100644
--- a/chrome/common/service_process_util.cc
+++ b/chrome/common/service_process_util.cc
@@ -96,21 +96,6 @@ ServiceProcessRunningState GetServiceProcessRunningState(
} // namespace
-// Return a name that is scoped to this instance of the service process. We
-// use the hash of the user-data-dir as a scoping prefix. We can't use
-// the user-data-dir itself as we have limits on the size of the lock names.
-std::string GetServiceProcessScopedName(const std::string& append_str) {
- base::FilePath user_data_dir;
- PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
-#if defined(OS_WIN)
- std::string user_data_dir_path = base::WideToUTF8(user_data_dir.value());
-#elif defined(OS_POSIX)
- std::string user_data_dir_path = user_data_dir.value();
-#endif // defined(OS_WIN)
- std::string hash = base::SHA1HashString(user_data_dir_path);
- std::string hex_hash = base::HexEncode(hash.c_str(), hash.length());
- return hex_hash + "." + append_str;
-}
// Return a name that is scoped to this instance of the service process. We
// use the user-data-dir and the version as a scoping prefix.
@@ -148,6 +133,22 @@ bool GetServiceProcessData(std::string* version, base::ProcessId* pid) {
#endif // !OS_MACOSX
+// Return a name that is scoped to this instance of the service process. We
+// use the hash of the user-data-dir as a scoping prefix. We can't use
+// the user-data-dir itself as we have limits on the size of the lock names.
+std::string GetServiceProcessScopedName(const std::string& append_str) {
+ base::FilePath user_data_dir;
+ PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
+#if defined(OS_WIN)
+ std::string user_data_dir_path = base::WideToUTF8(user_data_dir.value());
+#elif defined(OS_POSIX)
+ std::string user_data_dir_path = user_data_dir.value();
+#endif // defined(OS_WIN)
+ std::string hash = base::SHA1HashString(user_data_dir_path);
+ std::string hex_hash = base::HexEncode(hash.c_str(), hash.length());
+ return hex_hash + "." + append_str;
+}
+
scoped_ptr<base::CommandLine> CreateServiceProcessCommandLine() {
base::FilePath exe_path;
PathService::Get(content::CHILD_PROCESS_EXE, &exe_path);

Powered by Google App Engine
This is Rietveld 408576698