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

Side by Side Diff: chrome/common/extensions/matcher/string_pattern.h

Issue 10910179: Event matching by regular expression matching on URLs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ascii artiste Created 8 years, 3 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 #ifndef CHROME_COMMON_EXTENSIONS_MATCHER_STRING_PATTERN_H_
6 #define CHROME_COMMON_EXTENSIONS_MATCHER_STRING_PATTERN_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/basictypes.h"
12
13 namespace extensions {
14
15 // An individual pattern of a substring or regex matcher. A pattern consists of
16 // a string (interpreted as individual bytes, no character encoding) and an
17 // identifier.
18 // IDs are returned to the caller of SubstringSetMatcher::Match() or
19 // RegexMatcher::MatchURL() to help the caller to figure out what
20 // patterns matched a string. All patterns registered to a matcher
21 // need to contain unique IDs.
22 class StringPattern {
23 public:
24 typedef int ID;
25
26 StringPattern(const std::string& pattern, ID id);
27 ~StringPattern();
28 const std::string& pattern() const { return pattern_; }
29 ID id() const { return id_; }
30
31 bool operator<(const StringPattern& rhs) const;
32
33 private:
34 std::string pattern_;
35 ID id_;
36
37 DISALLOW_COPY_AND_ASSIGN(StringPattern);
38 };
39
40 } // namespace extensions
41
42 #endif // CHROME_COMMON_EXTENSIONS_MATCHER_STRING_PATTERN_H_
OLDNEW
« no previous file with comments | « chrome/common/extensions/matcher/regex_set_matcher_unittest.cc ('k') | chrome/common/extensions/matcher/string_pattern.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698