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

Side by Side Diff: chrome/browser/extensions/api/declarative/url_matcher.h

Issue 9820003: Implementation of beginning of Declarative Web Request API backend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pacify clang Created 8 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative/url_matcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_URL_MATCHER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_URL_MATCHER_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_URL_MATCHER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_URL_MATCHER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 // times with a single condition set in each call. 214 // times with a single condition set in each call.
215 void AddConditionSets( 215 void AddConditionSets(
216 const std::vector<URLMatcherConditionSet>& condition_sets); 216 const std::vector<URLMatcherConditionSet>& condition_sets);
217 217
218 // Removes the listed condition sets. All |condition_set_ids| must be 218 // Removes the listed condition sets. All |condition_set_ids| must be
219 // currently registered. This function should be called with large batches 219 // currently registered. This function should be called with large batches
220 // of |condition_set_ids| at a time to improve performance. 220 // of |condition_set_ids| at a time to improve performance.
221 void RemoveConditionSets( 221 void RemoveConditionSets(
222 const std::vector<URLMatcherConditionSet::ID>& condition_set_ids); 222 const std::vector<URLMatcherConditionSet::ID>& condition_set_ids);
223 223
224 // Removes all unused condition sets from the ConditionFactory.
225 void ClearUnusedConditionSets();
226
224 // Returns the IDs of all URLMatcherConditionSet that match to this |url|. 227 // Returns the IDs of all URLMatcherConditionSet that match to this |url|.
225 std::set<URLMatcherConditionSet::ID> MatchURL(const GURL& url); 228 std::set<URLMatcherConditionSet::ID> MatchURL(const GURL& url);
226 229
227 // Returns the URLMatcherConditionFactory that must be used to create 230 // Returns the URLMatcherConditionFactory that must be used to create
228 // URLMatcherConditionSets for this URLMatcher. 231 // URLMatcherConditionSets for this URLMatcher.
229 URLMatcherConditionFactory* condition_factory() { 232 URLMatcherConditionFactory* condition_factory() {
230 return &condition_factory_; 233 return &condition_factory_;
231 } 234 }
232 235
233 private: 236 private:
(...skipping 19 matching lines...) Expand all
253 SubstringSetMatcher url_component_matcher_; 256 SubstringSetMatcher url_component_matcher_;
254 std::set<const SubstringPattern*> registered_full_url_patterns_; 257 std::set<const SubstringPattern*> registered_full_url_patterns_;
255 std::set<const SubstringPattern*> registered_url_component_patterns_; 258 std::set<const SubstringPattern*> registered_url_component_patterns_;
256 259
257 DISALLOW_COPY_AND_ASSIGN(URLMatcher); 260 DISALLOW_COPY_AND_ASSIGN(URLMatcher);
258 }; 261 };
259 262
260 } // namespace extensions 263 } // namespace extensions
261 264
262 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_URL_MATCHER_H_ 265 #endif // CHROME_BROWSER_EXTENSIONS_API_DECLARATIVE_URL_MATCHER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/declarative/url_matcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698