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

Unified Diff: ash/public/cpp/app_launch_id.cc

Issue 2860503002: mash: Replace int ShelfIDs with AppLaunchID strings. (Closed)
Patch Set: Fix struct traits typo. Created 3 years, 7 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 | « ash/public/cpp/app_launch_id.h ('k') | ash/public/cpp/mus_property_mirror_ash.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/public/cpp/app_launch_id.cc
diff --git a/ash/public/cpp/app_launch_id.cc b/ash/public/cpp/app_launch_id.cc
index fc437c3afe5deb63f1808241b80a8cf0d23f7f13..7293d183a3b9ee6ceb756a6a3ddc16c2ffc2ca6d 100644
--- a/ash/public/cpp/app_launch_id.cc
+++ b/ash/public/cpp/app_launch_id.cc
@@ -10,16 +10,37 @@ namespace ash {
AppLaunchId::AppLaunchId(const std::string& app_id,
const std::string& launch_id)
- : app_id_(app_id), launch_id_(launch_id) {
- DCHECK(!app_id.empty());
+ : app_id(app_id), launch_id(launch_id) {
+ DCHECK(launch_id.empty() || !app_id.empty()) << "launch ids require app ids.";
}
-AppLaunchId::AppLaunchId(const std::string& app_id) : app_id_(app_id) {
- DCHECK(!app_id.empty());
+AppLaunchId::AppLaunchId(const std::string& app_id) : app_id(app_id) {}
+
+AppLaunchId::AppLaunchId() = default;
+
+AppLaunchId::~AppLaunchId() = default;
+
+AppLaunchId::AppLaunchId(const AppLaunchId& other) = default;
+
+AppLaunchId::AppLaunchId(AppLaunchId&& other) = default;
+
+AppLaunchId& AppLaunchId::operator=(const AppLaunchId& other) = default;
+
+bool AppLaunchId::operator==(const AppLaunchId& other) const {
+ return app_id == other.app_id && launch_id == other.launch_id;
}
-AppLaunchId::AppLaunchId() {}
+bool AppLaunchId::operator!=(const AppLaunchId& other) const {
+ return !(*this == other);
+}
-AppLaunchId::~AppLaunchId() {}
+bool AppLaunchId::operator<(const AppLaunchId& other) const {
+ return app_id < other.app_id ||
+ (app_id == other.app_id && launch_id < other.launch_id);
+}
+
+bool AppLaunchId::IsNull() const {
+ return app_id.empty() && launch_id.empty();
+}
} // namespace ash
« no previous file with comments | « ash/public/cpp/app_launch_id.h ('k') | ash/public/cpp/mus_property_mirror_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698