diff options
author | mad@google.com <mad@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-18 19:32:33 +0000 |
---|---|---|
committer | mad@google.com <mad@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-18 19:32:33 +0000 |
commit | 8e6a12a2dcf906c6153f73af99b1dcfa0d65ba71 (patch) | |
tree | 6aead25ffc6a2526bb7c32b7a21ddbd8226c11de /chrome/common/extensions/url_pattern.h | |
parent | 77148a8429579009f0eb74f5b57af5c42a8374cf (diff) | |
download | chromium_src-8e6a12a2dcf906c6153f73af99b1dcfa0d65ba71.zip chromium_src-8e6a12a2dcf906c6153f73af99b1dcfa0d65ba71.tar.gz chromium_src-8e6a12a2dcf906c6153f73af99b1dcfa0d65ba71.tar.bz2 |
Small cleanup of constness.
Added const to methods not changing the state, except for the lazy setting of an escaped version of a path which is now mutable.
Also made some lint fixes.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/132024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18733 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/url_pattern.h')
-rw-r--r-- | chrome/common/extensions/url_pattern.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/chrome/common/extensions/url_pattern.h b/chrome/common/extensions/url_pattern.h index c1ad52c..08d76b0 100644 --- a/chrome/common/extensions/url_pattern.h +++ b/chrome/common/extensions/url_pattern.h @@ -1,8 +1,10 @@ // Copyright (c) 2006-2009 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. -#ifndef CHROME_BROWSER_EXTENSIONS_MATCH_PATTERN_H_ -#define CHROME_BROWSER_EXTENSIONS_MATCH_PATTERN_H_ +#ifndef CHROME_COMMON_EXTENSIONS_URL_PATTERN_H_ +#define CHROME_COMMON_EXTENSIONS_URL_PATTERN_H_ + +#include <string> #include "googleurl/src/gurl.h" @@ -75,7 +77,7 @@ class URLPattern { bool Parse(const std::string& pattern_str); // Returns true if this instance matches the specified URL. - bool MatchesUrl(const GURL& url); + bool MatchesUrl(const GURL& url) const; std::string GetAsString() const; @@ -96,10 +98,10 @@ class URLPattern { private: // Returns true if |test| matches our host. - bool MatchesHost(const GURL& test); + bool MatchesHost(const GURL& test) const; // Returns true if |test| matches our path. - bool MatchesPath(const GURL& test); + bool MatchesPath(const GURL& test) const; // The scheme for the pattern. std::string scheme_; @@ -118,7 +120,7 @@ class URLPattern { // The path with "?" and "\" characters escaped for use with the // MatchPattern() function. This is populated lazily, the first time it is // needed. - std::string path_escaped_; + mutable std::string path_escaped_; }; -#endif // CHROME_BROWSER_EXTENSIONS_MATCH_PATTERN_H_ +#endif // CHROME_COMMON_EXTENSIONS_URL_PATTERN_H_ |