OLD | NEW |
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 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_condit
ion.h" | 5 #include "chrome/browser/extensions/api/declarative_webrequest/webrequest_condit
ion.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 scoped_ptr<WebRequestConditionSet> WebRequestConditionSet::Create( | 189 scoped_ptr<WebRequestConditionSet> WebRequestConditionSet::Create( |
190 URLMatcherConditionFactory* url_matcher_condition_factory, | 190 URLMatcherConditionFactory* url_matcher_condition_factory, |
191 const AnyVector& conditions, | 191 const AnyVector& conditions, |
192 std::string* error) { | 192 std::string* error) { |
193 WebRequestConditionSet::Conditions result; | 193 WebRequestConditionSet::Conditions result; |
194 | 194 |
195 for (AnyVector::const_iterator i = conditions.begin(); | 195 for (AnyVector::const_iterator i = conditions.begin(); |
196 i != conditions.end(); ++i) { | 196 i != conditions.end(); ++i) { |
197 CHECK(i->get()); | 197 CHECK(i->get()); |
198 scoped_ptr<WebRequestCondition> condition = | 198 scoped_ptr<WebRequestCondition> condition = |
199 WebRequestCondition::Create(url_matcher_condition_factory, | 199 WebRequestCondition::Create(url_matcher_condition_factory, **i, error); |
200 (*i)->value(), error); | |
201 if (!error->empty()) | 200 if (!error->empty()) |
202 return scoped_ptr<WebRequestConditionSet>(NULL); | 201 return scoped_ptr<WebRequestConditionSet>(NULL); |
203 result.push_back(make_linked_ptr(condition.release())); | 202 result.push_back(make_linked_ptr(condition.release())); |
204 } | 203 } |
205 | 204 |
206 return scoped_ptr<WebRequestConditionSet>(new WebRequestConditionSet(result)); | 205 return scoped_ptr<WebRequestConditionSet>(new WebRequestConditionSet(result)); |
207 } | 206 } |
208 | 207 |
209 } // namespace extensions | 208 } // namespace extensions |
OLD | NEW |