| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "components/url_matcher/url_matcher_factory.h" | 5 #include "components/url_matcher/url_matcher_factory.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cctype> | 8 #include <cctype> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 typedef URLMatcherCondition | 91 typedef URLMatcherCondition |
| 92 (URLMatcherConditionFactory::* FactoryMethod) | 92 (URLMatcherConditionFactory::* FactoryMethod) |
| 93 (const std::string& prefix); | 93 (const std::string& prefix); |
| 94 typedef std::map<std::string, FactoryMethod> FactoryMethods; | 94 typedef std::map<std::string, FactoryMethod> FactoryMethods; |
| 95 | 95 |
| 96 FactoryMethods factory_methods_; | 96 FactoryMethods factory_methods_; |
| 97 | 97 |
| 98 DISALLOW_COPY_AND_ASSIGN(URLMatcherConditionFactoryMethods); | 98 DISALLOW_COPY_AND_ASSIGN(URLMatcherConditionFactoryMethods); |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 static base::LazyInstance<URLMatcherConditionFactoryMethods> | 101 static base::LazyInstance<URLMatcherConditionFactoryMethods>::DestructorAtExit |
| 102 g_url_matcher_condition_factory_methods = LAZY_INSTANCE_INITIALIZER; | 102 g_url_matcher_condition_factory_methods = LAZY_INSTANCE_INITIALIZER; |
| 103 | 103 |
| 104 } // namespace | 104 } // namespace |
| 105 | 105 |
| 106 // static | 106 // static |
| 107 scoped_refptr<URLMatcherConditionSet> | 107 scoped_refptr<URLMatcherConditionSet> |
| 108 URLMatcherFactory::CreateFromURLFilterDictionary( | 108 URLMatcherFactory::CreateFromURLFilterDictionary( |
| 109 URLMatcherConditionFactory* url_matcher_condition_factory, | 109 URLMatcherConditionFactory* url_matcher_condition_factory, |
| 110 const base::DictionaryValue* url_filter_dict, | 110 const base::DictionaryValue* url_filter_dict, |
| 111 URLMatcherConditionSet::ID id, | 111 URLMatcherConditionSet::ID id, |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 } else { | 265 } else { |
| 266 *error = kInvalidPortRanges; | 266 *error = kInvalidPortRanges; |
| 267 return nullptr; | 267 return nullptr; |
| 268 } | 268 } |
| 269 } | 269 } |
| 270 | 270 |
| 271 return base::MakeUnique<URLMatcherPortFilter>(ranges); | 271 return base::MakeUnique<URLMatcherPortFilter>(ranges); |
| 272 } | 272 } |
| 273 | 273 |
| 274 } // namespace url_matcher | 274 } // namespace url_matcher |
| OLD | NEW |