summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authordcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-13 17:32:14 +0000
committerdcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-13 17:32:14 +0000
commit7e6d3f6cf1b0347fdeb04ec7a116839b4f4d2f84 (patch)
tree1f38c724cbe5db7a040b8026debcfdadd28f901b /extensions
parentf3993d608359e2b2942e41392aabcafbf70b791d (diff)
downloadchromium_src-7e6d3f6cf1b0347fdeb04ec7a116839b4f4d2f84.zip
chromium_src-7e6d3f6cf1b0347fdeb04ec7a116839b4f4d2f84.tar.gz
chromium_src-7e6d3f6cf1b0347fdeb04ec7a116839b4f4d2f84.tar.bz2
Rewrite scoped_ptr<T>(NULL) to use the default ctor in extensions/.
This is the result of running the rewrite_scoped_ptr_ctor_null tool across all files built on Linux in the extensions/ directory. BUG=173286 Review URL: https://chromiumcodereview.appspot.com/16866009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206104 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions')
-rw-r--r--extensions/common/matcher/url_matcher_factory.cc10
-rw-r--r--extensions/common/matcher/url_matcher_unittest.cc22
2 files changed, 17 insertions, 15 deletions
diff --git a/extensions/common/matcher/url_matcher_factory.cc b/extensions/common/matcher/url_matcher_factory.cc
index eb1548c..6eec2e6 100644
--- a/extensions/common/matcher/url_matcher_factory.cc
+++ b/extensions/common/matcher/url_matcher_factory.cc
@@ -224,14 +224,14 @@ scoped_ptr<URLMatcherSchemeFilter> URLMatcherFactory::CreateURLMatcherScheme(
if (!helpers::GetAsStringVector(value, &schemas)) {
*error = ErrorUtils::FormatErrorMessage(kVectorOfStringsExpected,
keys::kSchemesKey);
- return scoped_ptr<URLMatcherSchemeFilter>(NULL);
+ return scoped_ptr<URLMatcherSchemeFilter>();
}
for (std::vector<std::string>::const_iterator it = schemas.begin();
it != schemas.end(); ++it) {
if (ContainsUpperCase(*it)) {
*error = ErrorUtils::FormatErrorMessage(kLowerCaseExpected,
"Scheme");
- return scoped_ptr<URLMatcherSchemeFilter>(NULL);
+ return scoped_ptr<URLMatcherSchemeFilter>();
}
}
return scoped_ptr<URLMatcherSchemeFilter>(
@@ -246,7 +246,7 @@ scoped_ptr<URLMatcherPortFilter> URLMatcherFactory::CreateURLMatcherPorts(
const base::ListValue* value_list = NULL;
if (!value->GetAsList(&value_list)) {
*error = kInvalidPortRanges;
- return scoped_ptr<URLMatcherPortFilter>(NULL);
+ return scoped_ptr<URLMatcherPortFilter>();
}
for (ListValue::const_iterator i = value_list->begin();
@@ -262,12 +262,12 @@ scoped_ptr<URLMatcherPortFilter> URLMatcherFactory::CreateURLMatcherPorts(
!range->GetInteger(0, &from) ||
!range->GetInteger(1, &to)) {
*error = kInvalidPortRanges;
- return scoped_ptr<URLMatcherPortFilter>(NULL);
+ return scoped_ptr<URLMatcherPortFilter>();
}
ranges.push_back(URLMatcherPortFilter::CreateRange(from, to));
} else {
*error = kInvalidPortRanges;
- return scoped_ptr<URLMatcherPortFilter>(NULL);
+ return scoped_ptr<URLMatcherPortFilter>();
}
}
diff --git a/extensions/common/matcher/url_matcher_unittest.cc b/extensions/common/matcher/url_matcher_unittest.cc
index 15a41a1..1b194ed 100644
--- a/extensions/common/matcher/url_matcher_unittest.cc
+++ b/extensions/common/matcher/url_matcher_unittest.cc
@@ -449,16 +449,18 @@ TEST(URLMatcherConditionSetTest, Matching) {
// Test scheme filters.
scoped_refptr<URLMatcherConditionSet> condition_set2(
- new URLMatcherConditionSet(1, conditions,
- scoped_ptr<URLMatcherSchemeFilter>(
- new URLMatcherSchemeFilter("https")),
- scoped_ptr<URLMatcherPortFilter>(NULL)));
+ new URLMatcherConditionSet(1,
+ conditions,
+ scoped_ptr<URLMatcherSchemeFilter>(
+ new URLMatcherSchemeFilter("https")),
+ scoped_ptr<URLMatcherPortFilter>()));
EXPECT_FALSE(condition_set2->IsMatch(matching_patterns, url1));
scoped_refptr<URLMatcherConditionSet> condition_set3(
- new URLMatcherConditionSet(1, conditions,
- scoped_ptr<URLMatcherSchemeFilter>(
- new URLMatcherSchemeFilter("http")),
- scoped_ptr<URLMatcherPortFilter>(NULL)));
+ new URLMatcherConditionSet(1,
+ conditions,
+ scoped_ptr<URLMatcherSchemeFilter>(
+ new URLMatcherSchemeFilter("http")),
+ scoped_ptr<URLMatcherPortFilter>()));
EXPECT_TRUE(condition_set3->IsMatch(matching_patterns, url1));
// Test port filters.
@@ -466,8 +468,8 @@ TEST(URLMatcherConditionSetTest, Matching) {
ranges.push_back(URLMatcherPortFilter::CreateRange(80));
scoped_ptr<URLMatcherPortFilter> filter(new URLMatcherPortFilter(ranges));
scoped_refptr<URLMatcherConditionSet> condition_set4(
- new URLMatcherConditionSet(1, conditions,
- scoped_ptr<URLMatcherSchemeFilter>(NULL), filter.Pass()));
+ new URLMatcherConditionSet(
+ 1, conditions, scoped_ptr<URLMatcherSchemeFilter>(), filter.Pass()));
EXPECT_TRUE(condition_set4->IsMatch(matching_patterns, url1));
EXPECT_TRUE(condition_set4->IsMatch(matching_patterns, url3));
EXPECT_FALSE(condition_set4->IsMatch(matching_patterns, url4));