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

Unified Diff: services/catalog/catalog.cc

Issue 2390013002: Rename mojo: to service: (Closed)
Patch Set: . Created 4 years, 2 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 | « mojo/public/cpp/bindings/tests/versioning_apptest.cc ('k') | services/catalog/data/capabilities » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/catalog/catalog.cc
diff --git a/services/catalog/catalog.cc b/services/catalog/catalog.cc
index 19b088373551c99d2c1e8b8e4fe61aab08804696..4545267c5ca6092c94929df129ae0cd3acbf8bfa 100644
--- a/services/catalog/catalog.cc
+++ b/services/catalog/catalog.cc
@@ -19,6 +19,7 @@
#include "services/catalog/instance.h"
#include "services/catalog/reader.h"
#include "services/shell/public/cpp/connection.h"
+#include "services/shell/public/cpp/names.h"
#include "services/shell/public/cpp/service_context.h"
namespace catalog {
@@ -38,19 +39,21 @@ bool IsPathNameValid(const std::string& name) {
base::FilePath GetPathForApplicationName(const std::string& application_name) {
std::string path = application_name;
- const bool is_mojo =
- base::StartsWith(path, "mojo:", base::CompareCase::INSENSITIVE_ASCII);
+ const bool is_service =
+ base::StartsWith(path, "service:", base::CompareCase::INSENSITIVE_ASCII);
const bool is_exe =
- !is_mojo &&
+ !is_service &&
base::StartsWith(path, "exe:", base::CompareCase::INSENSITIVE_ASCII);
- if (!is_mojo && !is_exe)
+ if (!is_service && !is_exe)
return base::FilePath();
if (path.find('.') != std::string::npos)
return base::FilePath();
- if (is_mojo)
- path.erase(path.begin(), path.begin() + 5);
- else
- path.erase(path.begin(), path.begin() + 4);
+ if (is_service) {
+ path.erase(path.begin(),
+ path.begin() + strlen(shell::kNameType_Service) + 1);
+ } else {
+ path.erase(path.begin(), path.begin() + strlen(shell::kNameType_Exe) + 1);
+ }
base::TrimString(path, "/", &path);
size_t end_of_name = path.find('/');
if (end_of_name != std::string::npos)
« no previous file with comments | « mojo/public/cpp/bindings/tests/versioning_apptest.cc ('k') | services/catalog/data/capabilities » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698