| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "extensions/common/alias.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "base/version.h" |
| 9 #include "components/version_info/version_info.h" |
| 10 |
| 11 namespace extensions { |
| 12 |
| 13 namespace { |
| 14 |
| 15 bool CurrentVersionWithinAliasVersionBound(const char* version_string) { |
| 16 if (!version_string) |
| 17 return true; |
| 18 base::Version upper_version_bound(version_string); |
| 19 CHECK(upper_version_bound.IsValid()); |
| 20 |
| 21 base::Version current_version(version_info::GetVersionNumber()); |
| 22 return upper_version_bound.CompareTo(current_version) > 0; |
| 23 } |
| 24 |
| 25 } // namespace |
| 26 |
| 27 Alias::Alias(const char* const name, |
| 28 const char* const real_name, |
| 29 const char* const upper_version_bound) |
| 30 : name_(name), |
| 31 real_name_(real_name), |
| 32 valid_(CurrentVersionWithinAliasVersionBound(upper_version_bound)) {} |
| 33 |
| 34 Alias::~Alias() {} |
| 35 |
| 36 } // namespace extension |
| OLD | NEW |