| 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
|
|
|