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

Side by Side Diff: chrome/browser/extensions/api/declarative/rule_identifier.cc

Issue 9315010: RulesRegistry for declarative APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/declarative/rule_identifier.h"
6
7 namespace extensions {
8
9 RuleIdentifier::RuleIdentifier(const std::string& extension_id,
10 const std::string& rule_id)
11 : extension_id_(extension_id),
12 rule_id_(rule_id) {}
13
14 RuleIdentifier::RuleIdentifier(const RuleIdentifier& other)
15 : extension_id_(other.extension_id_),
16 rule_id_(other.rule_id_) {}
17
18 RuleIdentifier::~RuleIdentifier() {}
19
20 bool RuleIdentifier::operator<(const RuleIdentifier& other) const {
21 // These are ordered so that the elements with most entropy are compared
22 // first.
23 if (rule_id_ < other.rule_id_) return true;
24 if (rule_id_ > other.rule_id_) return false;
25 if (extension_id_ < other.extension_id_) return true;
26 return false;
27 }
28
29 RuleIdentifier& RuleIdentifier::operator=(const RuleIdentifier& other) {
30 extension_id_ = other.extension_id_;
31 rule_id_ = other.rule_id_;
32 return *this;
33 }
34
35 } // extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698