Chromium Code Reviews| Index: chrome/common/extensions/matcher/string_pattern.cc |
| diff --git a/chrome/common/extensions/matcher/string_pattern.cc b/chrome/common/extensions/matcher/string_pattern.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8596db5b8946af84ff9a64051639165c84ba3ac2 |
| --- /dev/null |
| +++ b/chrome/common/extensions/matcher/string_pattern.cc |
| @@ -0,0 +1,21 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/common/extensions/matcher/string_pattern.h" |
| + |
| +namespace extensions { |
| + |
| +StringPattern::StringPattern(const std::string& pattern, |
| + StringPattern::ID id) |
| + : pattern_(pattern), id_(id) {} |
| + |
| +StringPattern::~StringPattern() {} |
| + |
| +bool StringPattern::operator<(const StringPattern& rhs) const { |
| + if (id_ < rhs.id_) return true; |
| + if (id_ > rhs.id_) return false; |
|
battre
2012/09/12 18:04:50
as we are toughing the code anyway, I would recomm
Yoyo Zhou
2012/09/12 20:25:56
Done.
|
| + return pattern_ < rhs.pattern_; |
| +} |
| + |
| +} // namespace extensions |