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

Side by Side Diff: extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc

Issue 1151283003: Subsituting pattern ScopedVector push_back.(ptr.release()) with push_back(ptr.Pass()) in extensions… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | no next file » | 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 #include "extensions/browser/api/declarative_webrequest/webrequest_condition_att ribute.h" 5 #include "extensions/browser/api/declarative_webrequest/webrequest_condition_att ribute.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 for (base::ListValue::const_iterator it = tests->begin(); 378 for (base::ListValue::const_iterator it = tests->begin();
379 it != tests->end(); ++it) { 379 it != tests->end(); ++it) {
380 const base::DictionaryValue* tests = NULL; 380 const base::DictionaryValue* tests = NULL;
381 if (!(*it)->GetAsDictionary(&tests)) 381 if (!(*it)->GetAsDictionary(&tests))
382 return scoped_ptr<const HeaderMatcher>(); 382 return scoped_ptr<const HeaderMatcher>();
383 383
384 scoped_ptr<const HeaderMatchTest> header_test( 384 scoped_ptr<const HeaderMatchTest> header_test(
385 HeaderMatchTest::Create(tests)); 385 HeaderMatchTest::Create(tests));
386 if (header_test.get() == NULL) 386 if (header_test.get() == NULL)
387 return scoped_ptr<const HeaderMatcher>(); 387 return scoped_ptr<const HeaderMatcher>();
388 header_tests.push_back(header_test.release()); 388 header_tests.push_back(header_test.Pass());
389 } 389 }
390 390
391 return scoped_ptr<const HeaderMatcher>(new HeaderMatcher(&header_tests)); 391 return scoped_ptr<const HeaderMatcher>(new HeaderMatcher(&header_tests));
392 } 392 }
393 393
394 bool HeaderMatcher::TestNameValue(const std::string& name, 394 bool HeaderMatcher::TestNameValue(const std::string& name,
395 const std::string& value) const { 395 const std::string& value) const {
396 for (size_t i = 0; i < tests_.size(); ++i) { 396 for (size_t i = 0; i < tests_.size(); ++i) {
397 if (tests_[i]->Matches(name, value)) 397 if (tests_[i]->Matches(name, value))
398 return true; 398 return true;
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 bool WebRequestConditionAttributeStages::Equals( 869 bool WebRequestConditionAttributeStages::Equals(
870 const WebRequestConditionAttribute* other) const { 870 const WebRequestConditionAttribute* other) const {
871 if (!WebRequestConditionAttribute::Equals(other)) 871 if (!WebRequestConditionAttribute::Equals(other))
872 return false; 872 return false;
873 const WebRequestConditionAttributeStages* casted_other = 873 const WebRequestConditionAttributeStages* casted_other =
874 static_cast<const WebRequestConditionAttributeStages*>(other); 874 static_cast<const WebRequestConditionAttributeStages*>(other);
875 return allowed_stages_ == casted_other->allowed_stages_; 875 return allowed_stages_ == casted_other->allowed_stages_;
876 } 876 }
877 877
878 } // namespace extensions 878 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698