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

Side by Side Diff: chrome/browser/extensions/api/declarative_webrequest/webrequest_condition.cc

Issue 11827026: Overhaul JSON Schema Compiler to support a number of features required to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: yoz Created 7 years, 11 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698