diff options
author | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-09 06:41:12 +0000 |
---|---|---|
committer | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-09 06:41:12 +0000 |
commit | 69d7f89d6a93e0fbce451960287066195c6d4ea0 (patch) | |
tree | 51c8c1f971d39d652ec38ed76070539bb33e85c7 /extensions | |
parent | e3748a79b523a8d365d4a33ef986eebb4186fa78 (diff) | |
download | chromium_src-69d7f89d6a93e0fbce451960287066195c6d4ea0.zip chromium_src-69d7f89d6a93e0fbce451960287066195c6d4ea0.tar.gz chromium_src-69d7f89d6a93e0fbce451960287066195c6d4ea0.tar.bz2 |
Revert "Rewrite std::string("") to std::string(), Linux edition."
This reverts commit e59558b78e8c6a1b0bd916a724724b638c3c91b6.
Revert "Fix build after r193020."
This reverts commit 558a35897f6b3ffbcaefde927c1f150b815d140a.
Revert "Really fix build after r193020."
This reverts commit e3748a79b523a8d365d4a33ef986eebb4186fa78.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193030 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions')
5 files changed, 28 insertions, 35 deletions
diff --git a/extensions/common/extension_resource_unittest.cc b/extensions/common/extension_resource_unittest.cc index 3791b14..132e718 100644 --- a/extensions/common/extension_resource_unittest.cc +++ b/extensions/common/extension_resource_unittest.cc @@ -131,8 +131,7 @@ TEST(ExtensionResourceTest, CreateWithAllResourcesOnDisk) { ASSERT_TRUE(file_util::CreateDirectory(l10n_path)); std::vector<std::string> locales; - l10n_util::GetParentLocales(l10n_util::GetApplicationLocale(std::string()), - &locales); + l10n_util::GetParentLocales(l10n_util::GetApplicationLocale(""), &locales); ASSERT_FALSE(locales.empty()); for (size_t i = 0; i < locales.size(); i++) { base::FilePath make_path; diff --git a/extensions/common/matcher/substring_set_matcher_unittest.cc b/extensions/common/matcher/substring_set_matcher_unittest.cc index fde65bf..4152ff9 100644 --- a/extensions/common/matcher/substring_set_matcher_unittest.cc +++ b/extensions/common/matcher/substring_set_matcher_unittest.cc @@ -117,7 +117,7 @@ TEST(SubstringSetMatcherTest, TestMatcher) { // String abcde // Pattern 1 // Pattern 2 abcdef - TestTwoPatterns("abcde", std::string(), "abcdef", true, false); + TestTwoPatterns("abcde", "", "abcdef", true, false); } TEST(SubstringSetMatcherTest, RegisterAndRemove) { diff --git a/extensions/common/matcher/url_matcher.cc b/extensions/common/matcher/url_matcher.cc index b599293..d7779a2 100644 --- a/extensions/common/matcher/url_matcher.cc +++ b/extensions/common/matcher/url_matcher.cc @@ -256,8 +256,8 @@ URLMatcherConditionFactory::~URLMatcherConditionFactory() { std::string URLMatcherConditionFactory::CanonicalizeURLForComponentSearches( const GURL& url) const { return kBeginningOfURL + CanonicalizeHostname(url.host()) + kEndOfDomain + - url.path() + kEndOfPath + - (url.has_query() ? "?" + url.query() : std::string()) + kEndOfURL; + url.path() + kEndOfPath + (url.has_query() ? "?" + url.query() : "") + + kEndOfURL; } URLMatcherCondition URLMatcherConditionFactory::CreateHostPrefixCondition( diff --git a/extensions/common/matcher/url_matcher_factory.cc b/extensions/common/matcher/url_matcher_factory.cc index 3ca4aa2..cdd08ba 100644 --- a/extensions/common/matcher/url_matcher_factory.cc +++ b/extensions/common/matcher/url_matcher_factory.cc @@ -151,8 +151,7 @@ URLMatcherFactory::CreateFromURLFilterDictionary( // matched. if (url_matcher_conditions.empty()) { url_matcher_conditions.insert( - url_matcher_condition_factory->CreateHostPrefixCondition( - std::string())); + url_matcher_condition_factory->CreateHostPrefixCondition("")); } scoped_refptr<URLMatcherConditionSet> url_matcher_condition_set( diff --git a/extensions/common/matcher/url_matcher_unittest.cc b/extensions/common/matcher/url_matcher_unittest.cc index b17c13c..09fc562 100644 --- a/extensions/common/matcher/url_matcher_unittest.cc +++ b/extensions/common/matcher/url_matcher_unittest.cc @@ -247,7 +247,7 @@ TEST(URLMatcherConditionFactoryTest, TestComponentSearches) { std::string url = factory.CanonicalizeURLForComponentSearches(gurl); // Test host component. - EXPECT_TRUE(Matches(factory.CreateHostPrefixCondition(std::string()), url)); + EXPECT_TRUE(Matches(factory.CreateHostPrefixCondition(""), url)); EXPECT_TRUE(Matches(factory.CreateHostPrefixCondition("www.goog"), url)); EXPECT_TRUE( Matches(factory.CreateHostPrefixCondition("www.google.com"), url)); @@ -258,7 +258,7 @@ TEST(URLMatcherConditionFactoryTest, TestComponentSearches) { Matches(factory.CreateHostPrefixCondition("www.google.com/"), url)); EXPECT_FALSE(Matches(factory.CreateHostPrefixCondition("webhp"), url)); - EXPECT_TRUE(Matches(factory.CreateHostSuffixCondition(std::string()), url)); + EXPECT_TRUE(Matches(factory.CreateHostSuffixCondition(""), url)); EXPECT_TRUE(Matches(factory.CreateHostSuffixCondition("com"), url)); EXPECT_TRUE(Matches(factory.CreateHostSuffixCondition(".com"), url)); EXPECT_TRUE( @@ -270,7 +270,7 @@ TEST(URLMatcherConditionFactoryTest, TestComponentSearches) { Matches(factory.CreateHostSuffixCondition("www.google.com/"), url)); EXPECT_FALSE(Matches(factory.CreateHostSuffixCondition("webhp"), url)); - EXPECT_FALSE(Matches(factory.CreateHostEqualsCondition(std::string()), url)); + EXPECT_FALSE(Matches(factory.CreateHostEqualsCondition(""), url)); EXPECT_FALSE(Matches(factory.CreateHostEqualsCondition("www"), url)); EXPECT_TRUE( Matches(factory.CreateHostEqualsCondition("www.google.com"), url)); @@ -279,14 +279,14 @@ TEST(URLMatcherConditionFactoryTest, TestComponentSearches) { // Test path component. - EXPECT_TRUE(Matches(factory.CreatePathPrefixCondition(std::string()), url)); + EXPECT_TRUE(Matches(factory.CreatePathPrefixCondition(""), url)); EXPECT_TRUE(Matches(factory.CreatePathPrefixCondition("/web"), url)); EXPECT_TRUE(Matches(factory.CreatePathPrefixCondition("/webhp"), url)); EXPECT_FALSE(Matches(factory.CreatePathPrefixCondition("webhp"), url)); EXPECT_FALSE(Matches(factory.CreatePathPrefixCondition("/webhp?"), url)); EXPECT_FALSE(Matches(factory.CreatePathPrefixCondition("?sourceid"), url)); - EXPECT_TRUE(Matches(factory.CreatePathSuffixCondition(std::string()), url)); + EXPECT_TRUE(Matches(factory.CreatePathSuffixCondition(""), url)); EXPECT_TRUE(Matches(factory.CreatePathSuffixCondition("webhp"), url)); EXPECT_TRUE(Matches(factory.CreatePathSuffixCondition("/webhp"), url)); EXPECT_FALSE(Matches(factory.CreatePathSuffixCondition("/web"), url)); @@ -300,12 +300,12 @@ TEST(URLMatcherConditionFactoryTest, TestComponentSearches) { // Test query component. - EXPECT_TRUE(Matches(factory.CreateQueryPrefixCondition(std::string()), url)); + EXPECT_TRUE(Matches(factory.CreateQueryPrefixCondition(""), url)); EXPECT_TRUE(Matches(factory.CreateQueryPrefixCondition("sourceid"), url)); // The '?' at the beginning is just ignored. EXPECT_TRUE(Matches(factory.CreateQueryPrefixCondition("?sourceid"), url)); - EXPECT_TRUE(Matches(factory.CreateQuerySuffixCondition(std::string()), url)); + EXPECT_TRUE(Matches(factory.CreateQuerySuffixCondition(""), url)); EXPECT_TRUE(Matches(factory.CreateQuerySuffixCondition("ion=1"), url)); EXPECT_FALSE(Matches(factory.CreateQuerySuffixCondition("www"), url)); // "Suffix" condition + pattern starting with '?' = "equals" condition. @@ -330,26 +330,21 @@ TEST(URLMatcherConditionFactoryTest, TestComponentSearches) { // Test adjacent components EXPECT_TRUE(Matches(factory.CreateHostSuffixPathPrefixCondition( "google.com", "/webhp"), url)); - EXPECT_TRUE(Matches( - factory.CreateHostSuffixPathPrefixCondition(std::string(), "/webhp"), - url)); - EXPECT_TRUE(Matches( - factory.CreateHostSuffixPathPrefixCondition("google.com", std::string()), - url)); - EXPECT_FALSE(Matches( - factory.CreateHostSuffixPathPrefixCondition("www", std::string()), url)); + EXPECT_TRUE(Matches(factory.CreateHostSuffixPathPrefixCondition( + "", "/webhp"), url)); + EXPECT_TRUE(Matches(factory.CreateHostSuffixPathPrefixCondition( + "google.com", ""), url)); + EXPECT_FALSE(Matches(factory.CreateHostSuffixPathPrefixCondition( + "www", ""), url)); EXPECT_TRUE(Matches(factory.CreateHostEqualsPathPrefixCondition( "www.google.com", "/webhp"), url)); - EXPECT_FALSE(Matches( - factory.CreateHostEqualsPathPrefixCondition(std::string(), "/webhp"), - url)); + EXPECT_FALSE(Matches(factory.CreateHostEqualsPathPrefixCondition( + "", "/webhp"), url)); EXPECT_TRUE(Matches(factory.CreateHostEqualsPathPrefixCondition( - "www.google.com", std::string()), - url)); - EXPECT_FALSE(Matches( - factory.CreateHostEqualsPathPrefixCondition("google.com", std::string()), - url)); + "www.google.com", ""), url)); + EXPECT_FALSE(Matches(factory.CreateHostEqualsPathPrefixCondition( + "google.com", ""), url)); } TEST(URLMatcherConditionFactoryTest, TestFullSearches) { @@ -359,9 +354,9 @@ TEST(URLMatcherConditionFactoryTest, TestFullSearches) { URLMatcherConditionFactory factory; std::string url = factory.CanonicalizeURLForFullSearches(gurl); - EXPECT_TRUE(Matches(factory.CreateURLPrefixCondition(std::string()), url)); - EXPECT_TRUE( - Matches(factory.CreateURLPrefixCondition("https://www.goog"), url)); + EXPECT_TRUE(Matches(factory.CreateURLPrefixCondition(""), url)); + EXPECT_TRUE(Matches(factory.CreateURLPrefixCondition( + "https://www.goog"), url)); EXPECT_TRUE(Matches(factory.CreateURLPrefixCondition( "https://www.google.com"), url)); EXPECT_TRUE(Matches(factory.CreateURLPrefixCondition( @@ -370,11 +365,11 @@ TEST(URLMatcherConditionFactoryTest, TestFullSearches) { "http://www.google.com"), url)); EXPECT_FALSE(Matches(factory.CreateURLPrefixCondition("webhp"), url)); - EXPECT_TRUE(Matches(factory.CreateURLSuffixCondition(std::string()), url)); + EXPECT_TRUE(Matches(factory.CreateURLSuffixCondition(""), url)); EXPECT_TRUE(Matches(factory.CreateURLSuffixCondition("ion=1"), url)); EXPECT_FALSE(Matches(factory.CreateURLSuffixCondition("www"), url)); - EXPECT_TRUE(Matches(factory.CreateURLContainsCondition(std::string()), url)); + EXPECT_TRUE(Matches(factory.CreateURLContainsCondition(""), url)); EXPECT_TRUE(Matches(factory.CreateURLContainsCondition("www.goog"), url)); EXPECT_TRUE(Matches(factory.CreateURLContainsCondition("webhp"), url)); EXPECT_TRUE(Matches(factory.CreateURLContainsCondition("?"), url)); |