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 /chrome | |
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 'chrome')
376 files changed, 2347 insertions, 3259 deletions
diff --git a/chrome/browser/about_flags_unittest.cc b/chrome/browser/about_flags_unittest.cc index 1f6ef04..4720ce6 100644 --- a/chrome/browser/about_flags_unittest.cc +++ b/chrome/browser/about_flags_unittest.cc @@ -285,7 +285,7 @@ TEST_F(AboutFlagsTest, CheckValues) { // Convert the flags to switches. ConvertFlagsToSwitches(&prefs_, &command_line); EXPECT_TRUE(command_line.HasSwitch(kSwitch1)); - EXPECT_EQ(std::string(), command_line.GetSwitchValueASCII(kSwitch1)); + EXPECT_EQ(std::string(""), command_line.GetSwitchValueASCII(kSwitch1)); EXPECT_TRUE(command_line.HasSwitch(kSwitch2)); EXPECT_EQ(std::string(kValueForSwitch2), command_line.GetSwitchValueASCII(kSwitch2)); diff --git a/chrome/browser/accessibility/accessibility_events.cc b/chrome/browser/accessibility/accessibility_events.cc index 9a46ef6..65cf111 100644 --- a/chrome/browser/accessibility/accessibility_events.cc +++ b/chrome/browser/accessibility/accessibility_events.cc @@ -166,6 +166,7 @@ AccessibilityTextBoxInfo::AccessibilityTextBoxInfo(Profile* profile, const std::string& context, bool password) : AccessibilityControlInfo(profile, name), + value_(""), password_(password), selection_start_(0), selection_end_(0) { diff --git a/chrome/browser/autofill/autofill_browsertest.cc b/chrome/browser/autofill/autofill_browsertest.cc index b3d6f54..af63f86 100644 --- a/chrome/browser/autofill/autofill_browsertest.cc +++ b/chrome/browser/autofill/autofill_browsertest.cc @@ -505,14 +505,14 @@ class AutofillTest : public InProcessBrowserTest { // The previewed values should not be accessible to JavaScript. ExpectFieldValue("firstname", "M"); - ExpectFieldValue("lastname", std::string()); - ExpectFieldValue("address1", std::string()); - ExpectFieldValue("address2", std::string()); - ExpectFieldValue("city", std::string()); - ExpectFieldValue("state", std::string()); - ExpectFieldValue("zip", std::string()); - ExpectFieldValue("country", std::string()); - ExpectFieldValue("phone", std::string()); + ExpectFieldValue("lastname", ""); + ExpectFieldValue("address1", ""); + ExpectFieldValue("address2", ""); + ExpectFieldValue("city", ""); + ExpectFieldValue("state", ""); + ExpectFieldValue("zip", ""); + ExpectFieldValue("country", ""); + ExpectFieldValue("phone", ""); // TODO(isherman): It would be nice to test that the previewed values are // displayed: http://crbug.com/57220 @@ -742,7 +742,7 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, DISABLED_AutofillFormWithRepeatedField) { // Invoke Autofill. TryBasicFormFill(); - ExpectFieldValue("state_freeform", std::string()); + ExpectFieldValue("state_freeform", ""); } // http://crbug.com/150084 @@ -1307,8 +1307,8 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, MAYBE_ComparePhoneNumbers) { ExpectFieldValue("PHONE_HOME_NUMBER_3-2", "555"); ExpectFieldValue("PHONE_HOME_NUMBER_4-1", "4567"); ExpectFieldValue("PHONE_HOME_NUMBER_4-2", "4567"); - ExpectFieldValue("PHONE_HOME_EXT-1", std::string()); - ExpectFieldValue("PHONE_HOME_EXT-2", std::string()); + ExpectFieldValue("PHONE_HOME_EXT-1", ""); + ExpectFieldValue("PHONE_HOME_EXT-2", ""); ExpectFieldValue("PHONE_HOME_COUNTRY_CODE-1", "1"); } @@ -1447,7 +1447,7 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, MAYBE_NoAutofillForReadOnlyFields) { ui_test_utils::NavigateToURL(browser(), url); PopulateForm("firstname"); - ExpectFieldValue("email", std::string()); + ExpectFieldValue("email", ""); ExpectFieldValue("address", addr_line1); } diff --git a/chrome/browser/automation/automation_misc_browsertest.cc b/chrome/browser/automation/automation_misc_browsertest.cc index 11ce614..97efd95 100644 --- a/chrome/browser/automation/automation_misc_browsertest.cc +++ b/chrome/browser/automation/automation_misc_browsertest.cc @@ -82,8 +82,8 @@ IN_PROC_BROWSER_TEST_F(AutomationMiscBrowserTest, ProcessMouseEvent) { " window.didClick = true;" "}, true);")); AutomationMouseEvent automation_event; - automation_event.location_script_chain - .push_back(ScriptEvaluationRequest("{'x': 5, 'y': 10}", std::string())); + automation_event.location_script_chain.push_back( + ScriptEvaluationRequest("{'x': 5, 'y': 10}", "")); WebKit::WebMouseEvent& mouse_event = automation_event.mouse_event; mouse_event.type = WebKit::WebInputEvent::MouseDown; mouse_event.button = WebKit::WebMouseEvent::ButtonLeft; diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index e176eec..ae9f48c 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -991,7 +991,7 @@ void TestingAutomationProvider::GetTabTitle(int handle, NavigationController* tab = tab_tracker_->GetResource(handle); NavigationEntry* entry = tab->GetActiveEntry(); if (entry != NULL) { - *title = UTF16ToWideHack(entry->GetTitleForDisplay(std::string())); + *title = UTF16ToWideHack(entry->GetTitleForDisplay("")); } else { *title = std::wstring(); } @@ -3414,7 +3414,7 @@ void TestingAutomationProvider::RemoveSavedPassword( // This observer will delete itself. PasswordStoreLoginsChangedObserver* observer = new PasswordStoreLoginsChangedObserver( - this, reply_message, PasswordStoreChange::REMOVE, std::string()); + this, reply_message, PasswordStoreChange::REMOVE, ""); observer->Init(); password_store->RemoveLogin(to_remove); @@ -5353,7 +5353,7 @@ void TestingAutomationProvider::GetTabInfo( return; } DictionaryValue dict; - dict.SetString("title", entry->GetTitleForDisplay(std::string())); + dict.SetString("title", entry->GetTitleForDisplay("")); dict.SetString("url", entry->GetVirtualURL().spec()); reply.SendSuccess(&dict); } else { diff --git a/chrome/browser/bookmarks/bookmark_utils_unittest.cc b/chrome/browser/bookmarks/bookmark_utils_unittest.cc index a5f253d..f71645e 100644 --- a/chrome/browser/bookmarks/bookmark_utils_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_utils_unittest.cc @@ -166,31 +166,22 @@ TEST_F(BookmarkUtilsTest, ApplyEditsWithNoFolderChange) { { BookmarkEditor::EditDetails detail( BookmarkEditor::EditDetails::AddFolder(bookmarkbar, 1)); - ApplyEditsWithNoFolderChange(&model, - bookmarkbar, - detail, - ASCIIToUTF16("folder0"), - GURL(std::string())); + ApplyEditsWithNoFolderChange(&model, bookmarkbar, detail, + ASCIIToUTF16("folder0"), GURL("")); EXPECT_EQ(ASCIIToUTF16("folder0"), bookmarkbar->GetChild(1)->GetTitle()); } { BookmarkEditor::EditDetails detail( BookmarkEditor::EditDetails::AddFolder(bookmarkbar, -1)); - ApplyEditsWithNoFolderChange(&model, - bookmarkbar, - detail, - ASCIIToUTF16("folder1"), - GURL(std::string())); + ApplyEditsWithNoFolderChange(&model, bookmarkbar, detail, + ASCIIToUTF16("folder1"), GURL("")); EXPECT_EQ(ASCIIToUTF16("folder1"), bookmarkbar->GetChild(3)->GetTitle()); } { BookmarkEditor::EditDetails detail( BookmarkEditor::EditDetails::AddFolder(bookmarkbar, 10)); - ApplyEditsWithNoFolderChange(&model, - bookmarkbar, - detail, - ASCIIToUTF16("folder2"), - GURL(std::string())); + ApplyEditsWithNoFolderChange(&model, bookmarkbar, detail, + ASCIIToUTF16("folder2"), GURL("")); EXPECT_EQ(ASCIIToUTF16("folder2"), bookmarkbar->GetChild(4)->GetTitle()); } } diff --git a/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc index be0879b..94df56c 100644 --- a/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc @@ -277,10 +277,8 @@ TEST_F(BrowsingDataCookieHelperTest, CannedDomainCookie) { helper->AddChangedCookie(origin, origin, "A=1; Domain=.www.google.com", net::CookieOptions()); // Try adding invalid cookies that will be ignored. - helper->AddChangedCookie(origin, origin, std::string(), net::CookieOptions()); - helper->AddChangedCookie(origin, - origin, - "C=bad guy; Domain=wrongdomain.com", + helper->AddChangedCookie(origin, origin, "", net::CookieOptions()); + helper->AddChangedCookie(origin, origin, "C=bad guy; Domain=wrongdomain.com", net::CookieOptions()); helper->StartFetching( diff --git a/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc b/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc index 019a45b..8c29d07 100644 --- a/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc +++ b/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc @@ -104,9 +104,9 @@ IN_PROC_BROWSER_TEST_F(BrowsingDataDatabaseHelperTest, CannedAddDatabase) { scoped_refptr<CannedBrowsingDataDatabaseHelper> helper( new CannedBrowsingDataDatabaseHelper(browser()->profile())); - helper->AddDatabase(origin1, db1, std::string()); - helper->AddDatabase(origin1, db2, std::string()); - helper->AddDatabase(origin2, db3, std::string()); + helper->AddDatabase(origin1, db1, ""); + helper->AddDatabase(origin1, db2, ""); + helper->AddDatabase(origin2, db3, ""); TestCompletionCallback callback; helper->StartFetching( @@ -136,8 +136,8 @@ IN_PROC_BROWSER_TEST_F(BrowsingDataDatabaseHelperTest, CannedUnique) { scoped_refptr<CannedBrowsingDataDatabaseHelper> helper( new CannedBrowsingDataDatabaseHelper(browser()->profile())); - helper->AddDatabase(origin, db, std::string()); - helper->AddDatabase(origin, db, std::string()); + helper->AddDatabase(origin, db, ""); + helper->AddDatabase(origin, db, ""); TestCompletionCallback callback; helper->StartFetching( diff --git a/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc index 89c290d..2a2b474 100644 --- a/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc @@ -35,7 +35,7 @@ TEST_F(CannedBrowsingDataDatabaseHelperTest, Empty) { new CannedBrowsingDataDatabaseHelper(&profile)); ASSERT_TRUE(helper->empty()); - helper->AddDatabase(origin, db, std::string()); + helper->AddDatabase(origin, db, ""); ASSERT_FALSE(helper->empty()); helper->Reset(); ASSERT_TRUE(helper->empty()); @@ -52,9 +52,9 @@ TEST_F(CannedBrowsingDataDatabaseHelperTest, IgnoreExtensionsAndDevTools) { new CannedBrowsingDataDatabaseHelper(&profile)); ASSERT_TRUE(helper->empty()); - helper->AddDatabase(origin1, db, std::string()); + helper->AddDatabase(origin1, db, ""); ASSERT_TRUE(helper->empty()); - helper->AddDatabase(origin2, db, std::string()); + helper->AddDatabase(origin2, db, ""); ASSERT_TRUE(helper->empty()); helper->Reset(); ASSERT_TRUE(helper->empty()); diff --git a/chrome/browser/browsing_data/cookies_tree_model_unittest.cc b/chrome/browser/browsing_data/cookies_tree_model_unittest.cc index 9699414..58b1dd5 100644 --- a/chrome/browser/browsing_data/cookies_tree_model_unittest.cc +++ b/chrome/browser/browsing_data/cookies_tree_model_unittest.cc @@ -416,7 +416,7 @@ TEST_F(CookiesTreeModelTest, RemoveAll) { SCOPED_TRACE("After removing"); EXPECT_EQ(1, cookies_model->GetRoot()->GetTotalNodeCount()); EXPECT_EQ(0, cookies_model->GetRoot()->child_count()); - EXPECT_EQ(std::string(), GetDisplayedCookies(cookies_model.get())); + EXPECT_EQ(std::string(""), GetDisplayedCookies(cookies_model.get())); EXPECT_TRUE(mock_browsing_data_cookie_helper_->AllDeleted()); EXPECT_TRUE(mock_browsing_data_database_helper_->AllDeleted()); EXPECT_TRUE(mock_browsing_data_local_storage_helper_->AllDeleted()); diff --git a/chrome/browser/certificate_manager_model.cc b/chrome/browser/certificate_manager_model.cc index aecd3a3..f519a0d 100644 --- a/chrome/browser/certificate_manager_model.cc +++ b/chrome/browser/certificate_manager_model.cc @@ -38,7 +38,7 @@ void CertificateManagerModel::Refresh() { chrome::UnlockSlotsIfNecessary( modules, chrome::kCryptoModulePasswordListCerts, - std::string(), // unused. + "", // unused. base::Bind(&CertificateManagerModel::RefreshSlotsUnlocked, base::Unretained(this))); } @@ -95,8 +95,9 @@ string16 CertificateManagerModel::GetColumnText( x509_certificate_model::GetTokenName(cert.os_cert_handle())); break; case COL_SERIAL_NUMBER: - rv = ASCIIToUTF16(x509_certificate_model::GetSerialNumberHexified( - cert.os_cert_handle(), std::string())); + rv = ASCIIToUTF16( + x509_certificate_model::GetSerialNumberHexified( + cert.os_cert_handle(), "")); break; case COL_EXPIRES_ON: if (!cert.valid_expiry().is_null()) diff --git a/chrome/browser/content_settings/content_settings_browsertest.cc b/chrome/browser/content_settings/content_settings_browsertest.cc index f4105ad..88c664c 100644 --- a/chrome/browser/content_settings/content_settings_browsertest.cc +++ b/chrome/browser/content_settings/content_settings_browsertest.cc @@ -338,12 +338,12 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, AllowException) { browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting( CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_BLOCK); - browser()->profile()->GetHostContentSettingsMap() - ->SetContentSetting(ContentSettingsPattern::FromURL(url), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTINGS_TYPE_PLUGINS, - std::string(), - CONTENT_SETTING_ALLOW); + browser()->profile()->GetHostContentSettingsMap()->SetContentSetting( + ContentSettingsPattern::FromURL(url), + ContentSettingsPattern::Wildcard(), + CONTENT_SETTINGS_TYPE_PLUGINS, + "", + CONTENT_SETTING_ALLOW); string16 expected_title(ASCIIToUTF16("OK")); content::TitleWatcher title_watcher( @@ -357,12 +357,12 @@ IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, BlockException) { GURL url = ui_test_utils::GetTestUrl( base::FilePath(), base::FilePath().AppendASCII("clicktoplay.html")); - browser()->profile()->GetHostContentSettingsMap() - ->SetContentSetting(ContentSettingsPattern::FromURL(url), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTINGS_TYPE_PLUGINS, - std::string(), - CONTENT_SETTING_BLOCK); + browser()->profile()->GetHostContentSettingsMap()->SetContentSetting( + ContentSettingsPattern::FromURL(url), + ContentSettingsPattern::Wildcard(), + CONTENT_SETTINGS_TYPE_PLUGINS, + "", + CONTENT_SETTING_BLOCK); string16 expected_title(ASCIIToUTF16("Click To Play")); content::TitleWatcher title_watcher( diff --git a/chrome/browser/content_settings/content_settings_internal_extension_provider.cc b/chrome/browser/content_settings/content_settings_internal_extension_provider.cc index 56dd993..815d037 100644 --- a/chrome/browser/content_settings/content_settings_internal_extension_provider.cc +++ b/chrome/browser/content_settings/content_settings_internal_extension_provider.cc @@ -117,19 +117,19 @@ void InternalExtensionProvider::SetContentSettingForExtension( value_map_.DeleteValue(primary_pattern, secondary_pattern, CONTENT_SETTINGS_TYPE_PLUGINS, - ResourceIdentifier()); + ResourceIdentifier("")); } else { value_map_.SetValue(primary_pattern, secondary_pattern, CONTENT_SETTINGS_TYPE_PLUGINS, - ResourceIdentifier(), + ResourceIdentifier(""), Value::CreateIntegerValue(setting)); } } NotifyObservers(primary_pattern, secondary_pattern, CONTENT_SETTINGS_TYPE_PLUGINS, - ResourceIdentifier()); + ResourceIdentifier("")); } } // namespace content_settings diff --git a/chrome/browser/content_settings/content_settings_origin_identifier_value_map_unittest.cc b/chrome/browser/content_settings/content_settings_origin_identifier_value_map_unittest.cc index b8612a5..21089fb 100644 --- a/chrome/browser/content_settings/content_settings_origin_identifier_value_map_unittest.cc +++ b/chrome/browser/content_settings/content_settings_origin_identifier_value_map_unittest.cc @@ -14,40 +14,38 @@ TEST(OriginIdentifierValueMapTest, SetGetValue) { content_settings::OriginIdentifierValueMap map; - EXPECT_EQ(NULL, - map.GetValue(GURL("http://www.google.com"), - GURL("http://www.google.com"), - CONTENT_SETTINGS_TYPE_COOKIES, - std::string())); - map.SetValue(ContentSettingsPattern::FromString("[*.]google.com"), - ContentSettingsPattern::FromString("[*.]google.com"), - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - Value::CreateIntegerValue(1)); + EXPECT_EQ(NULL, map.GetValue(GURL("http://www.google.com"), + GURL("http://www.google.com"), + CONTENT_SETTINGS_TYPE_COOKIES, + "")); + map.SetValue( + ContentSettingsPattern::FromString("[*.]google.com"), + ContentSettingsPattern::FromString("[*.]google.com"), + CONTENT_SETTINGS_TYPE_COOKIES, + "", + Value::CreateIntegerValue(1)); scoped_ptr<Value> expected_value(Value::CreateIntegerValue(1)); - EXPECT_TRUE(expected_value->Equals(map.GetValue(GURL("http://www.google.com"), - GURL("http://www.google.com"), - CONTENT_SETTINGS_TYPE_COOKIES, - std::string()))); - - EXPECT_EQ(NULL, - map.GetValue(GURL("http://www.google.com"), - GURL("http://www.youtube.com"), - CONTENT_SETTINGS_TYPE_COOKIES, - std::string())); - - EXPECT_EQ(NULL, - map.GetValue(GURL("http://www.youtube.com"), - GURL("http://www.google.com"), - CONTENT_SETTINGS_TYPE_COOKIES, - std::string())); - - EXPECT_EQ(NULL, - map.GetValue(GURL("http://www.google.com"), - GURL("http://www.google.com"), - CONTENT_SETTINGS_TYPE_POPUPS, - std::string())); + EXPECT_TRUE(expected_value->Equals( + map.GetValue(GURL("http://www.google.com"), + GURL("http://www.google.com"), + CONTENT_SETTINGS_TYPE_COOKIES, + ""))); + + EXPECT_EQ(NULL, map.GetValue(GURL("http://www.google.com"), + GURL("http://www.youtube.com"), + CONTENT_SETTINGS_TYPE_COOKIES, + "")); + + EXPECT_EQ(NULL, map.GetValue(GURL("http://www.youtube.com"), + GURL("http://www.google.com"), + CONTENT_SETTINGS_TYPE_COOKIES, + "")); + + EXPECT_EQ(NULL, map.GetValue(GURL("http://www.google.com"), + GURL("http://www.google.com"), + CONTENT_SETTINGS_TYPE_POPUPS, + "")); EXPECT_EQ(NULL, map.GetValue(GURL("http://www.google.com"), GURL("http://www.google.com"), @@ -121,11 +119,12 @@ TEST(OriginIdentifierValueMapTest, Clear) { CONTENT_SETTINGS_TYPE_PLUGINS, "java-plugin", Value::CreateIntegerValue(1)); - map.SetValue(ContentSettingsPattern::FromString("[*.]google.com"), - ContentSettingsPattern::FromString("[*.]google.com"), - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - Value::CreateIntegerValue(1)); + map.SetValue( + ContentSettingsPattern::FromString("[*.]google.com"), + ContentSettingsPattern::FromString("[*.]google.com"), + CONTENT_SETTINGS_TYPE_COOKIES, + "", + Value::CreateIntegerValue(1)); EXPECT_FALSE(map.empty()); int actual_value; EXPECT_TRUE(map.GetValue(GURL("http://www.google.com"), @@ -146,36 +145,38 @@ TEST(OriginIdentifierValueMapTest, Clear) { TEST(OriginIdentifierValueMapTest, ListEntryPrecedences) { content_settings::OriginIdentifierValueMap map; - map.SetValue(ContentSettingsPattern::FromString("[*.]google.com"), - ContentSettingsPattern::FromString("[*.]google.com"), - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - Value::CreateIntegerValue(1)); + map.SetValue( + ContentSettingsPattern::FromString("[*.]google.com"), + ContentSettingsPattern::FromString("[*.]google.com"), + CONTENT_SETTINGS_TYPE_COOKIES, + "", + Value::CreateIntegerValue(1)); - map.SetValue(ContentSettingsPattern::FromString("www.google.com"), - ContentSettingsPattern::FromString("[*.]google.com"), - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - Value::CreateIntegerValue(2)); + map.SetValue( + ContentSettingsPattern::FromString("www.google.com"), + ContentSettingsPattern::FromString("[*.]google.com"), + CONTENT_SETTINGS_TYPE_COOKIES, + "", + Value::CreateIntegerValue(2)); int actual_value; EXPECT_TRUE(map.GetValue(GURL("http://mail.google.com"), GURL("http://www.google.com"), CONTENT_SETTINGS_TYPE_COOKIES, - std::string())->GetAsInteger(&actual_value)); + "")->GetAsInteger(&actual_value)); EXPECT_EQ(1, actual_value); EXPECT_TRUE(map.GetValue(GURL("http://www.google.com"), GURL("http://www.google.com"), CONTENT_SETTINGS_TYPE_COOKIES, - std::string())->GetAsInteger(&actual_value)); + "")->GetAsInteger(&actual_value)); EXPECT_EQ(2, actual_value); } TEST(OriginIdentifierValueMapTest, IterateEmpty) { content_settings::OriginIdentifierValueMap map; scoped_ptr<content_settings::RuleIterator> rule_iterator( - map.GetRuleIterator(CONTENT_SETTINGS_TYPE_COOKIES, std::string(), NULL)); + map.GetRuleIterator(CONTENT_SETTINGS_TYPE_COOKIES, "", NULL)); EXPECT_FALSE(rule_iterator->HasNext()); } @@ -186,19 +187,21 @@ TEST(OriginIdentifierValueMapTest, IterateNonempty) { ContentSettingsPattern::FromString("[*.]google.com"); ContentSettingsPattern sub_pattern = ContentSettingsPattern::FromString("sub.google.com"); - map.SetValue(pattern, - ContentSettingsPattern::Wildcard(), - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - Value::CreateIntegerValue(1)); - map.SetValue(sub_pattern, - ContentSettingsPattern::Wildcard(), - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - Value::CreateIntegerValue(2)); + map.SetValue( + pattern, + ContentSettingsPattern::Wildcard(), + CONTENT_SETTINGS_TYPE_COOKIES, + "", + Value::CreateIntegerValue(1)); + map.SetValue( + sub_pattern, + ContentSettingsPattern::Wildcard(), + CONTENT_SETTINGS_TYPE_COOKIES, + "", + Value::CreateIntegerValue(2)); scoped_ptr<content_settings::RuleIterator> rule_iterator( - map.GetRuleIterator(CONTENT_SETTINGS_TYPE_COOKIES, std::string(), NULL)); + map.GetRuleIterator(CONTENT_SETTINGS_TYPE_COOKIES, "", NULL)); ASSERT_TRUE(rule_iterator->HasNext()); content_settings::Rule rule = rule_iterator->Next(); EXPECT_EQ(sub_pattern, rule.primary_pattern); diff --git a/chrome/browser/content_settings/content_settings_policy_provider.cc b/chrome/browser/content_settings/content_settings_policy_provider.cc index f1e40fb..b112db0 100644 --- a/chrome/browser/content_settings/content_settings_policy_provider.cc +++ b/chrome/browser/content_settings/content_settings_policy_provider.cc @@ -276,7 +276,7 @@ void PolicyProvider::GetContentSettingsFromPreferences( pattern_pair.first, secondary_pattern, content_type, - NO_RESOURCE_IDENTIFIER, + ResourceIdentifier(NO_RESOURCE_IDENTIFIER), base::Value::CreateIntegerValue( kPrefsForManagedContentSettingsMap[i].setting)); } diff --git a/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc b/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc index 37b718c..23c43f8 100644 --- a/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc +++ b/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc @@ -150,34 +150,22 @@ TEST_F(PolicyProviderTest, GettingManagedContentSettings) { GURL google_url("http://mail.google.com"); EXPECT_EQ(CONTENT_SETTING_DEFAULT, - GetContentSetting(&provider, - youtube_url, - youtube_url, - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - false)); + GetContentSetting( + &provider, youtube_url, youtube_url, + CONTENT_SETTINGS_TYPE_COOKIES, "", false)); EXPECT_EQ(NULL, - GetContentSettingValue(&provider, - youtube_url, - youtube_url, - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - false)); + GetContentSettingValue( + &provider, youtube_url, youtube_url, + CONTENT_SETTINGS_TYPE_COOKIES, "", false)); EXPECT_EQ(CONTENT_SETTING_BLOCK, - GetContentSetting(&provider, - google_url, - google_url, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), - false)); + GetContentSetting( + &provider, google_url, google_url, + CONTENT_SETTINGS_TYPE_IMAGES, "", false)); scoped_ptr<Value> value_ptr( - GetContentSettingValue(&provider, - google_url, - google_url, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), - false)); + GetContentSettingValue( + &provider, google_url, google_url, + CONTENT_SETTINGS_TYPE_IMAGES, "", false)); int int_value = -1; value_ptr->GetAsInteger(&int_value); @@ -188,19 +176,17 @@ TEST_F(PolicyProviderTest, GettingManagedContentSettings) { // SetWebsiteSetting does nothing. scoped_ptr<base::Value> value_block( Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); - bool owned = provider.SetWebsiteSetting(yt_url_pattern, - yt_url_pattern, - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - value_block.get()); + bool owned = provider.SetWebsiteSetting( + yt_url_pattern, + yt_url_pattern, + CONTENT_SETTINGS_TYPE_COOKIES, + "", + value_block.get()); EXPECT_FALSE(owned); EXPECT_EQ(CONTENT_SETTING_DEFAULT, - GetContentSetting(&provider, - youtube_url, - youtube_url, - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - false)); + GetContentSetting( + &provider, youtube_url, youtube_url, + CONTENT_SETTINGS_TYPE_COOKIES, "", false)); provider.ShutdownOnUIThread(); } @@ -227,12 +213,9 @@ TEST_F(PolicyProviderTest, ResourceIdentifier) { // There is currently no policy support for resource content settings. // Resource identifiers are simply ignored by the PolicyProvider. EXPECT_EQ(CONTENT_SETTING_ALLOW, - GetContentSetting(&provider, - google_url, - google_url, - CONTENT_SETTINGS_TYPE_PLUGINS, - std::string(), - false)); + GetContentSetting( + &provider, google_url, google_url, + CONTENT_SETTINGS_TYPE_PLUGINS, "", false)); EXPECT_EQ(CONTENT_SETTING_DEFAULT, GetContentSetting( @@ -249,14 +232,10 @@ TEST_F(PolicyProviderTest, AutoSelectCertificateList) { PolicyProvider provider(prefs); GURL google_url("https://mail.google.com"); // Tests the default setting for auto selecting certificates - EXPECT_EQ( - NULL, - GetContentSettingValue(&provider, - google_url, - google_url, - CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, - std::string(), - false)); + EXPECT_EQ(NULL, + GetContentSettingValue( + &provider, google_url, google_url, + CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, "", false)); // Set the content settings pattern list for origins to auto select // certificates. @@ -268,21 +247,13 @@ TEST_F(PolicyProviderTest, AutoSelectCertificateList) { prefs->SetManagedPref(prefs::kManagedAutoSelectCertificateForUrls, value); GURL youtube_url("https://www.youtube.com"); - EXPECT_EQ( - NULL, - GetContentSettingValue(&provider, - youtube_url, - youtube_url, - CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, - std::string(), - false)); - scoped_ptr<Value> cert_filter( - GetContentSettingValue(&provider, - google_url, - google_url, - CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, - std::string(), - false)); + EXPECT_EQ(NULL, + GetContentSettingValue( + &provider, youtube_url, youtube_url, + CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, "", false)); + scoped_ptr<Value> cert_filter(GetContentSettingValue( + &provider, google_url, google_url, + CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, "", false)); ASSERT_EQ(Value::TYPE_DICTIONARY, cert_filter->GetType()); DictionaryValue* dict_value = diff --git a/chrome/browser/content_settings/content_settings_pref_provider.cc b/chrome/browser/content_settings/content_settings_pref_provider.cc index 4690f2f..a92315e 100644 --- a/chrome/browser/content_settings/content_settings_pref_provider.cc +++ b/chrome/browser/content_settings/content_settings_pref_provider.cc @@ -188,21 +188,22 @@ void PrefProvider::ClearAllContentSettingsRules( { base::AutoLock auto_lock(lock_); scoped_ptr<RuleIterator> rule_iterator( - map_to_modify->GetRuleIterator(content_type, std::string(), NULL)); + map_to_modify->GetRuleIterator(content_type, "", NULL)); // Copy the rules; we cannot call |UpdatePref| while holding |lock_|. while (rule_iterator->HasNext()) rules_to_delete.push_back(rule_iterator->Next()); - map_to_modify->DeleteValues(content_type, std::string()); + map_to_modify->DeleteValues(content_type, ""); } for (std::vector<Rule>::const_iterator it = rules_to_delete.begin(); it != rules_to_delete.end(); ++it) { - UpdatePref(it->primary_pattern, - it->secondary_pattern, - content_type, - std::string(), - NULL); + UpdatePref( + it->primary_pattern, + it->secondary_pattern, + content_type, + "", + NULL); } NotifyObservers(ContentSettingsPattern(), ContentSettingsPattern(), @@ -306,8 +307,8 @@ void PrefProvider::UpdatePref( void PrefProvider::MigrateObsoleteMediaContentSetting() { std::vector<Rule> rules_to_delete; { - scoped_ptr<RuleIterator> rule_iterator(GetRuleIterator( - CONTENT_SETTINGS_TYPE_MEDIASTREAM, std::string(), false)); + scoped_ptr<RuleIterator> rule_iterator( + GetRuleIterator(CONTENT_SETTINGS_TYPE_MEDIASTREAM, "", false)); while (rule_iterator->HasNext()) { // Skip default setting and rules without a value. const content_settings::Rule& rule = rule_iterator->Next(); @@ -332,7 +333,7 @@ void PrefProvider::MigrateObsoleteMediaContentSetting() { SetWebsiteSetting(it->primary_pattern, it->secondary_pattern, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, - std::string(), + "", Value::CreateIntegerValue(CONTENT_SETTING_ALLOW)); } // Add the exception to the new camera content setting. @@ -340,7 +341,7 @@ void PrefProvider::MigrateObsoleteMediaContentSetting() { SetWebsiteSetting(it->primary_pattern, it->secondary_pattern, CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, - std::string(), + "", Value::CreateIntegerValue(CONTENT_SETTING_ALLOW)); } @@ -348,7 +349,7 @@ void PrefProvider::MigrateObsoleteMediaContentSetting() { SetWebsiteSetting(it->primary_pattern, it->secondary_pattern, CONTENT_SETTINGS_TYPE_MEDIASTREAM, - std::string(), + "", NULL); } } @@ -454,7 +455,7 @@ void PrefProvider::ReadContentSettingsFromPref(bool overwrite) { value_map_.SetValue(pattern_pair.first, pattern_pair.second, content_type, - ResourceIdentifier(), + ResourceIdentifier(""), value); if (content_type == CONTENT_SETTINGS_TYPE_COOKIES) { ContentSetting s = ValueToContentSetting(value); diff --git a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc index 1ddc6d0..f951829 100644 --- a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc +++ b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc @@ -121,7 +121,7 @@ TEST_F(PrefProviderTest, Observer) { pattern, ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), + "", Value::CreateIntegerValue(CONTENT_SETTING_ALLOW)); pref_content_settings_provider.ShutdownOnUIThread(); @@ -166,26 +166,20 @@ TEST_F(PrefProviderTest, Incognito) { pattern, pattern, CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), + "", Value::CreateIntegerValue(CONTENT_SETTING_ALLOW)); GURL host("http://example.com/"); // The value should of course be visible in the regular PrefProvider. EXPECT_EQ(CONTENT_SETTING_ALLOW, - GetContentSetting(&pref_content_settings_provider, - host, - host, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), - false)); + GetContentSetting( + &pref_content_settings_provider, + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "", false)); // And also in the OTR version. EXPECT_EQ(CONTENT_SETTING_ALLOW, - GetContentSetting(&pref_content_settings_provider_incognito, - host, - host, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), - false)); + GetContentSetting( + &pref_content_settings_provider_incognito, + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "", false)); // But the value should not be overridden in the OTR user prefs accidentally. EXPECT_FALSE(otr_user_prefs->IsSetInOverlay( prefs::kContentSettingsPatternPairs)); @@ -203,40 +197,26 @@ TEST_F(PrefProviderTest, GetContentSettingsValue) { ContentSettingsPattern::FromString("[*.]example.com"); EXPECT_EQ(CONTENT_SETTING_DEFAULT, - GetContentSetting(&provider, - primary_url, - primary_url, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), - false)); + GetContentSetting(&provider, primary_url, primary_url, + CONTENT_SETTINGS_TYPE_IMAGES, "", false)); EXPECT_EQ(NULL, - GetContentSettingValue(&provider, - primary_url, - primary_url, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), - false)); + GetContentSettingValue( + &provider, primary_url, primary_url, + CONTENT_SETTINGS_TYPE_IMAGES, "", false)); - provider.SetWebsiteSetting(primary_pattern, - primary_pattern, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), - Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); + provider.SetWebsiteSetting( + primary_pattern, + primary_pattern, + CONTENT_SETTINGS_TYPE_IMAGES, + "", + Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); EXPECT_EQ(CONTENT_SETTING_BLOCK, - GetContentSetting(&provider, - primary_url, - primary_url, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), - false)); + GetContentSetting(&provider, primary_url, primary_url, + CONTENT_SETTINGS_TYPE_IMAGES, "", false)); scoped_ptr<Value> value_ptr( - GetContentSettingValue(&provider, - primary_url, - primary_url, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), - false)); + GetContentSettingValue(&provider, primary_url, primary_url, + CONTENT_SETTINGS_TYPE_IMAGES, "", false)); int int_value = -1; value_ptr->GetAsInteger(&int_value); EXPECT_EQ(CONTENT_SETTING_BLOCK, IntToContentSetting(int_value)); @@ -244,15 +224,12 @@ TEST_F(PrefProviderTest, GetContentSettingsValue) { provider.SetWebsiteSetting(primary_pattern, primary_pattern, CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), + "", NULL); EXPECT_EQ(NULL, - GetContentSettingValue(&provider, - primary_url, - primary_url, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), - false)); + GetContentSettingValue( + &provider, primary_url, primary_url, + CONTENT_SETTINGS_TYPE_IMAGES, "", false)); provider.ShutdownOnUIThread(); } @@ -273,74 +250,53 @@ TEST_F(PrefProviderTest, Patterns) { ContentSettingsPattern::FromString("file:///tmp/test.html"); EXPECT_EQ(CONTENT_SETTING_DEFAULT, - GetContentSetting(&pref_content_settings_provider, - host1, - host1, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), - false)); + GetContentSetting( + &pref_content_settings_provider, + host1, host1, CONTENT_SETTINGS_TYPE_IMAGES, "", false)); pref_content_settings_provider.SetWebsiteSetting( pattern1, pattern1, CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), + "", Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); EXPECT_EQ(CONTENT_SETTING_BLOCK, - GetContentSetting(&pref_content_settings_provider, - host1, - host1, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), - false)); + GetContentSetting( + &pref_content_settings_provider, + host1, host1, CONTENT_SETTINGS_TYPE_IMAGES, "", false)); EXPECT_EQ(CONTENT_SETTING_BLOCK, - GetContentSetting(&pref_content_settings_provider, - host2, - host2, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), - false)); + GetContentSetting( + &pref_content_settings_provider, + host2, host2, CONTENT_SETTINGS_TYPE_IMAGES, "", false)); EXPECT_EQ(CONTENT_SETTING_DEFAULT, - GetContentSetting(&pref_content_settings_provider, - host3, - host3, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), - false)); + GetContentSetting( + &pref_content_settings_provider, + host3, host3, CONTENT_SETTINGS_TYPE_IMAGES, "", false)); pref_content_settings_provider.SetWebsiteSetting( pattern2, pattern2, CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), + "", Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); EXPECT_EQ(CONTENT_SETTING_BLOCK, - GetContentSetting(&pref_content_settings_provider, - host3, - host3, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), - false)); + GetContentSetting( + &pref_content_settings_provider, + host3, host3, CONTENT_SETTINGS_TYPE_IMAGES, "", false)); EXPECT_EQ(CONTENT_SETTING_DEFAULT, GetContentSetting(&pref_content_settings_provider, - host4, - host4, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), + host4, host4, CONTENT_SETTINGS_TYPE_IMAGES, "", false)); pref_content_settings_provider.SetWebsiteSetting( pattern3, pattern3, CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), + "", Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); EXPECT_EQ(CONTENT_SETTING_BLOCK, - GetContentSetting(&pref_content_settings_provider, - host4, - host4, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), - false)); + GetContentSetting( + &pref_content_settings_provider, + host4, host4, CONTENT_SETTINGS_TYPE_IMAGES, "", false)); pref_content_settings_provider.ShutdownOnUIThread(); } diff --git a/chrome/browser/content_settings/content_settings_provider.h b/chrome/browser/content_settings/content_settings_provider.h index 6bc64de..fefa226 100644 --- a/chrome/browser/content_settings/content_settings_provider.h +++ b/chrome/browser/content_settings/content_settings_provider.h @@ -7,7 +7,7 @@ #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ -#define NO_RESOURCE_IDENTIFIER std::string() +#define NO_RESOURCE_IDENTIFIER "" #include <string> #include <vector> diff --git a/chrome/browser/content_settings/content_settings_provider_unittest.cc b/chrome/browser/content_settings/content_settings_provider_unittest.cc index 0832a1c..e0857b3 100644 --- a/chrome/browser/content_settings/content_settings_provider_unittest.cc +++ b/chrome/browser/content_settings/content_settings_provider_unittest.cc @@ -46,18 +46,11 @@ TEST(ContentSettingsProviderTest, Mock) { CONTENT_SETTINGS_TYPE_PLUGINS, "flash_plugin", false)); EXPECT_EQ(CONTENT_SETTING_DEFAULT, - GetContentSetting(&mock_provider, - url, - url, - CONTENT_SETTINGS_TYPE_GEOLOCATION, - std::string(), - false)); + GetContentSetting(&mock_provider, url, url, + CONTENT_SETTINGS_TYPE_GEOLOCATION, "", false)); EXPECT_EQ(NULL, - GetContentSettingValue(&mock_provider, - url, - url, - CONTENT_SETTINGS_TYPE_GEOLOCATION, - std::string(), + GetContentSettingValue(&mock_provider, url, url, + CONTENT_SETTINGS_TYPE_GEOLOCATION, "", false)); bool owned = mock_provider.SetWebsiteSetting( diff --git a/chrome/browser/content_settings/content_settings_utils.cc b/chrome/browser/content_settings/content_settings_utils.cc index 9754ba1..d3a2869 100644 --- a/chrome/browser/content_settings/content_settings_utils.cc +++ b/chrome/browser/content_settings/content_settings_utils.cc @@ -190,10 +190,10 @@ ContentSetting GetContentSetting(const ProviderInterface* provider, void GetRendererContentSettingRules(const HostContentSettingsMap* map, RendererContentSettingRules* rules) { - map->GetSettingsForOneType( - CONTENT_SETTINGS_TYPE_IMAGES, std::string(), &(rules->image_rules)); - map->GetSettingsForOneType( - CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string(), &(rules->script_rules)); + map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_IMAGES, "", + &(rules->image_rules)); + map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_JAVASCRIPT, "", + &(rules->script_rules)); } } // namespace content_settings diff --git a/chrome/browser/content_settings/content_settings_utils_unittest.cc b/chrome/browser/content_settings/content_settings_utils_unittest.cc index d5eeeca..69f88c1 100644 --- a/chrome/browser/content_settings/content_settings_utils_unittest.cc +++ b/chrome/browser/content_settings/content_settings_utils_unittest.cc @@ -11,7 +11,7 @@ TEST(ContentSettingsUtilsTest, ParsePatternString) { content_settings::PatternPair pattern_pair; - pattern_pair = content_settings::ParsePatternString(std::string()); + pattern_pair = content_settings::ParsePatternString(""); EXPECT_FALSE(pattern_pair.first.IsValid()); EXPECT_FALSE(pattern_pair.second.IsValid()); diff --git a/chrome/browser/content_settings/cookie_settings.cc b/chrome/browser/content_settings/cookie_settings.cc index e0b1ff6..e34a56e 100644 --- a/chrome/browser/content_settings/cookie_settings.cc +++ b/chrome/browser/content_settings/cookie_settings.cc @@ -130,7 +130,7 @@ bool CookieSettings::IsCookieSessionOnly(const GURL& origin) const { void CookieSettings::GetCookieSettings( ContentSettingsForOneType* settings) const { return host_content_settings_map_->GetSettingsForOneType( - CONTENT_SETTINGS_TYPE_COOKIES, std::string(), settings); + CONTENT_SETTINGS_TYPE_COOKIES, "", settings); } void CookieSettings::SetDefaultCookieSetting(ContentSetting setting) { @@ -147,21 +147,17 @@ void CookieSettings::SetCookieSetting( if (setting == CONTENT_SETTING_SESSION_ONLY) { DCHECK(secondary_pattern == ContentSettingsPattern::Wildcard()); } - host_content_settings_map_->SetContentSetting(primary_pattern, - secondary_pattern, - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - setting); + host_content_settings_map_->SetContentSetting( + primary_pattern, secondary_pattern, CONTENT_SETTINGS_TYPE_COOKIES, "", + setting); } void CookieSettings::ResetCookieSetting( const ContentSettingsPattern& primary_pattern, const ContentSettingsPattern& secondary_pattern) { - host_content_settings_map_->SetContentSetting(primary_pattern, - secondary_pattern, - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - CONTENT_SETTING_DEFAULT); + host_content_settings_map_->SetContentSetting( + primary_pattern, secondary_pattern, CONTENT_SETTINGS_TYPE_COOKIES, "", + CONTENT_SETTING_DEFAULT); } void CookieSettings::ShutdownOnUIThread() { @@ -180,12 +176,9 @@ ContentSetting CookieSettings::GetCookieSetting( // First get any host-specific settings. content_settings::SettingInfo info; - scoped_ptr<base::Value> value(host_content_settings_map_->GetWebsiteSetting( - url, - first_party_url, - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - &info)); + scoped_ptr<base::Value> value( + host_content_settings_map_->GetWebsiteSetting( + url, first_party_url, CONTENT_SETTINGS_TYPE_COOKIES, "", &info)); if (source) *source = info.source; diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc index 777203d..8749d6f 100644 --- a/chrome/browser/content_settings/host_content_settings_map.cc +++ b/chrome/browser/content_settings/host_content_settings_map.cc @@ -133,7 +133,7 @@ void HostContentSettingsMap::RegisterExtensionService( OnContentSettingChanged(ContentSettingsPattern(), ContentSettingsPattern(), CONTENT_SETTINGS_TYPE_DEFAULT, - std::string()); + ""); } #endif @@ -159,7 +159,7 @@ ContentSetting HostContentSettingsMap::GetDefaultContentSettingFromProvider( ContentSettingsType content_type, content_settings::ProviderInterface* provider) const { scoped_ptr<content_settings::RuleIterator> rule_iterator( - provider->GetRuleIterator(content_type, std::string(), false)); + provider->GetRuleIterator(content_type, "", false)); ContentSettingsPattern wildcard = ContentSettingsPattern::Wildcard(); while (rule_iterator->HasNext()) { @@ -460,18 +460,19 @@ void HostContentSettingsMap::MigrateObsoleteClearOnExitPref() { AddSettingsForOneType(content_settings_providers_[PREF_PROVIDER], PREF_PROVIDER, CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), + "", &exceptions, false); for (ContentSettingsForOneType::iterator it = exceptions.begin(); it != exceptions.end(); ++it) { if (it->setting != CONTENT_SETTING_ALLOW) continue; - SetWebsiteSetting(it->primary_pattern, - it->secondary_pattern, - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - Value::CreateIntegerValue(CONTENT_SETTING_SESSION_ONLY)); + SetWebsiteSetting( + it->primary_pattern, + it->secondary_pattern, + CONTENT_SETTINGS_TYPE_COOKIES, + "", + Value::CreateIntegerValue(CONTENT_SETTING_SESSION_ONLY)); } prefs_->SetBoolean(prefs::kContentSettingsClearOnExitMigrated, true); diff --git a/chrome/browser/content_settings/host_content_settings_map_unittest.cc b/chrome/browser/content_settings/host_content_settings_map_unittest.cc index bba4336..57fd929 100644 --- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc +++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc @@ -81,16 +81,16 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) { ContentSettingsPattern::FromString("[*.]example.com"); EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); host_content_settings_map->SetContentSetting( pattern, ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), + "", CONTENT_SETTING_DEFAULT); EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); host_content_settings_map->SetContentSetting( pattern, ContentSettingsPattern::Wildcard(), @@ -99,10 +99,10 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) { CONTENT_SETTING_BLOCK); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_PLUGINS, std::string())); + host, host, CONTENT_SETTINGS_TYPE_PLUGINS, "")); // Check returning all settings for a host. host_content_settings_map->SetContentSetting( @@ -113,7 +113,7 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) { CONTENT_SETTING_DEFAULT); EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); host_content_settings_map->SetContentSetting( pattern, ContentSettingsPattern::Wildcard(), @@ -122,7 +122,7 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) { CONTENT_SETTING_BLOCK); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string())); + host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, "")); host_content_settings_map->SetContentSetting( pattern, ContentSettingsPattern::Wildcard(), @@ -131,23 +131,22 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) { CONTENT_SETTING_ALLOW); EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_PLUGINS, std::string())); + host, host, CONTENT_SETTINGS_TYPE_PLUGINS, "")); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_POPUPS, std::string())); + host, host, CONTENT_SETTINGS_TYPE_POPUPS, "")); + EXPECT_EQ(CONTENT_SETTING_ASK, + host_content_settings_map->GetContentSetting( + host, host, CONTENT_SETTINGS_TYPE_GEOLOCATION, "")); EXPECT_EQ(CONTENT_SETTING_ASK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string())); - EXPECT_EQ( - CONTENT_SETTING_ASK, - host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string())); + host, host, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, "")); EXPECT_EQ(CONTENT_SETTING_ASK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_FULLSCREEN, std::string())); + host, host, CONTENT_SETTINGS_TYPE_FULLSCREEN, "")); EXPECT_EQ(CONTENT_SETTING_ASK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string())); + host, host, CONTENT_SETTINGS_TYPE_MOUSELOCK, "")); // Check returning all hosts for a setting. ContentSettingsPattern pattern2 = @@ -165,16 +164,18 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) { std::string(), CONTENT_SETTING_BLOCK); ContentSettingsForOneType host_settings; - host_content_settings_map->GetSettingsForOneType( - CONTENT_SETTINGS_TYPE_IMAGES, std::string(), &host_settings); + host_content_settings_map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_IMAGES, + "", + &host_settings); // |host_settings| contains the default setting and an exception. EXPECT_EQ(2U, host_settings.size()); host_content_settings_map->GetSettingsForOneType( - CONTENT_SETTINGS_TYPE_PLUGINS, std::string(), &host_settings); + CONTENT_SETTINGS_TYPE_PLUGINS, "", &host_settings); // |host_settings| contains the default setting and 2 exceptions. EXPECT_EQ(3U, host_settings.size()); - host_content_settings_map->GetSettingsForOneType( - CONTENT_SETTINGS_TYPE_POPUPS, std::string(), &host_settings); + host_content_settings_map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_POPUPS, + "", + &host_settings); // |host_settings| contains only the default setting. EXPECT_EQ(1U, host_settings.size()); } @@ -216,12 +217,13 @@ TEST_F(HostContentSettingsMapTest, Clear) { host_content_settings_map->ClearSettingsForOneType( CONTENT_SETTINGS_TYPE_IMAGES); ContentSettingsForOneType host_settings; - host_content_settings_map->GetSettingsForOneType( - CONTENT_SETTINGS_TYPE_IMAGES, std::string(), &host_settings); + host_content_settings_map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_IMAGES, + "", + &host_settings); // |host_settings| contains only the default setting. EXPECT_EQ(1U, host_settings.size()); host_content_settings_map->GetSettingsForOneType( - CONTENT_SETTINGS_TYPE_PLUGINS, std::string(), &host_settings); + CONTENT_SETTINGS_TYPE_PLUGINS, "", &host_settings); // |host_settings| contains the default setting and an exception. EXPECT_EQ(2U, host_settings.size()); } @@ -240,7 +242,7 @@ TEST_F(HostContentSettingsMapTest, Patterns) { ContentSettingsPattern::FromString("example.org"); EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( - host1, host1, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host1, host1, CONTENT_SETTINGS_TYPE_IMAGES, "")); host_content_settings_map->SetContentSetting( pattern1, ContentSettingsPattern::Wildcard(), @@ -249,13 +251,13 @@ TEST_F(HostContentSettingsMapTest, Patterns) { CONTENT_SETTING_BLOCK); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host1, host1, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host1, host1, CONTENT_SETTINGS_TYPE_IMAGES, "")); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host2, host2, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host2, host2, CONTENT_SETTINGS_TYPE_IMAGES, "")); EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( - host3, host3, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host3, host3, CONTENT_SETTINGS_TYPE_IMAGES, "")); host_content_settings_map->SetContentSetting( pattern2, ContentSettingsPattern::Wildcard(), @@ -264,7 +266,7 @@ TEST_F(HostContentSettingsMapTest, Patterns) { CONTENT_SETTING_BLOCK); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host3, host3, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host3, host3, CONTENT_SETTINGS_TYPE_IMAGES, "")); } TEST_F(HostContentSettingsMapTest, Observer) { @@ -325,7 +327,7 @@ TEST_F(HostContentSettingsMapTest, ObserveDefaultPref) { CONTENT_SETTINGS_TYPE_IMAGES, CONTENT_SETTING_BLOCK); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); // Make a copy of the pref's new value so we can reset it later. scoped_ptr<Value> new_value(prefs->FindPreference( @@ -335,13 +337,13 @@ TEST_F(HostContentSettingsMapTest, ObserveDefaultPref) { prefs->Set(prefs::kDefaultContentSettings, *default_value); EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); // Reseting the pref to its previous value should update the cache. prefs->Set(prefs::kDefaultContentSettings, *new_value); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); } TEST_F(HostContentSettingsMapTest, ObserveExceptionPref) { @@ -361,7 +363,7 @@ TEST_F(HostContentSettingsMapTest, ObserveExceptionPref) { EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); host_content_settings_map->SetContentSetting( pattern, @@ -371,7 +373,7 @@ TEST_F(HostContentSettingsMapTest, ObserveExceptionPref) { CONTENT_SETTING_BLOCK); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); // Make a copy of the pref's new value so we can reset it later. scoped_ptr<Value> new_value(prefs->FindPreference( @@ -381,13 +383,13 @@ TEST_F(HostContentSettingsMapTest, ObserveExceptionPref) { prefs->Set(prefs::kContentSettingsPatternPairs, *default_value); EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); // Reseting the pref to its previous value should update the cache. prefs->Set(prefs::kContentSettingsPatternPairs, *new_value); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); } TEST_F(HostContentSettingsMapTest, HostTrimEndingDotCheck) { @@ -411,26 +413,26 @@ TEST_F(HostContentSettingsMapTest, HostTrimEndingDotCheck) { pattern, ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), + "", CONTENT_SETTING_DEFAULT); - EXPECT_EQ( - CONTENT_SETTING_ALLOW, - host_content_settings_map->GetContentSetting(host_ending_with_dot, - host_ending_with_dot, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string())); + EXPECT_EQ(CONTENT_SETTING_ALLOW, + host_content_settings_map->GetContentSetting( + host_ending_with_dot, + host_ending_with_dot, + CONTENT_SETTINGS_TYPE_IMAGES, + "")); host_content_settings_map->SetContentSetting( pattern, ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), + "", CONTENT_SETTING_BLOCK); - EXPECT_EQ( - CONTENT_SETTING_BLOCK, - host_content_settings_map->GetContentSetting(host_ending_with_dot, - host_ending_with_dot, - CONTENT_SETTINGS_TYPE_IMAGES, - std::string())); + EXPECT_EQ(CONTENT_SETTING_BLOCK, + host_content_settings_map->GetContentSetting( + host_ending_with_dot, + host_ending_with_dot, + CONTENT_SETTINGS_TYPE_IMAGES, + "")); EXPECT_TRUE(cookie_settings->IsSettingCookieAllowed( host_ending_with_dot, host_ending_with_dot)); @@ -438,7 +440,7 @@ TEST_F(HostContentSettingsMapTest, HostTrimEndingDotCheck) { pattern, ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), + "", CONTENT_SETTING_DEFAULT); EXPECT_TRUE(cookie_settings->IsSettingCookieAllowed( host_ending_with_dot, host_ending_with_dot)); @@ -446,7 +448,7 @@ TEST_F(HostContentSettingsMapTest, HostTrimEndingDotCheck) { pattern, ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), + "", CONTENT_SETTING_BLOCK); EXPECT_FALSE(cookie_settings->IsSettingCookieAllowed( host_ending_with_dot, host_ending_with_dot)); @@ -456,93 +458,93 @@ TEST_F(HostContentSettingsMapTest, HostTrimEndingDotCheck) { host_ending_with_dot, host_ending_with_dot, CONTENT_SETTINGS_TYPE_JAVASCRIPT, - std::string())); + "")); host_content_settings_map->SetContentSetting( pattern, ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_JAVASCRIPT, - std::string(), + "", CONTENT_SETTING_DEFAULT); EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( host_ending_with_dot, host_ending_with_dot, CONTENT_SETTINGS_TYPE_JAVASCRIPT, - std::string())); + "")); host_content_settings_map->SetContentSetting( pattern, ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_JAVASCRIPT, - std::string(), + "", CONTENT_SETTING_BLOCK); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( host_ending_with_dot, host_ending_with_dot, CONTENT_SETTINGS_TYPE_JAVASCRIPT, - std::string())); + "")); EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( host_ending_with_dot, host_ending_with_dot, CONTENT_SETTINGS_TYPE_PLUGINS, - std::string())); + "")); host_content_settings_map->SetContentSetting( pattern, ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_PLUGINS, - std::string(), + "", CONTENT_SETTING_DEFAULT); EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( host_ending_with_dot, host_ending_with_dot, CONTENT_SETTINGS_TYPE_PLUGINS, - std::string())); + "")); host_content_settings_map->SetContentSetting( pattern, ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_PLUGINS, - std::string(), + "", CONTENT_SETTING_BLOCK); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( host_ending_with_dot, host_ending_with_dot, CONTENT_SETTINGS_TYPE_PLUGINS, - std::string())); + "")); - EXPECT_EQ( - CONTENT_SETTING_BLOCK, - host_content_settings_map->GetContentSetting(host_ending_with_dot, - host_ending_with_dot, - CONTENT_SETTINGS_TYPE_POPUPS, - std::string())); + EXPECT_EQ(CONTENT_SETTING_BLOCK, + host_content_settings_map->GetContentSetting( + host_ending_with_dot, + host_ending_with_dot, + CONTENT_SETTINGS_TYPE_POPUPS, + "")); host_content_settings_map->SetContentSetting( pattern, ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_POPUPS, - std::string(), + "", CONTENT_SETTING_DEFAULT); - EXPECT_EQ( - CONTENT_SETTING_BLOCK, - host_content_settings_map->GetContentSetting(host_ending_with_dot, - host_ending_with_dot, - CONTENT_SETTINGS_TYPE_POPUPS, - std::string())); + EXPECT_EQ(CONTENT_SETTING_BLOCK, + host_content_settings_map->GetContentSetting( + host_ending_with_dot, + host_ending_with_dot, + CONTENT_SETTINGS_TYPE_POPUPS, + "")); host_content_settings_map->SetContentSetting( pattern, ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_POPUPS, - std::string(), + "", CONTENT_SETTING_ALLOW); - EXPECT_EQ( - CONTENT_SETTING_ALLOW, - host_content_settings_map->GetContentSetting(host_ending_with_dot, - host_ending_with_dot, - CONTENT_SETTINGS_TYPE_POPUPS, - std::string())); + EXPECT_EQ(CONTENT_SETTING_ALLOW, + host_content_settings_map->GetContentSetting( + host_ending_with_dot, + host_ending_with_dot, + CONTENT_SETTINGS_TYPE_POPUPS, + "")); } TEST_F(HostContentSettingsMapTest, NestedSettings) { @@ -562,53 +564,52 @@ TEST_F(HostContentSettingsMapTest, NestedSettings) { pattern1, ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), + "", CONTENT_SETTING_BLOCK); host_content_settings_map->SetContentSetting( pattern2, ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), + "", CONTENT_SETTING_BLOCK); host_content_settings_map->SetContentSetting( pattern3, ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_PLUGINS, - std::string(), + "", CONTENT_SETTING_BLOCK); host_content_settings_map->SetDefaultContentSetting( CONTENT_SETTINGS_TYPE_JAVASCRIPT, CONTENT_SETTING_BLOCK); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_COOKIES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_COOKIES, "")); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string())); + host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, "")); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_PLUGINS, std::string())); + host, host, CONTENT_SETTINGS_TYPE_PLUGINS, "")); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_POPUPS, std::string())); + host, host, CONTENT_SETTINGS_TYPE_POPUPS, "")); EXPECT_EQ(CONTENT_SETTING_ASK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string())); - EXPECT_EQ( - CONTENT_SETTING_ASK, - host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string())); + host, host, CONTENT_SETTINGS_TYPE_GEOLOCATION, "")); EXPECT_EQ(CONTENT_SETTING_ASK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_FULLSCREEN, std::string())); + host, host, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, "")); EXPECT_EQ(CONTENT_SETTING_ASK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_MOUSELOCK, std::string())); + host, host, CONTENT_SETTINGS_TYPE_FULLSCREEN, "")); + EXPECT_EQ(CONTENT_SETTING_ASK, + host_content_settings_map->GetContentSetting( + host, host, CONTENT_SETTINGS_TYPE_MOUSELOCK, "")); } TEST_F(HostContentSettingsMapTest, OffTheRecord) { @@ -625,10 +626,10 @@ TEST_F(HostContentSettingsMapTest, OffTheRecord) { EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); EXPECT_EQ(CONTENT_SETTING_ALLOW, otr_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); // Changing content settings on the main map should also affect the // incognito map. @@ -636,28 +637,27 @@ TEST_F(HostContentSettingsMapTest, OffTheRecord) { pattern, ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), + "", CONTENT_SETTING_BLOCK); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); EXPECT_EQ(CONTENT_SETTING_BLOCK, otr_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); // Changing content settings on the incognito map should NOT affect the // main map. - otr_map->SetContentSetting(pattern, - ContentSettingsPattern::Wildcard(), - CONTENT_SETTINGS_TYPE_IMAGES, - std::string(), - CONTENT_SETTING_ALLOW); + otr_map->SetContentSetting( + pattern, + ContentSettingsPattern::Wildcard(), + CONTENT_SETTINGS_TYPE_IMAGES, "", CONTENT_SETTING_ALLOW); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); EXPECT_EQ(CONTENT_SETTING_ALLOW, otr_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); otr_map->ShutdownOnUIThread(); } @@ -738,7 +738,7 @@ TEST_F(HostContentSettingsMapTest, ResourceIdentifier) { CONTENT_SETTINGS_TYPE_PLUGINS, NULL); EXPECT_EQ(default_plugin_setting, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_PLUGINS, std::string())); + host, host, CONTENT_SETTINGS_TYPE_PLUGINS, "")); // If no resource-specific content settings are defined, the setting should be // DEFAULT. @@ -865,7 +865,7 @@ TEST_F(HostContentSettingsMapTest, pattern, ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_JAVASCRIPT, - std::string(), + "", CONTENT_SETTING_BLOCK); EXPECT_EQ(CONTENT_SETTING_ALLOW, @@ -875,14 +875,14 @@ TEST_F(HostContentSettingsMapTest, GURL host("http://example.com/"); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string())); + host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, "")); // Set managed-default-content-setting for content-settings-type JavaScript. prefs->SetManagedPref(prefs::kManagedDefaultJavaScriptSetting, Value::CreateIntegerValue(CONTENT_SETTING_ALLOW)); EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string())); + host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, "")); } // Managed default content setting should have higher priority @@ -906,7 +906,7 @@ TEST_F(HostContentSettingsMapTest, pattern, ContentSettingsPattern::Wildcard(), CONTENT_SETTINGS_TYPE_JAVASCRIPT, - std::string(), + "", CONTENT_SETTING_ALLOW); EXPECT_EQ(CONTENT_SETTING_BLOCK, @@ -915,20 +915,20 @@ TEST_F(HostContentSettingsMapTest, GURL host("http://example.com/"); EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string())); + host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, "")); // Set managed-default-content-settings-preferences. prefs->SetManagedPref(prefs::kManagedDefaultJavaScriptSetting, Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string())); + host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, "")); // Remove managed-default-content-settings-preferences. prefs->RemoveManagedPref(prefs::kManagedDefaultJavaScriptSetting); EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string())); + host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, "")); } // If a default-content-setting is set to managed setting, the user defined @@ -1004,10 +1004,10 @@ TEST_F(HostContentSettingsMapTest, GetContentSetting) { CONTENT_SETTING_BLOCK); EXPECT_EQ(CONTENT_SETTING_BLOCK, host_content_settings_map->GetContentSetting( - host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + host, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); EXPECT_EQ(CONTENT_SETTING_ALLOW, host_content_settings_map->GetContentSetting( - embedder, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + embedder, host, CONTENT_SETTINGS_TYPE_IMAGES, "")); } TEST_F(HostContentSettingsMapTest, ShouldAllowAllContent) { diff --git a/chrome/browser/content_settings/mock_settings_observer.cc b/chrome/browser/content_settings/mock_settings_observer.cc index c8de7fa..a281a1d 100644 --- a/chrome/browser/content_settings/mock_settings_observer.cc +++ b/chrome/browser/content_settings/mock_settings_observer.cc @@ -35,5 +35,5 @@ void MockSettingsObserver::Observe( // This checks that calling a Get function from an observer doesn't // deadlock. GURL url("http://random-hostname.com/"); - map->GetContentSetting(url, url, CONTENT_SETTINGS_TYPE_IMAGES, std::string()); + map->GetContentSetting(url, url, CONTENT_SETTINGS_TYPE_IMAGES, ""); } diff --git a/chrome/browser/devtools/browser_list_tabcontents_provider.cc b/chrome/browser/devtools/browser_list_tabcontents_provider.cc index 2edc6bf..aca4bac 100644 --- a/chrome/browser/devtools/browser_list_tabcontents_provider.cc +++ b/chrome/browser/devtools/browser_list_tabcontents_provider.cc @@ -116,19 +116,19 @@ std::string BrowserListTabContentsProvider::GetViewDescription( content::WebContents* web_contents = content::WebContents::FromRenderViewHost(rvh); if (!web_contents) - return std::string(); + return ""; Profile* profile = Profile::FromBrowserContext(web_contents->GetBrowserContext()); if (!profile) - return std::string(); + return ""; extensions::ExtensionHost* extension_host = extensions::ExtensionSystem::Get(profile)->process_manager()-> GetBackgroundHostForExtension(web_contents->GetURL().host()); if (!extension_host || extension_host->host_contents() != web_contents) - return std::string(); + return ""; return extension_host->extension()->name(); } diff --git a/chrome/browser/devtools/devtools_file_helper.cc b/chrome/browser/devtools/devtools_file_helper.cc index d1f2888..d485a52 100644 --- a/chrome/browser/devtools/devtools_file_helper.cc +++ b/chrome/browser/devtools/devtools_file_helper.cc @@ -77,7 +77,7 @@ class SelectFileDialog : public ui::SelectFileDialog::Listener, default_path, NULL, 0, - base::FilePath::StringType(), + FILE_PATH_LITERAL(""), NULL, NULL); } @@ -346,7 +346,7 @@ void DevToolsFileHelper::AddValidatedFileSystem( file_system_id, registered_name, file_system_path); - callback.Run(std::string(), filesystem); + callback.Run("", filesystem); } void DevToolsFileHelper::RequestFileSystems( diff --git a/chrome/browser/devtools/devtools_sanity_browsertest.cc b/chrome/browser/devtools/devtools_sanity_browsertest.cc index 4f832f7..6a8b30c 100644 --- a/chrome/browser/devtools/devtools_sanity_browsertest.cc +++ b/chrome/browser/devtools/devtools_sanity_browsertest.cc @@ -441,7 +441,7 @@ IN_PROC_BROWSER_TEST_F( IN_PROC_BROWSER_TEST_F(DevToolsExtensionTest, TestDevToolsExtensionAPI) { LoadExtension("devtools_extension"); - RunTest("waitForTestResultsInConsole", std::string()); + RunTest("waitForTestResultsInConsole", ""); } // Tests that chrome.devtools extension can communicate with background page @@ -449,7 +449,7 @@ IN_PROC_BROWSER_TEST_F(DevToolsExtensionTest, IN_PROC_BROWSER_TEST_F(DevToolsExtensionTest, TestDevToolsExtensionMessaging) { LoadExtension("devtools_messaging"); - RunTest("waitForTestResultsInConsole", std::string()); + RunTest("waitForTestResultsInConsole", ""); } // Tests that chrome.experimental.devtools extension is correctly exposed @@ -457,7 +457,7 @@ IN_PROC_BROWSER_TEST_F(DevToolsExtensionTest, IN_PROC_BROWSER_TEST_F(DevToolsExperimentalExtensionTest, TestDevToolsExperimentalExtensionAPI) { LoadExtension("devtools_experimental"); - RunTest("waitForTestResultsInConsole", std::string()); + RunTest("waitForTestResultsInConsole", ""); } // Tests that a content script is in the scripts list. @@ -478,7 +478,7 @@ IN_PROC_BROWSER_TEST_F(DevToolsExtensionTest, IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, MAYBE_TestRendererProcessNativeMemorySize) { - RunTest("testRendererProcessNativeMemorySize", std::string()); + RunTest("testRendererProcessNativeMemorySize", ""); } // Tests that scripts are not duplicated after Scripts Panel switch. diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc index 5ec91a2..7c63cb7 100644 --- a/chrome/browser/download/download_browsertest.cc +++ b/chrome/browser/download/download_browsertest.cc @@ -1655,12 +1655,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, NewWindow) { IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadHistoryCheck) { GURL download_url(URLRequestSlowDownloadJob::kKnownSizeUrl); - base::FilePath file(net::GenerateFileName(download_url, - std::string(), - std::string(), - std::string(), - std::string(), - std::string())); + base::FilePath file(net::GenerateFileName(download_url, "", "", "", "", "")); // We use the server so that we can get a redirect and test url_chain // persistence. @@ -2632,7 +2627,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, LoadURLExternallyReferrerPolicy) { // Check that the file contains the expected referrer. base::FilePath file(download_items[0]->GetFullPath()); - std::string expected_contents = test_server()->GetURL(std::string()).spec(); + std::string expected_contents = test_server()->GetURL("").spec(); ASSERT_TRUE(VerifyFile(file, expected_contents, expected_contents.length())); } diff --git a/chrome/browser/download/download_file_picker.cc b/chrome/browser/download/download_file_picker.cc index a968b06..29a1573 100644 --- a/chrome/browser/download/download_file_picker.cc +++ b/chrome/browser/download/download_file_picker.cc @@ -86,14 +86,15 @@ void DownloadFilePicker::Init( platform_util::GetTopLevel(web_contents->GetView()->GetNativeView()) : NULL; - select_file_dialog_->SelectFile(ui::SelectFileDialog::SELECT_SAVEAS_FILE, - string16(), - suggested_path_, - &file_type_info, - 0, - base::FilePath::StringType(), - owning_window, - NULL); + select_file_dialog_->SelectFile( + ui::SelectFileDialog::SELECT_SAVEAS_FILE, + string16(), + suggested_path_, + &file_type_info, + 0, + FILE_PATH_LITERAL(""), + owning_window, + NULL); } DownloadFilePicker::~DownloadFilePicker() { diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc index 4aba528..2bfb792 100644 --- a/chrome/browser/download/download_prefs.cc +++ b/chrome/browser/download/download_prefs.cc @@ -86,7 +86,7 @@ void DownloadPrefs::RegisterUserPrefs(PrefRegistrySyncable* registry) { false, PrefRegistrySyncable::SYNCABLE_PREF); registry->RegisterStringPref(prefs::kDownloadExtensionsToOpen, - std::string(), + "", PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterBooleanPref(prefs::kDownloadDirUpgraded, false, diff --git a/chrome/browser/extensions/activity_log.cc b/chrome/browser/extensions/activity_log.cc index dcf8e8f..34f820b 100644 --- a/chrome/browser/extensions/activity_log.cc +++ b/chrome/browser/extensions/activity_log.cc @@ -27,7 +27,7 @@ namespace { // Concatenate arguments. std::string MakeArgList(const ListValue* args) { - std::string call_signature; + std::string call_signature = ""; ListValue::const_iterator it = args->begin(); for (; it != args->end(); ++it) { std::string arg; @@ -395,10 +395,9 @@ void ActivityLog::OnScriptsExecuted( // of content scripts will be empty. We don't want to log it because // the call to tabs.executeScript will have already been logged anyway. if (!it->second.empty()) { - std::string ext_scripts_str; + std::string ext_scripts_str = ""; for (std::set<std::string>::const_iterator it2 = it->second.begin(); - it2 != it->second.end(); - ++it2) { + it2 != it->second.end(); ++it2) { ext_scripts_str += *it2; ext_scripts_str += " "; } @@ -407,9 +406,9 @@ void ActivityLog::OnScriptsExecuted( LogDOMActionInternal(extension, on_url, web_contents->GetTitle(), - std::string(), // no api call here + "", // no api call here script_names.get(), - std::string(), // no extras either + "", // no extras either DOMAction::INSERTED); } } diff --git a/chrome/browser/extensions/activity_log_unittest.cc b/chrome/browser/extensions/activity_log_unittest.cc index a5ecc95..f678d7b 100644 --- a/chrome/browser/extensions/activity_log_unittest.cc +++ b/chrome/browser/extensions/activity_log_unittest.cc @@ -93,8 +93,10 @@ TEST_F(ActivityLogTest, Construct) { extension_service_->AddExtension(extension); scoped_ptr<ListValue> args(new ListValue()); ASSERT_TRUE(ActivityLog::IsLogEnabled()); - activity_log->LogAPIAction( - extension, std::string("tabs.testMethod"), args.get(), std::string()); + activity_log->LogAPIAction(extension, + std::string("tabs.testMethod"), + args.get(), + ""); } TEST_F(ActivityLogTest, LogAndFetchActions) { @@ -111,8 +113,10 @@ TEST_F(ActivityLogTest, LogAndFetchActions) { ASSERT_TRUE(ActivityLog::IsLogEnabled()); // Write some API calls - activity_log->LogAPIAction( - extension, std::string("tabs.testMethod"), args.get(), std::string()); + activity_log->LogAPIAction(extension, + std::string("tabs.testMethod"), + args.get(), + ""); activity_log->LogDOMAction(extension, GURL("http://www.google.com"), string16(), @@ -140,10 +144,14 @@ TEST_F(ActivityLogTest, LogWithoutArguments) { scoped_ptr<ListValue> args(new ListValue()); args->Set(0, new base::StringValue("hello")); args->Set(1, new base::StringValue("world")); - activity_log->LogAPIAction( - extension, std::string("tabs.testMethod"), args.get(), std::string()); + activity_log->LogAPIAction(extension, + std::string("tabs.testMethod"), + args.get(), + ""); activity_log->GetActions( - extension->id(), 0, base::Bind(ActivityLogTest::Arguments_Missing)); + extension->id(), + 0, + base::Bind(ActivityLogTest::Arguments_Missing)); } TEST_F(ActivityLogTest, LogWithArguments) { @@ -161,10 +169,14 @@ TEST_F(ActivityLogTest, LogWithArguments) { scoped_ptr<ListValue> args(new ListValue()); args->Set(0, new base::StringValue("hello")); args->Set(1, new base::StringValue("world")); - activity_log->LogAPIAction( - extension, std::string("extension.connect"), args.get(), std::string()); + activity_log->LogAPIAction(extension, + std::string("extension.connect"), + args.get(), + ""); activity_log->GetActions( - extension->id(), 0, base::Bind(ActivityLogTest::Arguments_Present)); + extension->id(), + 0, + base::Bind(ActivityLogTest::Arguments_Present)); } } // namespace extensions diff --git a/chrome/browser/extensions/api/alarms/alarms_api_unittest.cc b/chrome/browser/extensions/api/alarms/alarms_api_unittest.cc index 34b4187..60c367a 100644 --- a/chrome/browser/extensions/api/alarms/alarms_api_unittest.cc +++ b/chrome/browser/extensions/api/alarms/alarms_api_unittest.cc @@ -151,7 +151,7 @@ TEST_F(ExtensionAlarmsTest, Create) { CreateAlarm("[null, {\"delayInMinutes\": 0}]"); const Alarm* alarm = - alarm_manager_->GetAlarm(extension_->id(), std::string()); + alarm_manager_->GetAlarm(extension_->id(), ""); ASSERT_TRUE(alarm); EXPECT_EQ("", alarm->js_alarm->name); EXPECT_DOUBLE_EQ(10000, alarm->js_alarm->scheduled_time); @@ -179,7 +179,7 @@ TEST_F(ExtensionAlarmsTest, CreateRepeating) { CreateAlarm("[null, {\"periodInMinutes\": 0.001}]"); const Alarm* alarm = - alarm_manager_->GetAlarm(extension_->id(), std::string()); + alarm_manager_->GetAlarm(extension_->id(), ""); ASSERT_TRUE(alarm); EXPECT_EQ("", alarm->js_alarm->name); EXPECT_DOUBLE_EQ(10060, alarm->js_alarm->scheduled_time); @@ -205,7 +205,7 @@ TEST_F(ExtensionAlarmsTest, CreateAbsolute) { CreateAlarm("[null, {\"when\": 10001}]"); const Alarm* alarm = - alarm_manager_->GetAlarm(extension_->id(), std::string()); + alarm_manager_->GetAlarm(extension_->id(), ""); ASSERT_TRUE(alarm); EXPECT_EQ("", alarm->js_alarm->name); EXPECT_DOUBLE_EQ(10001, alarm->js_alarm->scheduled_time); @@ -217,7 +217,7 @@ TEST_F(ExtensionAlarmsTest, CreateAbsolute) { // MessageLoop when that happens. MessageLoop::current()->Run(); - ASSERT_FALSE(alarm_manager_->GetAlarm(extension_->id(), std::string())); + ASSERT_FALSE(alarm_manager_->GetAlarm(extension_->id(), "")); ASSERT_EQ(1u, alarm_delegate_->alarms_seen.size()); EXPECT_EQ("", alarm_delegate_->alarms_seen[0]); @@ -228,7 +228,7 @@ TEST_F(ExtensionAlarmsTest, CreateRepeatingWithQuickFirstCall) { CreateAlarm("[null, {\"when\": 10001, \"periodInMinutes\": 0.001}]"); const Alarm* alarm = - alarm_manager_->GetAlarm(extension_->id(), std::string()); + alarm_manager_->GetAlarm(extension_->id(), ""); ASSERT_TRUE(alarm); EXPECT_EQ("", alarm->js_alarm->name); EXPECT_DOUBLE_EQ(10001, alarm->js_alarm->scheduled_time); @@ -240,13 +240,13 @@ TEST_F(ExtensionAlarmsTest, CreateRepeatingWithQuickFirstCall) { // MessageLoop when that happens. MessageLoop::current()->Run(); - ASSERT_TRUE(alarm_manager_->GetAlarm(extension_->id(), std::string())); + ASSERT_TRUE(alarm_manager_->GetAlarm(extension_->id(), "")); EXPECT_THAT(alarm_delegate_->alarms_seen, testing::ElementsAre("")); test_clock_.SetNow(base::Time::FromDoubleT(10.7)); MessageLoop::current()->Run(); - ASSERT_TRUE(alarm_manager_->GetAlarm(extension_->id(), std::string())); + ASSERT_TRUE(alarm_manager_->GetAlarm(extension_->id(), "")); EXPECT_THAT(alarm_delegate_->alarms_seen, testing::ElementsAre("", "")); } diff --git a/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc b/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc index 754eeee..0470b78 100644 --- a/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc +++ b/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc @@ -946,7 +946,7 @@ void BookmarksIOFunction::ShowSelectFileDialog( default_path, &file_type_info, 0, - base::FilePath::StringType(), + FILE_PATH_LITERAL(""), NULL, NULL); } diff --git a/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc b/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc index dd20fba1..a424f83 100644 --- a/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc +++ b/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc @@ -74,16 +74,16 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentSettings) { EXPECT_FALSE(cookie_settings->IsReadingCookieAllowed(url, url)); EXPECT_EQ(CONTENT_SETTING_ALLOW, map->GetContentSetting( - url, url, CONTENT_SETTINGS_TYPE_IMAGES, std::string())); + url, url, CONTENT_SETTINGS_TYPE_IMAGES, "")); EXPECT_EQ(CONTENT_SETTING_BLOCK, map->GetContentSetting( - url, url, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string())); + url, url, CONTENT_SETTINGS_TYPE_JAVASCRIPT, "")); EXPECT_EQ(CONTENT_SETTING_BLOCK, map->GetContentSetting( - url, url, CONTENT_SETTINGS_TYPE_PLUGINS, std::string())); + url, url, CONTENT_SETTINGS_TYPE_PLUGINS, "")); EXPECT_EQ(CONTENT_SETTING_ALLOW, map->GetContentSetting( - url, url, CONTENT_SETTINGS_TYPE_POPUPS, std::string())); + url, url, CONTENT_SETTINGS_TYPE_POPUPS, "")); #if 0 EXPECT_EQ(CONTENT_SETTING_BLOCK, map->GetContentSetting( @@ -91,7 +91,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ContentSettings) { #endif EXPECT_EQ(CONTENT_SETTING_BLOCK, map->GetContentSetting( - url, url, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string())); + url, url, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, "")); } // Flaky on the trybots. See http://crbug.com/96725. diff --git a/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc b/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc index 537d08f..8ee0fbf 100644 --- a/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc +++ b/chrome/browser/extensions/api/content_settings/content_settings_helpers.cc @@ -48,7 +48,7 @@ std::string GetDefaultPort(const std::string& scheme) { if (scheme == chrome::kHttpsScheme) return "443"; NOTREACHED(); - return std::string(); + return ""; } } // namespace diff --git a/chrome/browser/extensions/api/content_settings/content_settings_store_unittest.cc b/chrome/browser/extensions/api/content_settings/content_settings_store_unittest.cc index bedd2ea..5e13633 100644 --- a/chrome/browser/extensions/api/content_settings/content_settings_store_unittest.cc +++ b/chrome/browser/extensions/api/content_settings/content_settings_store_unittest.cc @@ -101,76 +101,73 @@ TEST_F(ContentSettingsStoreTest, RegisterUnregister) { GURL url("http://www.youtube.com"); EXPECT_EQ(CONTENT_SETTING_DEFAULT, - GetContentSettingFromStore(store(), - url, - url, - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - false)); + GetContentSettingFromStore( + store(), url, url, CONTENT_SETTINGS_TYPE_COOKIES, "", false)); // Register first extension std::string ext_id("my_extension"); RegisterExtension(ext_id); EXPECT_EQ(CONTENT_SETTING_DEFAULT, - GetContentSettingFromStore(store(), - url, - url, - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - false)); + GetContentSettingFromStore( + store(), url, url, CONTENT_SETTINGS_TYPE_COOKIES, "", false)); // Set setting ContentSettingsPattern pattern = ContentSettingsPattern::FromURL(GURL("http://www.youtube.com")); EXPECT_CALL(observer, OnContentSettingChanged(ext_id, false)); - store()->SetExtensionContentSetting(ext_id, - pattern, - pattern, - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - CONTENT_SETTING_ALLOW, - kExtensionPrefsScopeRegular); + store()->SetExtensionContentSetting( + ext_id, + pattern, + pattern, + CONTENT_SETTINGS_TYPE_COOKIES, + "", + CONTENT_SETTING_ALLOW, + kExtensionPrefsScopeRegular); Mock::VerifyAndClear(&observer); EXPECT_EQ(CONTENT_SETTING_ALLOW, - GetContentSettingFromStore(store(), - url, - url, - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - false)); + GetContentSettingFromStore( + store(), + url, + url, + CONTENT_SETTINGS_TYPE_COOKIES, + "", + false)); // Register second extension. std::string ext_id_2("my_second_extension"); RegisterExtension(ext_id_2); EXPECT_CALL(observer, OnContentSettingChanged(ext_id_2, false)); - store()->SetExtensionContentSetting(ext_id_2, - pattern, - pattern, - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - CONTENT_SETTING_BLOCK, - kExtensionPrefsScopeRegular); + store()->SetExtensionContentSetting( + ext_id_2, + pattern, + pattern, + CONTENT_SETTINGS_TYPE_COOKIES, + "", + CONTENT_SETTING_BLOCK, + kExtensionPrefsScopeRegular); EXPECT_EQ(CONTENT_SETTING_BLOCK, - GetContentSettingFromStore(store(), - url, - url, - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - false)); + GetContentSettingFromStore( + store(), + url, + url, + CONTENT_SETTINGS_TYPE_COOKIES, + "", + false)); // Unregister first extension. This shouldn't change the setting. EXPECT_CALL(observer, OnContentSettingChanged(ext_id, false)); store()->UnregisterExtension(ext_id); EXPECT_EQ(CONTENT_SETTING_BLOCK, - GetContentSettingFromStore(store(), - url, - url, - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - false)); + GetContentSettingFromStore( + store(), + url, + url, + CONTENT_SETTINGS_TYPE_COOKIES, + "", + false)); Mock::VerifyAndClear(&observer); // Unregister second extension. This should reset the setting to its default @@ -178,12 +175,13 @@ TEST_F(ContentSettingsStoreTest, RegisterUnregister) { EXPECT_CALL(observer, OnContentSettingChanged(ext_id_2, false)); store()->UnregisterExtension(ext_id_2); EXPECT_EQ(CONTENT_SETTING_DEFAULT, - GetContentSettingFromStore(store(), - url, - url, - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - false)); + GetContentSettingFromStore( + store(), + url, + url, + CONTENT_SETTINGS_TYPE_COOKIES, + "", + false)); store()->RemoveObserver(&observer); } @@ -192,7 +190,7 @@ TEST_F(ContentSettingsStoreTest, GetAllSettings) { bool incognito = false; std::vector<content_settings::Rule> rules; GetSettingsForOneTypeFromStore( - store(), CONTENT_SETTINGS_TYPE_COOKIES, std::string(), incognito, &rules); + store(), CONTENT_SETTINGS_TYPE_COOKIES, "", incognito, &rules); ASSERT_EQ(0u, rules.size()); // Register first extension. @@ -200,16 +198,17 @@ TEST_F(ContentSettingsStoreTest, GetAllSettings) { RegisterExtension(ext_id); ContentSettingsPattern pattern = ContentSettingsPattern::FromURL(GURL("http://www.youtube.com")); - store()->SetExtensionContentSetting(ext_id, - pattern, - pattern, - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - CONTENT_SETTING_ALLOW, - kExtensionPrefsScopeRegular); + store()->SetExtensionContentSetting( + ext_id, + pattern, + pattern, + CONTENT_SETTINGS_TYPE_COOKIES, + "", + CONTENT_SETTING_ALLOW, + kExtensionPrefsScopeRegular); GetSettingsForOneTypeFromStore( - store(), CONTENT_SETTINGS_TYPE_COOKIES, std::string(), incognito, &rules); + store(), CONTENT_SETTINGS_TYPE_COOKIES, "", incognito, &rules); ASSERT_EQ(1u, rules.size()); CheckRule(rules[0], pattern, pattern, CONTENT_SETTING_ALLOW); @@ -218,16 +217,20 @@ TEST_F(ContentSettingsStoreTest, GetAllSettings) { RegisterExtension(ext_id_2); ContentSettingsPattern pattern_2 = ContentSettingsPattern::FromURL(GURL("http://www.example.com")); - store()->SetExtensionContentSetting(ext_id_2, - pattern_2, - pattern_2, - CONTENT_SETTINGS_TYPE_COOKIES, - std::string(), - CONTENT_SETTING_BLOCK, - kExtensionPrefsScopeRegular); - - GetSettingsForOneTypeFromStore( - store(), CONTENT_SETTINGS_TYPE_COOKIES, std::string(), incognito, &rules); + store()->SetExtensionContentSetting( + ext_id_2, + pattern_2, + pattern_2, + CONTENT_SETTINGS_TYPE_COOKIES, + "", + CONTENT_SETTING_BLOCK, + kExtensionPrefsScopeRegular); + + GetSettingsForOneTypeFromStore(store(), + CONTENT_SETTINGS_TYPE_COOKIES, + "", + incognito, + &rules); ASSERT_EQ(2u, rules.size()); // Rules appear in the reverse installation order of the extensions. CheckRule(rules[0], pattern_2, pattern_2, CONTENT_SETTING_BLOCK); @@ -237,7 +240,7 @@ TEST_F(ContentSettingsStoreTest, GetAllSettings) { store()->SetExtensionState(ext_id, false); GetSettingsForOneTypeFromStore( - store(), CONTENT_SETTINGS_TYPE_COOKIES, std::string(), incognito, &rules); + store(), CONTENT_SETTINGS_TYPE_COOKIES, "", incognito, &rules); ASSERT_EQ(1u, rules.size()); CheckRule(rules[0], pattern_2, pattern_2, CONTENT_SETTING_BLOCK); @@ -245,7 +248,7 @@ TEST_F(ContentSettingsStoreTest, GetAllSettings) { store()->UnregisterExtension(ext_id_2); GetSettingsForOneTypeFromStore( - store(), CONTENT_SETTINGS_TYPE_COOKIES, std::string(), incognito, &rules); + store(), CONTENT_SETTINGS_TYPE_COOKIES, "", incognito, &rules); ASSERT_EQ(0u, rules.size()); } diff --git a/chrome/browser/extensions/api/cookies/cookies_api.cc b/chrome/browser/extensions/api/cookies/cookies_api.cc index c35b830..f3a4a35 100644 --- a/chrome/browser/extensions/api/cookies/cookies_api.cc +++ b/chrome/browser/extensions/api/cookies/cookies_api.cc @@ -203,9 +203,8 @@ bool CookiesGetFunction::RunImpl() { if (!ParseUrl(parsed_args_->details.url, &url_, true)) return false; - std::string store_id = - parsed_args_->details.store_id.get() ? *parsed_args_->details.store_id - : std::string(); + std::string store_id = parsed_args_->details.store_id.get() ? + *parsed_args_->details.store_id : ""; net::URLRequestContextGetter* store_context = NULL; if (!ParseStoreContext(&store_id, &store_context)) return false; @@ -277,9 +276,8 @@ bool CookiesGetAllFunction::RunImpl() { return false; } - std::string store_id = - parsed_args_->details.store_id.get() ? *parsed_args_->details.store_id - : std::string(); + std::string store_id = parsed_args_->details.store_id.get() ? + *parsed_args_->details.store_id : ""; net::URLRequestContextGetter* store_context = NULL; if (!ParseStoreContext(&store_id, &store_context)) return false; @@ -341,9 +339,8 @@ bool CookiesSetFunction::RunImpl() { if (!ParseUrl(parsed_args_->details.url, &url_, true)) return false; - std::string store_id = - parsed_args_->details.store_id.get() ? *parsed_args_->details.store_id - : std::string(); + std::string store_id = parsed_args_->details.store_id.get() ? + *parsed_args_->details.store_id : ""; net::URLRequestContextGetter* store_context = NULL; if (!ParseStoreContext(&store_id, &store_context)) return false; @@ -377,19 +374,17 @@ void CookiesSetFunction::SetCookieOnIOThread() { cookie_monster->SetCookieWithDetailsAsync( url_, - parsed_args_->details.name.get() ? *parsed_args_->details.name - : std::string(), - parsed_args_->details.value.get() ? *parsed_args_->details.value - : std::string(), - parsed_args_->details.domain.get() ? *parsed_args_->details.domain - : std::string(), - parsed_args_->details.path.get() ? *parsed_args_->details.path - : std::string(), + parsed_args_->details.name.get() ? *parsed_args_->details.name : "", + parsed_args_->details.value.get() ? *parsed_args_->details.value : "", + parsed_args_->details.domain.get() ? *parsed_args_->details.domain : "", + parsed_args_->details.path.get() ? *parsed_args_->details.path : "", expiration_time, - parsed_args_->details.secure.get() ? *parsed_args_->details.secure.get() - : false, - parsed_args_->details.http_only.get() ? *parsed_args_->details.http_only - : false, + parsed_args_->details.secure.get() ? + *parsed_args_->details.secure.get() : + false, + parsed_args_->details.http_only.get() ? + *parsed_args_->details.http_only : + false, base::Bind(&CookiesSetFunction::PullCookie, this)); } @@ -411,9 +406,8 @@ void CookiesSetFunction::PullCookieCallback( // Return the first matching cookie. Relies on the fact that the // CookieMonster returns them in canonical order (longest path, then // earliest creation time). - std::string name = - parsed_args_->details.name.get() ? *parsed_args_->details.name - : std::string(); + std::string name = parsed_args_->details.name.get() ? + *parsed_args_->details.name : ""; if (it->Name() == name) { scoped_ptr<Cookie> cookie( cookies_helpers::CreateCookie(*it, *parsed_args_->details.store_id)); @@ -431,10 +425,10 @@ void CookiesSetFunction::PullCookieCallback( void CookiesSetFunction::RespondOnUIThread() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!success_) { - std::string name = - parsed_args_->details.name.get() ? *parsed_args_->details.name - : std::string(); - error_ = ErrorUtils::FormatErrorMessage(keys::kCookieSetFailedError, name); + std::string name = parsed_args_->details.name.get() ? + *parsed_args_->details.name : ""; + error_ = ErrorUtils::FormatErrorMessage( + keys::kCookieSetFailedError, name); } SendResponse(success_); } @@ -453,9 +447,8 @@ bool CookiesRemoveFunction::RunImpl() { if (!ParseUrl(parsed_args_->details.url, &url_, true)) return false; - std::string store_id = - parsed_args_->details.store_id.get() ? *parsed_args_->details.store_id - : std::string(); + std::string store_id = parsed_args_->details.store_id.get() ? + *parsed_args_->details.store_id : ""; net::URLRequestContextGetter* store_context = NULL; if (!ParseStoreContext(&store_id, &store_context)) return false; diff --git a/chrome/browser/extensions/api/cookies/cookies_helpers.cc b/chrome/browser/extensions/api/cookies/cookies_helpers.cc index c61e729..d9866f2 100644 --- a/chrome/browser/extensions/api/cookies/cookies_helpers.cc +++ b/chrome/browser/extensions/api/cookies/cookies_helpers.cc @@ -74,8 +74,8 @@ scoped_ptr<Cookie> CreateCookie( cookie->host_only = net::cookie_util::DomainIsHostOnly( canonical_cookie.Domain()); // A non-UTF8 path is invalid, so we just replace it with an empty string. - cookie->path = IsStringUTF8(canonical_cookie.Path()) ? canonical_cookie.Path() - : std::string(); + cookie->path = IsStringUTF8(canonical_cookie.Path()) ? + canonical_cookie.Path() : ""; cookie->secure = canonical_cookie.IsSecure(); cookie->http_only = canonical_cookie.IsHttpOnly(); cookie->session = !canonical_cookie.IsPersistent(); diff --git a/chrome/browser/extensions/api/cookies/cookies_unittest.cc b/chrome/browser/extensions/api/cookies/cookies_unittest.cc index 0844b83..f1bd93d 100644 --- a/chrome/browser/extensions/api/cookies/cookies_unittest.cc +++ b/chrome/browser/extensions/api/cookies/cookies_unittest.cc @@ -195,36 +195,22 @@ TEST_F(ExtensionCookiesTest, DomainMatching) { scoped_ptr<GetAll::Params> params(GetAll::Params::Create(args)); cookies_helpers::MatchFilter filter(¶ms->details); - net::CanonicalCookie cookie(GURL(), - std::string(), - std::string(), - tests[i].domain, - std::string(), - base::Time(), - base::Time(), - base::Time(), - false, - false); + net::CanonicalCookie cookie(GURL(), "", "", tests[i].domain,"", + base::Time(), base::Time(), base::Time(), + false, false); EXPECT_EQ(tests[i].matches, filter.MatchesCookie(cookie)); } } TEST_F(ExtensionCookiesTest, DecodeUTF8WithErrorHandling) { - net::CanonicalCookie canonical_cookie(GURL(), - std::string(), - "011Q255bNX_1!yd\203e+", - "test.com", - "/path\203", - base::Time(), - base::Time(), - base::Time(), - false, - false); + net::CanonicalCookie canonical_cookie( + GURL(), "", "011Q255bNX_1!yd\203e+", "test.com", "/path\203", + base::Time(), base::Time(), base::Time(), false, false); scoped_ptr<Cookie> cookie( cookies_helpers::CreateCookie( canonical_cookie, "some cookie store")); EXPECT_EQ(std::string("011Q255bNX_1!yd\xEF\xBF\xBD" "e+"), cookie->value); - EXPECT_EQ(std::string(), cookie->path); + EXPECT_EQ(std::string(""), cookie->path); } } // namespace extensions diff --git a/chrome/browser/extensions/api/declarative/initializing_rules_registry.cc b/chrome/browser/extensions/api/declarative/initializing_rules_registry.cc index d209bed..0074233 100644 --- a/chrome/browser/extensions/api/declarative/initializing_rules_registry.cc +++ b/chrome/browser/extensions/api/declarative/initializing_rules_registry.cc @@ -39,7 +39,7 @@ std::string InitializingRulesRegistry::RemoveRules( if (!error.empty()) return error; RemoveUsedRuleIdentifiers(extension_id, rule_identifiers); - return std::string(); + return ""; } std::string InitializingRulesRegistry::RemoveAllRules( @@ -48,7 +48,7 @@ std::string InitializingRulesRegistry::RemoveAllRules( if (!error.empty()) return error; RemoveAllUsedRuleIdentifiers(extension_id); - return std::string(); + return ""; } std::string InitializingRulesRegistry::GetRules( @@ -122,7 +122,7 @@ std::string InitializingRulesRegistry::CheckAndFillInOptionalRules( used_rule_identifiers_[extension_id].insert(*(rule->id)); } } - return std::string(); + return ""; } void InitializingRulesRegistry::FillInOptionalPriorities( diff --git a/chrome/browser/extensions/api/declarative/rules_registry_with_cache_unittest.cc b/chrome/browser/extensions/api/declarative/rules_registry_with_cache_unittest.cc index 1be1983..4f49f36 100644 --- a/chrome/browser/extensions/api/declarative/rules_registry_with_cache_unittest.cc +++ b/chrome/browser/extensions/api/declarative/rules_registry_with_cache_unittest.cc @@ -69,7 +69,7 @@ TEST_F(RulesRegistryWithCacheTest, AddRules) { registry_->SetResult("Error"); EXPECT_EQ("Error", AddRule(extension_id, rule_id)); EXPECT_EQ(0, GetNumberOfRules(extension_id)); - registry_->SetResult(std::string()); + registry_->SetResult(""); // Check that rules can be inserted. EXPECT_EQ("", AddRule(extension_id, rule_id)); @@ -97,7 +97,7 @@ TEST_F(RulesRegistryWithCacheTest, RemoveRules) { registry_->SetResult("Error"); EXPECT_EQ("Error", RemoveRule(extension_id, rule_id)); EXPECT_EQ(1, GetNumberOfRules(extension_id)); - registry_->SetResult(std::string()); + registry_->SetResult(""); // Check that nothing happens if a rule does not exist. EXPECT_EQ("", RemoveRule(extension_id, "unknown_rule")); @@ -122,7 +122,7 @@ TEST_F(RulesRegistryWithCacheTest, RemoveAllRules) { registry_->SetResult("Error"); EXPECT_EQ("Error", registry_->RemoveAllRules(extension_id)); EXPECT_EQ(2, GetNumberOfRules(extension_id)); - registry_->SetResult(std::string()); + registry_->SetResult(""); // Check that rules may be removed and only for the correct extension. EXPECT_EQ("", registry_->RemoveAllRules(extension_id)); diff --git a/chrome/browser/extensions/api/declarative_content/content_condition.cc b/chrome/browser/extensions/api/declarative_content/content_condition.cc index 6c00b80..4a88e17 100644 --- a/chrome/browser/extensions/api/declarative_content/content_condition.cc +++ b/chrome/browser/extensions/api/declarative_content/content_condition.cc @@ -129,8 +129,7 @@ scoped_ptr<ContentCondition> ContentCondition::Create( if (!url_matcher_condition_set) { URLMatcherConditionSet::Conditions url_matcher_conditions; url_matcher_conditions.insert( - url_matcher_condition_factory->CreateHostPrefixCondition( - std::string())); + url_matcher_condition_factory->CreateHostPrefixCondition("")); url_matcher_condition_set = new URLMatcherConditionSet(++g_next_id, url_matcher_conditions); } diff --git a/chrome/browser/extensions/api/declarative_content/content_rules_registry.cc b/chrome/browser/extensions/api/declarative_content/content_rules_registry.cc index eb95b47..c9ed31e 100644 --- a/chrome/browser/extensions/api/declarative_content/content_rules_registry.cc +++ b/chrome/browser/extensions/api/declarative_content/content_rules_registry.cc @@ -176,7 +176,7 @@ std::string ContentRulesRegistry::AddRulesImpl( UpdateConditionCache(); - return std::string(); + return ""; } std::string ContentRulesRegistry::RemoveRulesImpl( @@ -221,7 +221,7 @@ std::string ContentRulesRegistry::RemoveRulesImpl( UpdateConditionCache(); - return std::string(); + return ""; } std::string ContentRulesRegistry::RemoveAllRulesImpl( diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc b/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc index dc3bead..813b6b9 100644 --- a/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc +++ b/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc @@ -56,7 +56,7 @@ IN_PROC_BROWSER_TEST_F(DeclarativeContentApiTest, Overview) { tab, "document.body.innerHTML = '<input type=\"password\">';")); // Give the mutation observer a chance to run and send back the // matching-selector update. - ASSERT_TRUE(content::ExecuteScript(tab, std::string())); + ASSERT_TRUE(content::ExecuteScript(tab, "")); EXPECT_TRUE(page_action->GetIsVisible(tab_id)); // Remove it again to make sure that reverts the action. @@ -64,7 +64,7 @@ IN_PROC_BROWSER_TEST_F(DeclarativeContentApiTest, Overview) { tab, "document.body.innerHTML = 'Hello world';")); // Give the mutation observer a chance to run and send back the // matching-selector update. - ASSERT_TRUE(content::ExecuteScript(tab, std::string())); + ASSERT_TRUE(content::ExecuteScript(tab, "")); EXPECT_FALSE(page_action->GetIsVisible(tab_id)); } diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc index 695edac..c8cae51 100644 --- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc +++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc @@ -184,7 +184,7 @@ std::string WebRequestRulesRegistry::AddRulesImpl( ClearCacheOnNavigation(); - return std::string(); + return ""; } std::string WebRequestRulesRegistry::RemoveRulesImpl( @@ -223,7 +223,7 @@ std::string WebRequestRulesRegistry::RemoveRulesImpl( ClearCacheOnNavigation(); - return std::string(); + return ""; } std::string WebRequestRulesRegistry::RemoveAllRulesImpl( diff --git a/chrome/browser/extensions/api/developer_private/entry_picker.cc b/chrome/browser/extensions/api/developer_private/entry_picker.cc index 12a2994..c2b3d78 100644 --- a/chrome/browser/extensions/api/developer_private/entry_picker.cc +++ b/chrome/browser/extensions/api/developer_private/entry_picker.cc @@ -64,9 +64,8 @@ EntryPicker::EntryPicker(EntryPickerClient* client, last_directory, &info, file_type_index, - base::FilePath::StringType(), - owning_window, - NULL); + FILE_PATH_LITERAL(""), + owning_window, NULL); } EntryPicker::~EntryPicker() {} diff --git a/chrome/browser/extensions/api/dial/dial_device_data_unittest.cc b/chrome/browser/extensions/api/dial/dial_device_data_unittest.cc index 4ccc470..447efca 100644 --- a/chrome/browser/extensions/api/dial/dial_device_data_unittest.cc +++ b/chrome/browser/extensions/api/dial/dial_device_data_unittest.cc @@ -96,9 +96,9 @@ TEST(DialDeviceDataTest, TestIsDeviceDescriptionUrl) { GURL("https://192.168.1.1:1234/dd.xml"))); EXPECT_FALSE(DialDeviceData::IsDeviceDescriptionUrl(GURL())); - EXPECT_FALSE(DialDeviceData::IsDeviceDescriptionUrl(GURL(std::string()))); - EXPECT_FALSE( - DialDeviceData::IsDeviceDescriptionUrl(GURL("file://path/to/file"))); + EXPECT_FALSE(DialDeviceData::IsDeviceDescriptionUrl(GURL(""))); + EXPECT_FALSE(DialDeviceData::IsDeviceDescriptionUrl( + GURL("file://path/to/file"))); } } // namespace extensions diff --git a/chrome/browser/extensions/api/dial/dial_service_unittest.cc b/chrome/browser/extensions/api/dial/dial_service_unittest.cc index b378589..da1cc7b 100644 --- a/chrome/browser/extensions/api/dial/dial_service_unittest.cc +++ b/chrome/browser/extensions/api/dial/dial_service_unittest.cc @@ -116,7 +116,9 @@ TEST_F(DialServiceTest, TestResponseParsing) { DialDeviceData not_parsed; // Empty, garbage - EXPECT_FALSE(DialServiceImpl::ParseResponse(std::string(), now, ¬_parsed)); + EXPECT_FALSE(DialServiceImpl::ParseResponse( + "", + now, ¬_parsed)); EXPECT_FALSE(DialServiceImpl::ParseResponse( "\r\n\r\n", now, ¬_parsed)); diff --git a/chrome/browser/extensions/api/downloads/downloads_api.cc b/chrome/browser/extensions/api/downloads/downloads_api.cc index 6a126aa..44e7f29 100644 --- a/chrome/browser/extensions/api/downloads/downloads_api.cc +++ b/chrome/browser/extensions/api/downloads/downloads_api.cc @@ -218,9 +218,9 @@ scoped_ptr<base::DictionaryValue> DownloadItemToJSON( json->SetBoolean(kExistsKey, !download_item->GetFileExternallyRemoved()); json->SetInteger(kIdKey, download_item->GetId()); const GURL& url = download_item->GetOriginalUrl(); - json->SetString(kUrlKey, (url.is_valid() ? url.spec() : std::string())); - json->SetString(kFilenameKey, - download_item->GetFullPath().LossyDisplayName()); + json->SetString(kUrlKey, (url.is_valid() ? url.spec() : "")); + json->SetString( + kFilenameKey, download_item->GetFullPath().LossyDisplayName()); json->SetString(kDangerKey, DangerString(download_item->GetDangerType())); if (download_item->GetDangerType() != content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS) diff --git a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc index e403cd5..23a1131 100644 --- a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc +++ b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc @@ -737,8 +737,7 @@ class HTML5FileWriter { ~HTML5FileWriter() { CHECK(BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( &HTML5FileWriter::TearDownURLRequestContext, base::Unretained(this)))); - events_listener_->WaitFor( - profile_, kURLRequestContextToreDown, std::string()); + events_listener_->WaitFor(profile_, kURLRequestContextToreDown, ""); } bool WriteFile() { @@ -1072,10 +1071,8 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest, // Simulate an error during icon load by invoking the mock with an empty // result string. - std::string error = RunFunctionAndReturnError( - MockedGetFileIconFunction(download_item->GetTargetFilePath(), - IconLoader::NORMAL, - std::string()), + std::string error = RunFunctionAndReturnError(MockedGetFileIconFunction( + download_item->GetTargetFilePath(), IconLoader::NORMAL, ""), args32); EXPECT_STREQ(download_extension_errors::kIconNotFoundError, error.c_str()); diff --git a/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc b/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc index 07845e4..0a5497f 100644 --- a/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc +++ b/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc @@ -692,9 +692,11 @@ IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, TestTriggerBrowserAction) { "window.domAutomationController.send(document.body.style." "backgroundColor);"; std::string result; - const std::string frame_xpath; - EXPECT_TRUE(content::ExecuteScriptInFrameAndExtractString( - tab, frame_xpath, script, &result)); + const std::string frame_xpath = ""; + EXPECT_TRUE(content::ExecuteScriptInFrameAndExtractString(tab, + frame_xpath, + script, + &result)); EXPECT_EQ(result, "red"); } diff --git a/chrome/browser/extensions/api/extension_action/page_action_apitest.cc b/chrome/browser/extensions/api/extension_action/page_action_apitest.cc index cad5250..232280a 100644 --- a/chrome/browser/extensions/api/extension_action/page_action_apitest.cc +++ b/chrome/browser/extensions/api/extension_action/page_action_apitest.cc @@ -63,7 +63,7 @@ IN_PROC_BROWSER_TEST_F(PageActionApiTest, Basic) { ExtensionService* service = extensions::ExtensionSystem::Get( browser()->profile())->extension_service(); service->browser_event_router()->PageActionExecuted( - browser()->profile(), *action, tab_id, std::string(), 0); + browser()->profile(), *action, tab_id, "", 0); EXPECT_TRUE(catcher.GetNextResult()); } @@ -108,7 +108,7 @@ IN_PROC_BROWSER_TEST_F(PageActionApiTest, AddPopup) { ExtensionService* service = extensions::ExtensionSystem::Get( browser()->profile())->extension_service(); service->browser_event_router()->PageActionExecuted( - browser()->profile(), *page_action, tab_id, std::string(), 1); + browser()->profile(), *page_action, tab_id, "", 1); ASSERT_TRUE(catcher.GetNextResult()); } @@ -188,7 +188,7 @@ IN_PROC_BROWSER_TEST_F(PageActionApiTest, OldPageActions) { browser()->profile())->extension_service(); ExtensionAction* page_action = GetPageAction(*extension); service->browser_event_router()->PageActionExecuted( - browser()->profile(), *page_action, tab_id, std::string(), 1); + browser()->profile(), *page_action, tab_id, "", 1); EXPECT_TRUE(catcher.GetNextResult()); } } @@ -260,7 +260,7 @@ IN_PROC_BROWSER_TEST_F(PageActionApiTest, TestTriggerPageAction) { ExtensionService* service = extensions::ExtensionSystem::Get( browser()->profile())->extension_service(); service->browser_event_router()->PageActionExecuted( - browser()->profile(), *page_action, tab_id, std::string(), 0); + browser()->profile(), *page_action, tab_id, "", 0); EXPECT_TRUE(catcher.GetNextResult()); } @@ -273,9 +273,11 @@ IN_PROC_BROWSER_TEST_F(PageActionApiTest, TestTriggerPageAction) { "window.domAutomationController.send(document.body.style." "backgroundColor);"; std::string result; - const std::string frame_xpath; - EXPECT_TRUE(content::ExecuteScriptInFrameAndExtractString( - tab, frame_xpath, script, &result)); + const std::string frame_xpath = ""; + EXPECT_TRUE(content::ExecuteScriptInFrameAndExtractString(tab, + frame_xpath, + script, + &result)); EXPECT_EQ(result, "red"); } diff --git a/chrome/browser/extensions/api/extension_action/script_badge_apitest.cc b/chrome/browser/extensions/api/extension_action/script_badge_apitest.cc index ff7fae7..fd32e96 100644 --- a/chrome/browser/extensions/api/extension_action/script_badge_apitest.cc +++ b/chrome/browser/extensions/api/extension_action/script_badge_apitest.cc @@ -88,8 +88,7 @@ IN_PROC_BROWSER_TEST_F(ScriptBadgeApiTest, Basics) { ResultCatcher catcher; // Visit a non-extension page so the extension can run a content script and // cause the script badge to be animated in. - ui_test_utils::NavigateToURL(browser(), - test_server()->GetURL(std::string())); + ui_test_utils::NavigateToURL(browser(), test_server()->GetURL("")); ASSERT_TRUE(catcher.GetNextResult()); } EXPECT_TRUE(script_badge->GetIsVisible(tab_id)); diff --git a/chrome/browser/extensions/api/file_system/file_system_api.cc b/chrome/browser/extensions/api/file_system/file_system_api.cc index e849e3cc..3bb588a 100644 --- a/chrome/browser/extensions/api/file_system/file_system_api.cc +++ b/chrome/browser/extensions/api/file_system/file_system_api.cc @@ -435,11 +435,8 @@ class FileSystemChooseEntryFunction::FilePicker select_file_dialog_->SelectFile(picker_type, string16(), suggested_name, - &file_type_info, - 0, - base::FilePath::StringType(), - owning_window, - NULL); + &file_type_info, 0, FILE_PATH_LITERAL(""), + owning_window, NULL); } virtual ~FilePicker() {} diff --git a/chrome/browser/extensions/api/file_system/file_system_api_unittest.cc b/chrome/browser/extensions/api/file_system/file_system_api_unittest.cc index 570c0fb..96da293 100644 --- a/chrome/browser/extensions/api/file_system/file_system_api_unittest.cc +++ b/chrome/browser/extensions/api/file_system/file_system_api_unittest.cc @@ -70,8 +70,8 @@ TEST_F(FileSystemApiUnitTest, FileSystemChooseEntryFunctionFileTypeInfoTest) { // Test grouping of multiple types. file_type_info = ui::SelectFileDialog::FileTypeInfo(); std::vector<linked_ptr<AcceptOption> > options; - options.push_back(linked_ptr<AcceptOption>(BuildAcceptOption( - std::string(), "application/x-chrome-extension", "jso"))); + options.push_back(linked_ptr<AcceptOption>( + BuildAcceptOption("", "application/x-chrome-extension", "jso"))); acceptsAllTypes = false; FileSystemChooseEntryFunction::BuildFileTypeInfo(&file_type_info, base::FilePath::StringType(), &options, &acceptsAllTypes); @@ -90,7 +90,7 @@ TEST_F(FileSystemApiUnitTest, FileSystemChooseEntryFunctionFileTypeInfoTest) { file_type_info = ui::SelectFileDialog::FileTypeInfo(); options.clear(); options.push_back(linked_ptr<AcceptOption>( - BuildAcceptOption(std::string(), std::string(), "unrelated"))); + BuildAcceptOption("", "", "unrelated"))); acceptsAllTypes = false; FileSystemChooseEntryFunction::BuildFileTypeInfo(&file_type_info, ToStringType(".jso"), &options, &acceptsAllTypes); @@ -100,9 +100,9 @@ TEST_F(FileSystemApiUnitTest, FileSystemChooseEntryFunctionFileTypeInfoTest) { file_type_info = ui::SelectFileDialog::FileTypeInfo(); options.clear(); options.push_back(linked_ptr<AcceptOption>( - BuildAcceptOption(std::string(), std::string(), "jso,js"))); + BuildAcceptOption("", "", "jso,js"))); options.push_back(linked_ptr<AcceptOption>( - BuildAcceptOption(std::string(), std::string(), "cpp,cc"))); + BuildAcceptOption("", "", "cpp,cc"))); acceptsAllTypes = false; FileSystemChooseEntryFunction::BuildFileTypeInfo(&file_type_info, base::FilePath::StringType(), &options, &acceptsAllTypes); @@ -122,7 +122,7 @@ TEST_F(FileSystemApiUnitTest, FileSystemChooseEntryFunctionFileTypeInfoTest) { file_type_info = ui::SelectFileDialog::FileTypeInfo(); options.clear(); options.push_back(linked_ptr<AcceptOption>( - BuildAcceptOption(std::string(), "image/*", "html"))); + BuildAcceptOption("", "image/*", "html"))); acceptsAllTypes = false; FileSystemChooseEntryFunction::BuildFileTypeInfo(&file_type_info, base::FilePath::StringType(), &options, &acceptsAllTypes); @@ -134,8 +134,8 @@ TEST_F(FileSystemApiUnitTest, FileSystemChooseEntryFunctionFileTypeInfoTest) { // still present the default. file_type_info = ui::SelectFileDialog::FileTypeInfo(); options.clear(); - options.push_back(linked_ptr<AcceptOption>(BuildAcceptOption( - std::string(), "image/*,audio/*,video/*", std::string()))); + options.push_back(linked_ptr<AcceptOption>( + BuildAcceptOption("", "image/*,audio/*,video/*", ""))); acceptsAllTypes = false; FileSystemChooseEntryFunction::BuildFileTypeInfo(&file_type_info, base::FilePath::StringType(), &options, &acceptsAllTypes); @@ -146,7 +146,7 @@ TEST_F(FileSystemApiUnitTest, FileSystemChooseEntryFunctionFileTypeInfoTest) { file_type_info = ui::SelectFileDialog::FileTypeInfo(); options.clear(); options.push_back(linked_ptr<AcceptOption>( - BuildAcceptOption("File Types 101", "image/jpeg", std::string()))); + BuildAcceptOption("File Types 101", "image/jpeg", ""))); acceptsAllTypes = false; FileSystemChooseEntryFunction::BuildFileTypeInfo(&file_type_info, base::FilePath::StringType(), &options, &acceptsAllTypes); diff --git a/chrome/browser/extensions/api/identity/identity_apitest.cc b/chrome/browser/extensions/api/identity/identity_apitest.cc index 174f922..b6fec79d 100644 --- a/chrome/browser/extensions/api/identity/identity_apitest.cc +++ b/chrome/browser/extensions/api/identity/identity_apitest.cc @@ -508,7 +508,7 @@ class LaunchWebAuthFlowFunctionTest : public ExtensionBrowserTest { }; IN_PROC_BROWSER_TEST_F(LaunchWebAuthFlowFunctionTest, Bounds) { - RunAndCheckBounds(std::string(), 0, 0, 0, 0); + RunAndCheckBounds("", 0, 0, 0, 0); RunAndCheckBounds("\"width\": 100, \"height\": 200", 0, 0, 100, 200); RunAndCheckBounds("\"left\": 100, \"top\": 200", 100, 200, 0, 0); RunAndCheckBounds( diff --git a/chrome/browser/extensions/api/management/management_api_browsertest.cc b/chrome/browser/extensions/api/management/management_api_browsertest.cc index 5b6b04d..f475e81 100644 --- a/chrome/browser/extensions/api/management/management_api_browsertest.cc +++ b/chrome/browser/extensions/api/management/management_api_browsertest.cc @@ -257,15 +257,15 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementApiEscalationTest, // This should succeed when user accepts dialog. CommandLine::ForCurrentProcess()->AppendSwitchASCII( switches::kAppsGalleryInstallAutoConfirmForTests, "accept"); - SetEnabled(true, true, std::string()); + SetEnabled(true, true, ""); // Crash the extension. Mock a reload by disabling and then enabling. The // extension should be reloaded and enabled. ASSERT_TRUE(CrashEnabledExtension(kId)); - SetEnabled(false, true, std::string()); - SetEnabled(true, true, std::string()); - const Extension* extension = ExtensionSystem::Get(browser()->profile()) - ->extension_service()->GetExtensionById(kId, false); + SetEnabled(false, true, ""); + SetEnabled(true, true, ""); + const Extension* extension = ExtensionSystem::Get(browser()->profile())-> + extension_service()->GetExtensionById(kId, false); EXPECT_TRUE(extension); } diff --git a/chrome/browser/extensions/api/messaging/message_service.cc b/chrome/browser/extensions/api/messaging/message_service.cc index e3075f9..aae6a25 100644 --- a/chrome/browser/extensions/api/messaging/message_service.cc +++ b/chrome/browser/extensions/api/messaging/message_service.cc @@ -216,7 +216,7 @@ void MessageService::OpenChannelToNativeApp( } if (!has_permission) { - ExtensionMessagePort port(source, MSG_ROUTING_CONTROL, std::string()); + ExtensionMessagePort port(source, MSG_ROUTING_CONTROL, ""); port.DispatchOnDisconnect(GET_OPPOSITE_PORT_ID(receiver_port_id), kMissingPermissionError); return; @@ -247,7 +247,7 @@ void MessageService::OpenChannelToNativeApp( if (!native_process.get()) { LOG(ERROR) << "Failed to create native process."; // Treat it as a disconnect. - ExtensionMessagePort port(source, MSG_ROUTING_CONTROL, std::string()); + ExtensionMessagePort port(source, MSG_ROUTING_CONTROL, ""); port.DispatchOnDisconnect(GET_OPPOSITE_PORT_ID(receiver_port_id), kReceivingEndDoesntExistError); return; @@ -320,8 +320,7 @@ bool MessageService::OpenChannelImpl(scoped_ptr<OpenChannelParams> params) { if (!params->receiver.get() || !params->receiver->GetRenderProcessHost()) { // Treat it as a disconnect. - ExtensionMessagePort port( - params->source, MSG_ROUTING_CONTROL, std::string()); + ExtensionMessagePort port(params->source, MSG_ROUTING_CONTROL, ""); port.DispatchOnDisconnect(GET_OPPOSITE_PORT_ID(params->receiver_port_id), kReceivingEndDoesntExistError); return false; diff --git a/chrome/browser/extensions/api/proxy/proxy_api.cc b/chrome/browser/extensions/api/proxy/proxy_api.cc index 5e811bd..ff945d3 100644 --- a/chrome/browser/extensions/api/proxy/proxy_api.cc +++ b/chrome/browser/extensions/api/proxy/proxy_api.cc @@ -41,7 +41,7 @@ void ProxyEventRouter::OnProxyError( DictionaryValue* dict = new DictionaryValue(); dict->SetBoolean(keys::kProxyEventFatal, true); dict->SetString(keys::kProxyEventError, net::ErrorToString(error_code)); - dict->SetString(keys::kProxyEventDetails, std::string()); + dict->SetString(keys::kProxyEventDetails, ""); args->Append(dict); if (profile) { diff --git a/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc b/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc index ff3cd32..116f85a 100644 --- a/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc +++ b/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc @@ -222,71 +222,41 @@ TEST(ExtensionProxyApiHelpers, CreateProxyConfigDict) { std::string error; scoped_ptr<DictionaryValue> exp_direct(ProxyConfigDictionary::CreateDirect()); scoped_ptr<DictionaryValue> out_direct( - CreateProxyConfigDict(ProxyPrefs::MODE_DIRECT, - false, - std::string(), - std::string(), - std::string(), - std::string(), + CreateProxyConfigDict(ProxyPrefs::MODE_DIRECT, false, "", "", "", "", &error)); EXPECT_TRUE(Value::Equals(exp_direct.get(), out_direct.get())); scoped_ptr<DictionaryValue> exp_auto( ProxyConfigDictionary::CreateAutoDetect()); scoped_ptr<DictionaryValue> out_auto( - CreateProxyConfigDict(ProxyPrefs::MODE_AUTO_DETECT, - false, - std::string(), - std::string(), - std::string(), - std::string(), + CreateProxyConfigDict(ProxyPrefs::MODE_AUTO_DETECT, false, "", "", "", "", &error)); EXPECT_TRUE(Value::Equals(exp_auto.get(), out_auto.get())); scoped_ptr<DictionaryValue> exp_pac_url( ProxyConfigDictionary::CreatePacScript(kSamplePacScriptUrl, false)); scoped_ptr<DictionaryValue> out_pac_url( - CreateProxyConfigDict(ProxyPrefs::MODE_PAC_SCRIPT, - false, - kSamplePacScriptUrl, - std::string(), - std::string(), - std::string(), - &error)); + CreateProxyConfigDict(ProxyPrefs::MODE_PAC_SCRIPT, false, + kSamplePacScriptUrl, "", "", "", &error)); EXPECT_TRUE(Value::Equals(exp_pac_url.get(), out_pac_url.get())); scoped_ptr<DictionaryValue> exp_pac_data( ProxyConfigDictionary::CreatePacScript(kSamplePacScriptAsDataUrl, false)); scoped_ptr<DictionaryValue> out_pac_data( - CreateProxyConfigDict(ProxyPrefs::MODE_PAC_SCRIPT, - false, - std::string(), - kSamplePacScript, - std::string(), - std::string(), - &error)); + CreateProxyConfigDict(ProxyPrefs::MODE_PAC_SCRIPT, false, "", + kSamplePacScript, "", "", &error)); EXPECT_TRUE(Value::Equals(exp_pac_data.get(), out_pac_data.get())); scoped_ptr<DictionaryValue> exp_fixed( ProxyConfigDictionary::CreateFixedServers("foo:80", "localhost")); scoped_ptr<DictionaryValue> out_fixed( - CreateProxyConfigDict(ProxyPrefs::MODE_FIXED_SERVERS, - false, - std::string(), - std::string(), - "foo:80", - "localhost", - &error)); + CreateProxyConfigDict(ProxyPrefs::MODE_FIXED_SERVERS, false, "", "", + "foo:80", "localhost", &error)); EXPECT_TRUE(Value::Equals(exp_fixed.get(), out_fixed.get())); scoped_ptr<DictionaryValue> exp_system(ProxyConfigDictionary::CreateSystem()); scoped_ptr<DictionaryValue> out_system( - CreateProxyConfigDict(ProxyPrefs::MODE_SYSTEM, - false, - std::string(), - std::string(), - std::string(), - std::string(), + CreateProxyConfigDict(ProxyPrefs::MODE_SYSTEM, false, "", "", "", "", &error)); EXPECT_TRUE(Value::Equals(exp_system.get(), out_system.get())); diff --git a/chrome/browser/extensions/api/socket/udp_socket.cc b/chrome/browser/extensions/api/socket/udp_socket.cc index b9a804c..a2b5f97 100644 --- a/chrome/browser/extensions/api/socket/udp_socket.cc +++ b/chrome/browser/extensions/api/socket/udp_socket.cc @@ -108,7 +108,7 @@ void UDPSocket::RecvFrom(int count, DCHECK(!callback.is_null()); if (!recv_from_callback_.is_null()) { - callback.Run(net::ERR_IO_PENDING, NULL, std::string(), 0); + callback.Run(net::ERR_IO_PENDING, NULL, "", 0); return; } else { recv_from_callback_ = callback; diff --git a/chrome/browser/extensions/api/storage/settings_sync_unittest.cc b/chrome/browser/extensions/api/storage/settings_sync_unittest.cc index fcfcdc8..ec530e8 100644 --- a/chrome/browser/extensions/api/storage/settings_sync_unittest.cc +++ b/chrome/browser/extensions/api/storage/settings_sync_unittest.cc @@ -130,10 +130,9 @@ class MockSyncChangeProcessor : public syncer::SyncChangeProcessor { if (matching_changes.empty()) { ADD_FAILURE() << "No matching changes for " << extension_id << "/" << key << " (out of " << changes_.size() << ")"; - return SettingSyncData(syncer::SyncChange::ACTION_INVALID, - std::string(), - std::string(), - scoped_ptr<Value>(new DictionaryValue())); + return SettingSyncData( + syncer::SyncChange::ACTION_INVALID, "", "", + scoped_ptr<Value>(new DictionaryValue())); } if (matching_changes.size() != 1u) { ADD_FAILURE() << matching_changes.size() << " matching changes for " << diff --git a/chrome/browser/extensions/api/web_request/web_request_api.cc b/chrome/browser/extensions/api/web_request/web_request_api.cc index 56a8403..a17684e 100644 --- a/chrome/browser/extensions/api/web_request/web_request_api.cc +++ b/chrome/browser/extensions/api/web_request/web_request_api.cc @@ -316,7 +316,7 @@ ListValue* GetRequestHeadersList(const net::HttpRequestHeaders& headers) { // Creates a StringValue with the status line of |headers|. If |headers| is // NULL, an empty string is returned. Ownership is passed to the caller. StringValue* GetStatusLine(net::HttpResponseHeaders* headers) { - return new StringValue(headers ? headers->GetStatusLine() : std::string()); + return new StringValue(headers ? headers->GetStatusLine() : ""); } void NotifyWebRequestAPIUsed(void* profile_id, const Extension* extension) { diff --git a/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc b/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc index 0d2a3d6..a9f1319 100644 --- a/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc +++ b/chrome/browser/extensions/api/web_request/web_request_api_helpers.cc @@ -621,7 +621,7 @@ static std::string FindSetRequestHeader( return (*delta)->extension_id; } } - return std::string(); + return ""; } // Returns the extension ID of the first extension in |deltas| that removes the @@ -639,7 +639,7 @@ static std::string FindRemoveRequestHeader( return (*delta)->extension_id; } } - return std::string(); + return ""; } void MergeOnBeforeSendHeadersResponses( @@ -816,26 +816,22 @@ static bool DoesResponseCookieMatchFilter(net::ParsedCookie* cookie, if (filter->name.get() && cookie->Name() != *filter->name) return false; if (filter->value.get() && cookie->Value() != *filter->value) return false; if (filter->expires.get()) { - std::string actual_value = - cookie->HasExpires() ? cookie->Expires() : std::string(); + std::string actual_value = cookie->HasExpires() ? cookie->Expires() : ""; if (actual_value != *filter->expires) return false; } if (filter->max_age.get()) { - std::string actual_value = - cookie->HasMaxAge() ? cookie->MaxAge() : std::string(); + std::string actual_value = cookie->HasMaxAge() ? cookie->MaxAge() : ""; if (actual_value != base::IntToString(*filter->max_age)) return false; } if (filter->domain.get()) { - std::string actual_value = - cookie->HasDomain() ? cookie->Domain() : std::string(); + std::string actual_value = cookie->HasDomain() ? cookie->Domain() : ""; if (actual_value != *filter->domain) return false; } if (filter->path.get()) { - std::string actual_value = - cookie->HasPath() ? cookie->Path() : std::string(); + std::string actual_value = cookie->HasPath() ? cookie->Path() : ""; if (actual_value != *filter->path) return false; } @@ -884,8 +880,7 @@ static bool MergeAddResponseCookieModifications( continue; // Cookie names are not unique in response cookies so we always append // and never override. - linked_ptr<net::ParsedCookie> cookie( - new net::ParsedCookie(std::string())); + linked_ptr<net::ParsedCookie> cookie(new net::ParsedCookie("")); ApplyResponseCookieModification((*mod)->modification.get(), cookie.get()); cookies->push_back(cookie); modified = true; @@ -1013,7 +1008,7 @@ static std::string FindRemoveResponseHeader( return (*delta)->extension_id; } } - return std::string(); + return ""; } void MergeOnHeadersReceivedResponses( diff --git a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc index fc78860..91e3dd9 100644 --- a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc +++ b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc @@ -574,10 +574,9 @@ TEST_F(ExtensionWebRequestTest, AccessRequestBodyData) { keys::kRequestBodyRawBytesKey, BinaryValue::CreateWithCopiedBuffer(kPlainBlock1, kPlainBlock1Length), &raw); - extensions::subtle::AppendKeyValuePair( - keys::kRequestBodyRawFileKey, - Value::CreateStringValue(std::string()), - &raw); + extensions::subtle::AppendKeyValuePair(keys::kRequestBodyRawFileKey, + Value::CreateStringValue(""), + &raw); extensions::subtle::AppendKeyValuePair( keys::kRequestBodyRawBytesKey, BinaryValue::CreateWithCopiedBuffer(kPlainBlock2, kPlainBlock2Length), @@ -963,7 +962,7 @@ void TestInitFromValue(const std::string& values, bool expected_return_code, } TEST_F(ExtensionWebRequestTest, InitFromValue) { - TestInitFromValue(std::string(), true, 0); + TestInitFromValue("", true, 0); // Single valid values. TestInitFromValue( diff --git a/chrome/browser/extensions/api/web_socket_proxy_private/web_socket_proxy_private_api.cc b/chrome/browser/extensions/api/web_socket_proxy_private/web_socket_proxy_private_api.cc index 91483c5..237941c 100644 --- a/chrome/browser/extensions/api/web_socket_proxy_private/web_socket_proxy_private_api.cc +++ b/chrome/browser/extensions/api/web_socket_proxy_private/web_socket_proxy_private_api.cc @@ -95,7 +95,7 @@ void WebSocketProxyPrivate::ResolveHostIOPart(IOThread* io_thread) { bool WebSocketProxyPrivate::RunImpl() { AddRef(); - SetResult(Value::CreateStringValue(std::string())); + SetResult(Value::CreateStringValue("")); #if defined(OS_CHROMEOS) bool delay_response = false; diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc index 8cb59aa..0264c36 100644 --- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc +++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc @@ -295,7 +295,7 @@ bool BeginInstallWithManifestFunction::RunImpl() { void BeginInstallWithManifestFunction::SetResultCode(ResultCode code) { switch (code) { case ERROR_NONE: - SetResult(Value::CreateStringValue(std::string())); + SetResult(Value::CreateStringValue("")); break; case UNKNOWN_ERROR: SetResult(Value::CreateStringValue("unknown_error")); @@ -338,7 +338,7 @@ void BeginInstallWithManifestFunction::OnWebstoreParseSuccess( Extension::FROM_WEBSTORE, id, localized_name_, - std::string(), + "", &error); if (!dummy_extension_) { diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc index 1a39317..81a63d1 100644 --- a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc +++ b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc @@ -248,7 +248,7 @@ class ExtensionWebstoreGetWebGLStatusTest : public InProcessBrowserTest { function.get(), kEmptyArgs, browser())); ASSERT_TRUE(result); EXPECT_EQ(base::Value::TYPE_STRING, result->GetType()); - std::string webgl_status; + std::string webgl_status = ""; EXPECT_TRUE(result->GetAsString(&webgl_status)); EXPECT_STREQ(webgl_allowed ? kWebGLStatusAllowed : kWebGLStatusBlocked, webgl_status.c_str()); diff --git a/chrome/browser/extensions/bundle_installer.cc b/chrome/browser/extensions/bundle_installer.cc index 7cf66d3..97005be 100644 --- a/chrome/browser/extensions/bundle_installer.cc +++ b/chrome/browser/extensions/bundle_installer.cc @@ -215,7 +215,7 @@ void BundleInstaller::ParseManifests() { for (ItemMap::iterator i = items_.begin(); i != items_.end(); ++i) { scoped_refptr<WebstoreInstallHelper> helper = new WebstoreInstallHelper( - this, i->first, i->second.manifest, std::string(), GURL(), NULL); + this, i->first, i->second.manifest, "", GURL(), NULL); helper->Start(); } } diff --git a/chrome/browser/extensions/component_loader.cc b/chrome/browser/extensions/component_loader.cc index 82a6883..58c53b7 100644 --- a/chrome/browser/extensions/component_loader.cc +++ b/chrome/browser/extensions/component_loader.cc @@ -137,7 +137,7 @@ std::string ComponentLoader::Add(const std::string& manifest_contents, DictionaryValue* manifest = ParseManifest(manifest_contents); if (manifest) return Add(manifest, root_directory); - return std::string(); + return ""; } std::string ComponentLoader::Add(const DictionaryValue* parsed_manifest, diff --git a/chrome/browser/extensions/component_loader_unittest.cc b/chrome/browser/extensions/component_loader_unittest.cc index 4b2b52a..bedcfee 100644 --- a/chrome/browser/extensions/component_loader_unittest.cc +++ b/chrome/browser/extensions/component_loader_unittest.cc @@ -141,7 +141,7 @@ TEST_F(ComponentLoaderTest, ParseManifest) { // Test manifests that are valid JSON, but don't have an object literal // at the root. ParseManifest() should always return NULL. - manifest.reset(component_loader_.ParseManifest(std::string())); + manifest.reset(component_loader_.ParseManifest("")); EXPECT_FALSE(manifest.get()); manifest.reset(component_loader_.ParseManifest("[{ \"foo\": 3 }]")); diff --git a/chrome/browser/extensions/event_router.cc b/chrome/browser/extensions/event_router.cc index 72e0f52..4a75636 100644 --- a/chrome/browser/extensions/event_router.cc +++ b/chrome/browser/extensions/event_router.cc @@ -119,7 +119,7 @@ void EventRouter::LogExtensionEventMessage(void* profile_id, LOG(WARNING) << "Extension " << extension_id << " not found!"; } else { extensions::ActivityLog::GetInstance(profile)->LogEventAction( - extension, event_name, event_args.get(), std::string()); + extension, event_name, event_args.get(), ""); } } } @@ -243,8 +243,10 @@ void EventRouter::OnListenerAdded(const EventListener* listener) { scoped_ptr<ListValue> args(new ListValue()); if (listener->filter) args->Append(listener->filter->DeepCopy()); - activity_log_->LogAPIAction( - extension, event_name + ".addListener", args.get(), std::string()); + activity_log_->LogAPIAction(extension, + event_name + ".addListener", + args.get(), + ""); } } @@ -269,8 +271,10 @@ void EventRouter::OnListenerRemoved(const EventListener* listener) { ExtensionService::INCLUDE_ENABLED); if (extension) { scoped_ptr<ListValue> args(new ListValue()); - activity_log_->LogAPIAction( - extension, event_name + ".removeListener", args.get(), std::string()); + activity_log_->LogAPIAction(extension, + event_name + ".removeListener", + args.get(), + ""); } } @@ -380,7 +384,7 @@ bool EventRouter::HasEventListenerImpl(const ListenerMap& listener_map, } void EventRouter::BroadcastEvent(scoped_ptr<Event> event) { - DispatchEventImpl(std::string(), linked_ptr<Event>(event.release())); + DispatchEventImpl("", linked_ptr<Event>(event.release())); } void EventRouter::DispatchEventToExtension(const std::string& extension_id, diff --git a/chrome/browser/extensions/event_router_forwarder.cc b/chrome/browser/extensions/event_router_forwarder.cc index f094608..15b7e97 100644 --- a/chrome/browser/extensions/event_router_forwarder.cc +++ b/chrome/browser/extensions/event_router_forwarder.cc @@ -26,7 +26,7 @@ void EventRouterForwarder::BroadcastEventToRenderers( const std::string& event_name, scoped_ptr<base::ListValue> event_args, const GURL& event_url) { - HandleEvent(std::string(), event_name, event_args.Pass(), 0, true, event_url); + HandleEvent("", event_name, event_args.Pass(), 0, true, event_url); } void EventRouterForwarder::DispatchEventToRenderers( @@ -37,12 +37,8 @@ void EventRouterForwarder::DispatchEventToRenderers( const GURL& event_url) { if (!profile) return; - HandleEvent(std::string(), - event_name, - event_args.Pass(), - profile, - use_profile_to_restrict_events, - event_url); + HandleEvent("", event_name, event_args.Pass(), profile, + use_profile_to_restrict_events, event_url); } void EventRouterForwarder::BroadcastEventToExtension( diff --git a/chrome/browser/extensions/extension_action_unittest.cc b/chrome/browser/extensions/extension_action_unittest.cc index 6c2ca63..9a5c3ff 100644 --- a/chrome/browser/extensions/extension_action_unittest.cc +++ b/chrome/browser/extensions/extension_action_unittest.cc @@ -15,7 +15,7 @@ using extensions::ActionInfo; TEST(ExtensionActionTest, Title) { ActionInfo action_info; action_info.default_title = "Initial Title"; - ExtensionAction action(std::string(), ActionInfo::TYPE_PAGE, action_info); + ExtensionAction action("", ActionInfo::TYPE_PAGE, action_info); ASSERT_EQ("Initial Title", action.GetTitle(1)); action.SetTitle(ExtensionAction::kDefaultTabId, "foo"); @@ -31,7 +31,8 @@ TEST(ExtensionActionTest, Title) { } TEST(ExtensionActionTest, Visibility) { - ExtensionAction action(std::string(), ActionInfo::TYPE_PAGE, ActionInfo()); + ExtensionAction action("", ActionInfo::TYPE_PAGE, + ActionInfo()); ASSERT_FALSE(action.GetIsVisible(1)); action.SetAppearance(ExtensionAction::kDefaultTabId, ExtensionAction::ACTIVE); @@ -52,8 +53,8 @@ TEST(ExtensionActionTest, Visibility) { ASSERT_FALSE(action.GetIsVisible(1)); ASSERT_FALSE(action.GetIsVisible(100)); - ExtensionAction browser_action( - std::string(), ActionInfo::TYPE_BROWSER, ActionInfo()); + ExtensionAction browser_action("", ActionInfo::TYPE_BROWSER, + ActionInfo()); ASSERT_TRUE(browser_action.GetIsVisible(1)); } @@ -61,8 +62,8 @@ TEST(ExtensionActionTest, ScriptBadgeAnimation) { // Supports the icon animation. MessageLoop message_loop; - ExtensionAction script_badge( - std::string(), ActionInfo::TYPE_SCRIPT_BADGE, ActionInfo()); + ExtensionAction script_badge("", ActionInfo::TYPE_SCRIPT_BADGE, + ActionInfo()); EXPECT_FALSE(script_badge.GetIconAnimation(ExtensionAction::kDefaultTabId)); script_badge.SetAppearance(ExtensionAction::kDefaultTabId, ExtensionAction::ACTIVE); @@ -85,8 +86,8 @@ TEST(ExtensionActionTest, GetAttention) { // Supports the icon animation. scoped_ptr<MessageLoop> message_loop(new MessageLoop); - ExtensionAction script_badge( - std::string(), ActionInfo::TYPE_SCRIPT_BADGE, ActionInfo()); + ExtensionAction script_badge("", ActionInfo::TYPE_SCRIPT_BADGE, + ActionInfo()); EXPECT_FALSE(script_badge.GetIsVisible(1)); EXPECT_FALSE(script_badge.GetIconAnimation(1)); script_badge.SetAppearance(1, ExtensionAction::WANTS_ATTENTION); @@ -106,8 +107,8 @@ TEST(ExtensionActionTest, GetAttention) { TEST(ExtensionActionTest, Icon) { ActionInfo action_info; action_info.default_icon.Add(16, "icon16.png"); - ExtensionAction page_action( - std::string(), ActionInfo::TYPE_PAGE, action_info); + ExtensionAction page_action("", ActionInfo::TYPE_PAGE, + action_info); ASSERT_TRUE(page_action.default_icon()); EXPECT_EQ("icon16.png", page_action.default_icon()->Get( @@ -118,7 +119,8 @@ TEST(ExtensionActionTest, Icon) { } TEST(ExtensionActionTest, Badge) { - ExtensionAction action(std::string(), ActionInfo::TYPE_PAGE, ActionInfo()); + ExtensionAction action("", ActionInfo::TYPE_PAGE, + ActionInfo()); ASSERT_EQ("", action.GetBadgeText(1)); action.SetBadgeText(ExtensionAction::kDefaultTabId, "foo"); ASSERT_EQ("foo", action.GetBadgeText(1)); @@ -133,7 +135,8 @@ TEST(ExtensionActionTest, Badge) { } TEST(ExtensionActionTest, BadgeTextColor) { - ExtensionAction action(std::string(), ActionInfo::TYPE_PAGE, ActionInfo()); + ExtensionAction action("", ActionInfo::TYPE_PAGE, + ActionInfo()); ASSERT_EQ(0x00000000u, action.GetBadgeTextColor(1)); action.SetBadgeTextColor(ExtensionAction::kDefaultTabId, 0xFFFF0000u); ASSERT_EQ(0xFFFF0000u, action.GetBadgeTextColor(1)); @@ -148,7 +151,8 @@ TEST(ExtensionActionTest, BadgeTextColor) { } TEST(ExtensionActionTest, BadgeBackgroundColor) { - ExtensionAction action(std::string(), ActionInfo::TYPE_PAGE, ActionInfo()); + ExtensionAction action("", ActionInfo::TYPE_PAGE, + ActionInfo()); ASSERT_EQ(0x00000000u, action.GetBadgeBackgroundColor(1)); action.SetBadgeBackgroundColor(ExtensionAction::kDefaultTabId, 0xFFFF0000u); @@ -172,7 +176,7 @@ TEST(ExtensionActionTest, PopupUrl) { ActionInfo action_info; action_info.default_popup_url = url_foo; - ExtensionAction action(std::string(), ActionInfo::TYPE_PAGE, action_info); + ExtensionAction action("", ActionInfo::TYPE_PAGE, action_info); ASSERT_EQ(url_foo, action.GetPopupUrl(1)); ASSERT_EQ(url_foo, action.GetPopupUrl(100)); diff --git a/chrome/browser/extensions/extension_apitest.cc b/chrome/browser/extensions/extension_apitest.cc index 8d072ae..e3534e4 100644 --- a/chrome/browser/extensions/extension_apitest.cc +++ b/chrome/browser/extensions/extension_apitest.cc @@ -80,7 +80,7 @@ void ExtensionApiTest::ResultCatcher::Observe( case chrome::NOTIFICATION_EXTENSION_TEST_PASSED: VLOG(1) << "Got EXTENSION_TEST_PASSED notification."; results_.push_back(true); - messages_.push_back(std::string()); + messages_.push_back(""); if (waiting_) MessageLoopForUI::current()->Quit(); break; @@ -114,45 +114,41 @@ void ExtensionApiTest::TearDownInProcessBrowserTestFixture() { } bool ExtensionApiTest::RunExtensionTest(const char* extension_name) { - return RunExtensionTestImpl( - extension_name, std::string(), kFlagEnableFileAccess); + return RunExtensionTestImpl(extension_name, "", kFlagEnableFileAccess); } bool ExtensionApiTest::RunExtensionTestIncognito(const char* extension_name) { - return RunExtensionTestImpl(extension_name, - std::string(), - kFlagEnableIncognito | kFlagEnableFileAccess); + return RunExtensionTestImpl( + extension_name, "", kFlagEnableIncognito | kFlagEnableFileAccess); } bool ExtensionApiTest::RunExtensionTestIgnoreManifestWarnings( const char* extension_name) { return RunExtensionTestImpl( - extension_name, std::string(), kFlagIgnoreManifestWarnings); + extension_name, "", kFlagIgnoreManifestWarnings); } bool ExtensionApiTest::RunExtensionTestAllowOldManifestVersion( const char* extension_name) { return RunExtensionTestImpl( extension_name, - std::string(), + "", kFlagEnableFileAccess | kFlagAllowOldManifestVersions); } bool ExtensionApiTest::RunComponentExtensionTest(const char* extension_name) { - return RunExtensionTestImpl(extension_name, - std::string(), - kFlagEnableFileAccess | kFlagLoadAsComponent); + return RunExtensionTestImpl( + extension_name, "", kFlagEnableFileAccess | kFlagLoadAsComponent); } bool ExtensionApiTest::RunExtensionTestNoFileAccess( const char* extension_name) { - return RunExtensionTestImpl(extension_name, std::string(), kFlagNone); + return RunExtensionTestImpl(extension_name, "", kFlagNone); } bool ExtensionApiTest::RunExtensionTestIncognitoNoFileAccess( const char* extension_name) { - return RunExtensionTestImpl( - extension_name, std::string(), kFlagEnableIncognito); + return RunExtensionTestImpl(extension_name, "", kFlagEnableIncognito); } bool ExtensionApiTest::RunExtensionSubtest(const char* extension_name, @@ -178,8 +174,7 @@ bool ExtensionApiTest::RunPageTest(const std::string& page_url, } bool ExtensionApiTest::RunPlatformAppTest(const char* extension_name) { - return RunExtensionTestImpl( - extension_name, std::string(), kFlagLaunchPlatformApp); + return RunExtensionTestImpl(extension_name, "", kFlagLaunchPlatformApp); } // Load |extension_name| extension and/or |page_url| and wait for diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc index cfad60e..b051df9 100644 --- a/chrome/browser/extensions/extension_browsertest.cc +++ b/chrome/browser/extensions/extension_browsertest.cc @@ -337,13 +337,9 @@ class MockAutoConfirmExtensionInstallPrompt : public ExtensionInstallPrompt { const Extension* ExtensionBrowserTest::InstallExtensionFromWebstore( const base::FilePath& path, int expected_change) { - return InstallOrUpdateExtension(std::string(), - path, - INSTALL_UI_TYPE_NONE, - expected_change, - Manifest::INTERNAL, - browser(), - true); + return InstallOrUpdateExtension("", path, INSTALL_UI_TYPE_NONE, + expected_change, Manifest::INTERNAL, + browser(), true); } const Extension* ExtensionBrowserTest::InstallOrUpdateExtension( diff --git a/chrome/browser/extensions/extension_browsertest.h b/chrome/browser/extensions/extension_browsertest.h index 9d79f56..9d1203c 100644 --- a/chrome/browser/extensions/extension_browsertest.h +++ b/chrome/browser/extensions/extension_browsertest.h @@ -112,8 +112,8 @@ class ExtensionBrowserTest : virtual public InProcessBrowserTest, // you expect a failed upgrade. const extensions::Extension* InstallExtension(const base::FilePath& path, int expected_change) { - return InstallOrUpdateExtension( - std::string(), path, INSTALL_UI_TYPE_NONE, expected_change); + return InstallOrUpdateExtension("", path, INSTALL_UI_TYPE_NONE, + expected_change); } // Same as above, but an install source other than Manifest::INTERNAL can be @@ -122,11 +122,8 @@ class ExtensionBrowserTest : virtual public InProcessBrowserTest, const base::FilePath& path, int expected_change, extensions::Manifest::Location install_source) { - return InstallOrUpdateExtension(std::string(), - path, - INSTALL_UI_TYPE_NONE, - expected_change, - install_source); + return InstallOrUpdateExtension("", path, INSTALL_UI_TYPE_NONE, + expected_change, install_source); } // Installs extension as if it came from the Chrome Webstore. @@ -147,27 +144,22 @@ class ExtensionBrowserTest : virtual public InProcessBrowserTest, const extensions::Extension* InstallExtensionWithUI( const base::FilePath& path, int expected_change) { - return InstallOrUpdateExtension( - std::string(), path, INSTALL_UI_TYPE_NORMAL, expected_change); + return InstallOrUpdateExtension("", path, INSTALL_UI_TYPE_NORMAL, + expected_change); } const extensions::Extension* InstallExtensionWithUIAutoConfirm( const base::FilePath& path, int expected_change, Browser* browser) { - return InstallOrUpdateExtension(std::string(), - path, - INSTALL_UI_TYPE_AUTO_CONFIRM, - expected_change, - browser, - false); + return InstallOrUpdateExtension("", path, INSTALL_UI_TYPE_AUTO_CONFIRM, + expected_change, browser, false); } // Begins install process but simulates a user cancel. const extensions::Extension* StartInstallButCancel( const base::FilePath& path) { - return InstallOrUpdateExtension( - std::string(), path, INSTALL_UI_TYPE_CANCEL, 0); + return InstallOrUpdateExtension("", path, INSTALL_UI_TYPE_CANCEL, 0); } void ReloadExtension(const std::string& extension_id); diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc index c15ba6f..00a1f39 100644 --- a/chrome/browser/extensions/extension_function_dispatcher.cc +++ b/chrome/browser/extensions/extension_function_dispatcher.cc @@ -63,7 +63,7 @@ void LogSuccess(const Extension* extension, } else { extensions::ActivityLog* activity_log = extensions::ActivityLog::GetInstance(profile); - activity_log->LogAPIAction(extension, api_name, args.get(), std::string()); + activity_log->LogAPIAction(extension, api_name, args.get(), ""); } } @@ -86,8 +86,11 @@ void LogFailure(const Extension* extension, } else { extensions::ActivityLog* activity_log = extensions::ActivityLog::GetInstance(profile); - activity_log->LogBlockedAction( - extension, api_name, args.get(), reason, std::string()); + activity_log->LogBlockedAction(extension, + api_name, + args.get(), + reason, + ""); } } diff --git a/chrome/browser/extensions/extension_pref_value_map_unittest.cc b/chrome/browser/extensions/extension_pref_value_map_unittest.cc index 7f1b2d5..bfa573f 100644 --- a/chrome/browser/extensions/extension_pref_value_map_unittest.cc +++ b/chrome/browser/extensions/extension_pref_value_map_unittest.cc @@ -45,7 +45,7 @@ class ExtensionPrefValueMapTestBase : public BASECLASS { // Returns an empty string if the key is not set. std::string GetValue(const char * key, bool incognito) const { const Value *value = epvm_.GetEffectivePrefValue(key, incognito, NULL); - std::string string_value; + std::string string_value = ""; if (value) value->GetAsString(&string_value); return string_value; diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc index b24e0e7..0f1d743 100644 --- a/chrome/browser/extensions/extension_prefs.cc +++ b/chrome/browser/extensions/extension_prefs.cc @@ -1670,8 +1670,7 @@ void ExtensionPrefs::SetDelayedInstallInfo( if (extension->RequiresSortOrdinal()) { extension_dict->SetString( kPrefSuggestedPageOrdinal, - page_ordinal.IsValid() ? page_ordinal.ToInternalValue() - : std::string()); + page_ordinal.IsValid() ? page_ordinal.ToInternalValue() : ""); } UpdateExtensionPref(extension->id(), kDelayedInstallInfo, extension_dict); diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc index 09fc245..a4cb67f 100644 --- a/chrome/browser/extensions/extension_process_manager.cc +++ b/chrome/browser/extensions/extension_process_manager.cc @@ -63,7 +63,7 @@ std::string GetExtensionID(RenderViewHost* render_view_host) { // This works for both apps and extensions because the site has been // normalized to the extension URL for apps. if (!render_view_host->GetSiteInstance()) - return std::string(); + return ""; return render_view_host->GetSiteInstance()->GetSiteURL().host(); } diff --git a/chrome/browser/extensions/extension_protocols.cc b/chrome/browser/extensions/extension_protocols.cc index 503b2ad..049d813 100644 --- a/chrome/browser/extensions/extension_protocols.cc +++ b/chrome/browser/extensions/extension_protocols.cc @@ -320,8 +320,7 @@ bool AllowExtensionResourceLoad(net::URLRequest* request, // some extensions want to be able to do things like create their own // launchers. std::string resource_root_relative_path = - request->url().path().empty() ? std::string() - : request->url().path().substr(1); + request->url().path().empty() ? "" : request->url().path().substr(1); if (extension->is_hosted_app() && !extensions::IconsInfo::GetIcons(extension) .ContainsPath(resource_root_relative_path)) { diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index 368d048..a6068b5 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -1192,7 +1192,7 @@ TEST_F(ExtensionServiceTest, LoadAllExtensionsFromDirectorySuccess) { EXPECT_EQ(std::string(good1), loaded_[1]->id()); EXPECT_EQ(std::string("My extension 2"), loaded_[1]->name()); - EXPECT_EQ(std::string(), loaded_[1]->description()); + EXPECT_EQ(std::string(""), loaded_[1]->description()); EXPECT_EQ(loaded_[1]->GetResourceURL("background.html"), extensions::BackgroundInfo::GetBackgroundURL(loaded_[1])); EXPECT_EQ( @@ -1220,7 +1220,7 @@ TEST_F(ExtensionServiceTest, LoadAllExtensionsFromDirectorySuccess) { int index = expected_num_extensions - 1; EXPECT_EQ(std::string(good2), loaded_[index]->id()); EXPECT_EQ(std::string("My extension 3"), loaded_[index]->name()); - EXPECT_EQ(std::string(), loaded_[index]->description()); + EXPECT_EQ(std::string(""), loaded_[index]->description()); EXPECT_EQ( 0u, extensions::ContentScriptsInfo::GetContentScripts(loaded_[index]).size()); @@ -3313,8 +3313,8 @@ TEST_F(ExtensionServiceTest, ManagementPolicyProhibitsLoadFromPrefs) { // UNPACKED is for extensions loaded from a directory. We use it here, even // though we're testing loading from prefs, so that we don't need to provide // an extension key. - extensions::ExtensionInfo extension_info( - &manifest, std::string(), path, Manifest::UNPACKED); + extensions::ExtensionInfo extension_info(&manifest, "", path, + Manifest::UNPACKED); // Ensure we can load it with no management policy in place. management_policy_->UnregisterAllProviders(); diff --git a/chrome/browser/extensions/extension_test_message_listener.cc b/chrome/browser/extensions/extension_test_message_listener.cc index e892ba1..90aa01a 100644 --- a/chrome/browser/extensions/extension_test_message_listener.cc +++ b/chrome/browser/extensions/extension_test_message_listener.cc @@ -17,6 +17,7 @@ ExtensionTestMessageListener::ExtensionTestMessageListener( satisfied_(false), waiting_(false), will_reply_(will_reply), + failure_message_(""), failed_(false) { registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE, content::NotificationService::AllSources()); @@ -58,7 +59,7 @@ void ExtensionTestMessageListener::Observe( satisfied_ = true; registrar_.RemoveAll(); // Stop listening for more messages. if (!will_reply_) { - function_->Reply(std::string()); + function_->Reply(""); function_ = NULL; } if (waiting_) { diff --git a/chrome/browser/extensions/extensions_quota_service.cc b/chrome/browser/extensions/extensions_quota_service.cc index 6b267a5..c01b9e3 100644 --- a/chrome/browser/extensions/extensions_quota_service.cc +++ b/chrome/browser/extensions/extensions_quota_service.cc @@ -42,7 +42,7 @@ std::string ExtensionsQuotaService::Assess( DCHECK(CalledOnValidThread()); if (function->ShouldSkipQuotaLimiting()) - return std::string(); + return ""; // Lookup function list for extension. FunctionHeuristicsMap& functions = function_heuristics_[extension_id]; @@ -53,7 +53,7 @@ std::string ExtensionsQuotaService::Assess( function->GetQuotaLimitHeuristics(&heuristics); if (heuristics.empty()) - return std::string(); // No heuristic implies no limit. + return ""; // No heuristic implies no limit. ViolationErrorMap::iterator violation_error = violation_errors_.find(extension_id); @@ -71,7 +71,7 @@ std::string ExtensionsQuotaService::Assess( } if (!failed_heuristic) - return std::string(); + return ""; std::string error = failed_heuristic->GetError(); DCHECK_GT(error.length(), 0u); diff --git a/chrome/browser/extensions/external_policy_loader_unittest.cc b/chrome/browser/extensions/external_policy_loader_unittest.cc index 75bd788..5f8943c 100644 --- a/chrome/browser/extensions/external_policy_loader_unittest.cc +++ b/chrome/browser/extensions/external_policy_loader_unittest.cc @@ -139,8 +139,7 @@ TEST_F(ExternalPolicyLoaderTest, InvalidEntriesIgnored) { // Add invalid entries. forced_extensions.SetString("invalid", "http://www.example.com/crx"); - forced_extensions.SetString("dddddddddddddddddddddddddddddddd", - std::string()); + forced_extensions.SetString("dddddddddddddddddddddddddddddddd", ""); forced_extensions.SetString("invalid", "bad"); MockExternalPolicyProviderVisitor mv; diff --git a/chrome/browser/extensions/isolated_app_browsertest.cc b/chrome/browser/extensions/isolated_app_browsertest.cc index ec55a4c..b7717bb 100644 --- a/chrome/browser/extensions/isolated_app_browsertest.cc +++ b/chrome/browser/extensions/isolated_app_browsertest.cc @@ -328,7 +328,7 @@ IN_PROC_BROWSER_TEST_F(IsolatedAppTest, MAYBE_SubresourceCookieIsolation) { // The app under test acts on URLs whose host is "localhost", // so the URLs we navigate to must have host "localhost". - GURL root_url = test_server()->GetURL(std::string()); + GURL root_url = test_server()->GetURL(""); GURL base_url = test_server()->GetURL("files/extensions/isolated_apps/"); GURL::Replacements replace_host; std::string host_str("localhost"); // Must stay in scope with replace_host. diff --git a/chrome/browser/extensions/menu_manager.cc b/chrome/browser/extensions/menu_manager.cc index 4256c61..0335866 100644 --- a/chrome/browser/extensions/menu_manager.cc +++ b/chrome/browser/extensions/menu_manager.cc @@ -833,10 +833,14 @@ void MenuManager::RemoveAllIncognitoContextItems() { RemoveContextMenuItem(*remove_iter); } -MenuItem::Id::Id() : incognito(false), uid(0) {} +MenuItem::Id::Id() + : incognito(false), extension_id(""), uid(0), string_uid("") { +} MenuItem::Id::Id(bool incognito, const std::string& extension_id) - : incognito(incognito), extension_id(extension_id), uid(0) {} + : incognito(incognito), extension_id(extension_id), uid(0), + string_uid("") { +} MenuItem::Id::~Id() { } diff --git a/chrome/browser/extensions/pending_extension_info.cc b/chrome/browser/extensions/pending_extension_info.cc index a1e93d8..6fc0adc 100644 --- a/chrome/browser/extensions/pending_extension_info.cc +++ b/chrome/browser/extensions/pending_extension_info.cc @@ -25,7 +25,8 @@ PendingExtensionInfo::PendingExtensionInfo( install_source_(install_source) {} PendingExtensionInfo::PendingExtensionInfo() - : update_url_(), + : id_(""), + update_url_(), should_allow_install_(NULL), is_from_sync_(true), install_silently_(false), diff --git a/chrome/browser/extensions/platform_app_browsertest_util.cc b/chrome/browser/extensions/platform_app_browsertest_util.cc index 58c2548..62f8545 100644 --- a/chrome/browser/extensions/platform_app_browsertest_util.cc +++ b/chrome/browser/extensions/platform_app_browsertest_util.cc @@ -142,13 +142,13 @@ ShellWindow* PlatformAppBrowserTest::CreateShellWindow( const Extension* extension) { ShellWindow::CreateParams params; return ShellWindow::Create( - browser()->profile(), extension, GURL(std::string()), params); + browser()->profile(), extension, GURL(""), params); } ShellWindow* PlatformAppBrowserTest::CreateShellWindowFromParams( const Extension* extension, const ShellWindow::CreateParams& params) { return ShellWindow::Create( - browser()->profile(), extension, GURL(std::string()), params); + browser()->profile(), extension, GURL(""), params); } void PlatformAppBrowserTest::CloseShellWindow(ShellWindow* window) { diff --git a/chrome/browser/extensions/platform_app_launcher.cc b/chrome/browser/extensions/platform_app_launcher.cc index 46daa89..a883e66 100644 --- a/chrome/browser/extensions/platform_app_launcher.cc +++ b/chrome/browser/extensions/platform_app_launcher.cc @@ -107,7 +107,10 @@ class PlatformAppPathLauncher PlatformAppPathLauncher(Profile* profile, const Extension* extension, const base::FilePath& file_path) - : profile_(profile), extension_(extension), file_path_(file_path) {} + : profile_(profile), + extension_(extension), + file_path_(file_path), + handler_id_("") {} void Launch() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); diff --git a/chrome/browser/extensions/script_badge_controller_unittest.cc b/chrome/browser/extensions/script_badge_controller_unittest.cc index cb773f8..d2cf6bc 100644 --- a/chrome/browser/extensions/script_badge_controller_unittest.cc +++ b/chrome/browser/extensions/script_badge_controller_unittest.cc @@ -138,7 +138,7 @@ TEST_F(ScriptBadgeControllerTest, ExecutionMakesBadgeVisible) { web_contents(), id_map, web_contents()->GetController().GetActiveEntry()->GetPageID(), - GURL(std::string())); + GURL("")); EXPECT_THAT(script_badge_controller_->GetCurrentActions(), testing::ElementsAre(GetScriptBadge(*extension))); EXPECT_THAT(location_bar_updated.events, testing::Gt(0)); @@ -167,7 +167,7 @@ TEST_F(ScriptBadgeControllerTest, FragmentNavigation) { web_contents(), id_map, web_contents()->GetController().GetActiveEntry()->GetPageID(), - GURL(std::string())); + GURL("")); EXPECT_THAT(script_badge_controller_->GetCurrentActions(), testing::ElementsAre(GetScriptBadge(*extension))); diff --git a/chrome/browser/extensions/script_executor.cc b/chrome/browser/extensions/script_executor.cc index b35b776..c5ed09f 100644 --- a/chrome/browser/extensions/script_executor.cc +++ b/chrome/browser/extensions/script_executor.cc @@ -66,7 +66,7 @@ class Handler : public content::WebContentsObserver { virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE { base::ListValue val; - callback_.Run(kRendererDestroyed, -1, GURL(std::string()), val); + callback_.Run(kRendererDestroyed, -1, GURL(""), val); delete this; } diff --git a/chrome/browser/extensions/subscribe_page_action_browsertest.cc b/chrome/browser/extensions/subscribe_page_action_browsertest.cc index 02449a1..471ad5c 100644 --- a/chrome/browser/extensions/subscribe_page_action_browsertest.cc +++ b/chrome/browser/extensions/subscribe_page_action_browsertest.cc @@ -114,8 +114,10 @@ void NavigateToFeedAndValidate(net::TestServer* server, GetFeedUrl(server, url, true, extension_id)); WebContents* tab = browser->tab_strip_model()->GetActiveWebContents(); - ASSERT_TRUE(ValidatePageElement( - tab, std::string(), kScriptFeedTitle, expected_feed_title)); + ASSERT_TRUE(ValidatePageElement(tab, + "", + kScriptFeedTitle, + expected_feed_title)); ASSERT_TRUE(ValidatePageElement(tab, "//html/body/div/iframe[1]", kScriptAnchor, diff --git a/chrome/browser/extensions/tab_helper.cc b/chrome/browser/extensions/tab_helper.cc index cd420ad..cdcec02 100644 --- a/chrome/browser/extensions/tab_helper.cc +++ b/chrome/browser/extensions/tab_helper.cc @@ -413,7 +413,7 @@ void TabHelper::OnInlineInstallComplete(int install_id, const std::string& error) { if (success) { Send(new ExtensionMsg_InlineWebstoreInstallResponse( - return_route_id, install_id, true, std::string())); + return_route_id, install_id, true, "")); } else { Send(new ExtensionMsg_InlineWebstoreInstallResponse( return_route_id, install_id, false, error)); diff --git a/chrome/browser/extensions/updater/extension_downloader.cc b/chrome/browser/extensions/updater/extension_downloader.cc index f165732..0c04a89 100644 --- a/chrome/browser/extensions/updater/extension_downloader.cc +++ b/chrome/browser/extensions/updater/extension_downloader.cc @@ -153,7 +153,12 @@ UpdateDetails::UpdateDetails(const std::string& id, const Version& version) UpdateDetails::~UpdateDetails() {} -ExtensionDownloader::ExtensionFetch::ExtensionFetch() : url() {} + +ExtensionDownloader::ExtensionFetch::ExtensionFetch() + : id(""), + url(), + package_hash(""), + version("") {} ExtensionDownloader::ExtensionFetch::ExtensionFetch( const std::string& id, @@ -215,11 +220,7 @@ bool ExtensionDownloader::AddPendingExtension(const std::string& id, Version version("0.0.0.0"); DCHECK(version.IsValid()); - return AddExtensionData(id, - version, - Manifest::TYPE_UNKNOWN, - update_url, - std::string(), + return AddExtensionData(id, version, Manifest::TYPE_UNKNOWN, update_url, "", request_id); } @@ -248,10 +249,7 @@ void ExtensionDownloader::StartBlacklistUpdate( new ManifestFetchData(extension_urls::GetWebstoreUpdateUrl(), request_id)); DCHECK(blacklist_fetch->base_url().SchemeIsSecure()); - blacklist_fetch->AddExtension(kBlacklistAppID, - version, - &ping_data, - std::string(), + blacklist_fetch->AddExtension(kBlacklistAppID, version, &ping_data, "", kDefaultInstallSource); StartUpdateCheck(blacklist_fetch.Pass()); } diff --git a/chrome/browser/extensions/updater/extension_updater.cc b/chrome/browser/extensions/updater/extension_updater.cc index 130da8f..feadf5a 100644 --- a/chrome/browser/extensions/updater/extension_updater.cc +++ b/chrome/browser/extensions/updater/extension_updater.cc @@ -106,7 +106,10 @@ ExtensionUpdater::FetchedCRXFile::FetchedCRXFile( download_url(u), request_ids(request_ids) {} -ExtensionUpdater::FetchedCRXFile::FetchedCRXFile() : path(), download_url() {} +ExtensionUpdater::FetchedCRXFile::FetchedCRXFile() + : extension_id(""), + path(), + download_url() {} ExtensionUpdater::FetchedCRXFile::~FetchedCRXFile() {} diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc index 3481c0c..4921d9e 100644 --- a/chrome/browser/extensions/updater/extension_updater_unittest.cc +++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc @@ -432,7 +432,7 @@ static void ExtractParameters(const std::string& params, if (!key_val.empty()) { std::string key = key_val[0]; EXPECT_TRUE(result->find(key) == result->end()); - (*result)[key] = (key_val.size() == 2) ? key_val[1] : std::string(); + (*result)[key] = (key_val.size() == 2) ? key_val[1] : ""; } else { NOTREACHED(); } @@ -637,8 +637,7 @@ class ExtensionUpdaterTest : public testing::Test { // Make sure that an empty update URL data string does not cause a ap= // option to appear in the x= parameter. ManifestFetchData fetch_data(GURL("http://localhost/foo"), 0); - fetch_data.AddExtension( - id, version, &kNeverPingedData, std::string(), std::string()); + fetch_data.AddExtension(id, version, &kNeverPingedData, "", ""); std::map<std::string, std::string> params; VerifyQueryAndExtractParameters(fetch_data.full_url().query(), ¶ms); @@ -654,8 +653,7 @@ class ExtensionUpdaterTest : public testing::Test { // Make sure that an update URL data string causes an appropriate ap= // option to appear in the x= parameter. ManifestFetchData fetch_data(GURL("http://localhost/foo"), 0); - fetch_data.AddExtension( - id, version, &kNeverPingedData, "bar", std::string()); + fetch_data.AddExtension(id, version, &kNeverPingedData, "bar", ""); std::map<std::string, std::string> params; VerifyQueryAndExtractParameters(fetch_data.full_url().query(), ¶ms); EXPECT_EQ(id, params["id"]); @@ -670,8 +668,7 @@ class ExtensionUpdaterTest : public testing::Test { // Make sure that an update URL data string causes an appropriate ap= // option to appear in the x= parameter. ManifestFetchData fetch_data(GURL("http://localhost/foo"), 0); - fetch_data.AddExtension( - id, version, &kNeverPingedData, "a=1&b=2&c", std::string()); + fetch_data.AddExtension(id, version, &kNeverPingedData, "a=1&b=2&c", ""); std::map<std::string, std::string> params; VerifyQueryAndExtractParameters(fetch_data.full_url().query(), ¶ms); EXPECT_EQ(id, params["id"]); @@ -741,12 +738,14 @@ class ExtensionUpdaterTest : public testing::Test { // installed and available at v2.0). const std::string id1 = id_util::GenerateId("1"); const std::string id2 = id_util::GenerateId("2"); - fetch_data.AddExtension( - id1, "1.0.0.0", &kNeverPingedData, kEmptyUpdateUrlData, std::string()); - AddParseResult(id1, "1.1", "http://localhost/e1_1.1.crx", &updates); - fetch_data.AddExtension( - id2, "2.0.0.0", &kNeverPingedData, kEmptyUpdateUrlData, std::string()); - AddParseResult(id2, "2.0.0.0", "http://localhost/e2_2.0.crx", &updates); + fetch_data.AddExtension(id1, "1.0.0.0", + &kNeverPingedData, kEmptyUpdateUrlData, ""); + AddParseResult(id1, "1.1", + "http://localhost/e1_1.1.crx", &updates); + fetch_data.AddExtension(id2, "2.0.0.0", + &kNeverPingedData, kEmptyUpdateUrlData, ""); + AddParseResult(id2, "2.0.0.0", + "http://localhost/e2_2.0.crx", &updates); EXPECT_CALL(delegate, IsExtensionPending(_)).WillRepeatedly(Return(false)); EXPECT_CALL(delegate, GetExtensionExistingVersion(id1, _)) @@ -783,11 +782,8 @@ class ExtensionUpdaterTest : public testing::Test { std::list<std::string>::const_iterator it; for (it = ids_for_update_check.begin(); it != ids_for_update_check.end(); ++it) { - fetch_data.AddExtension(*it, - "1.0.0.0", - &kNeverPingedData, - kEmptyUpdateUrlData, - std::string()); + fetch_data.AddExtension(*it, "1.0.0.0", + &kNeverPingedData, kEmptyUpdateUrlData, ""); AddParseResult(*it, "1.1", "http://localhost/e1_1.1.crx", &updates); } @@ -820,14 +816,10 @@ class ExtensionUpdaterTest : public testing::Test { scoped_ptr<ManifestFetchData> fetch3(new ManifestFetchData(kUpdateUrl, 0)); scoped_ptr<ManifestFetchData> fetch4(new ManifestFetchData(kUpdateUrl, 0)); ManifestFetchData::PingData zeroDays(0, 0, true); - fetch1->AddExtension( - "1111", "1.0", &zeroDays, kEmptyUpdateUrlData, std::string()); - fetch2->AddExtension( - "2222", "2.0", &zeroDays, kEmptyUpdateUrlData, std::string()); - fetch3->AddExtension( - "3333", "3.0", &zeroDays, kEmptyUpdateUrlData, std::string()); - fetch4->AddExtension( - "4444", "4.0", &zeroDays, kEmptyUpdateUrlData, std::string()); + fetch1->AddExtension("1111", "1.0", &zeroDays, kEmptyUpdateUrlData, ""); + fetch2->AddExtension("2222", "2.0", &zeroDays, kEmptyUpdateUrlData, ""); + fetch3->AddExtension("3333", "3.0", &zeroDays, kEmptyUpdateUrlData, ""); + fetch4->AddExtension("4444", "4.0", &zeroDays, kEmptyUpdateUrlData, ""); // This will start the first fetcher and queue the others. The next in queue // is started as each fetcher receives its response. @@ -935,8 +927,7 @@ class ExtensionUpdaterTest : public testing::Test { scoped_ptr<ManifestFetchData> fetch(new ManifestFetchData(kUpdateUrl, 0)); ManifestFetchData::PingData zeroDays(0, 0, true); - fetch->AddExtension( - "1111", "1.0", &zeroDays, kEmptyUpdateUrlData, std::string()); + fetch->AddExtension("1111", "1.0", &zeroDays, kEmptyUpdateUrlData, ""); // This will start the first fetcher. downloader.StartUpdateCheck(fetch.Pass()); @@ -963,8 +954,7 @@ class ExtensionUpdaterTest : public testing::Test { // For response codes that are not in the 5xx range ExtensionDownloader // should not retry. fetch.reset(new ManifestFetchData(kUpdateUrl, 0)); - fetch->AddExtension( - "1111", "1.0", &zeroDays, kEmptyUpdateUrlData, std::string()); + fetch->AddExtension("1111", "1.0", &zeroDays, kEmptyUpdateUrlData, ""); // This will start the first fetcher. downloader.StartUpdateCheck(fetch.Pass()); @@ -1016,7 +1006,7 @@ class ExtensionUpdaterTest : public testing::Test { GURL test_url("http://localhost/extension.crx"); std::string id = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; - std::string hash; + std::string hash = ""; Version version("0.0.1"); std::set<int> requests; requests.insert(0); @@ -1152,8 +1142,8 @@ class ExtensionUpdaterTest : public testing::Test { std::string id1 = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; std::string id2 = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"; - std::string hash1; - std::string hash2; + std::string hash1 = ""; + std::string hash2 = ""; std::string version1 = "0.1"; std::string version2 = "0.1"; @@ -1367,7 +1357,7 @@ class ExtensionUpdaterTest : public testing::Test { fetcher->set_url(fetched_urls[0]); fetcher->set_status(net::URLRequestStatus()); fetcher->set_response_code(500); - fetcher->SetResponseString(std::string()); + fetcher->SetResponseString(""); fetcher->delegate()->OnURLFetchComplete(fetcher); fetcher = factory.GetFetcherByID(ExtensionDownloader::kManifestFetcherId); @@ -1452,11 +1442,8 @@ class ExtensionUpdaterTest : public testing::Test { ManifestFetchData fetch_data(update_url, 0); const Extension* extension = tmp[0]; - fetch_data.AddExtension(extension->id(), - extension->VersionString(), - &kNeverPingedData, - kEmptyUpdateUrlData, - std::string()); + fetch_data.AddExtension(extension->id(), extension->VersionString(), + &kNeverPingedData, kEmptyUpdateUrlData, ""); UpdateManifest::Results results; results.daystart_elapsed_seconds = 750; @@ -1660,7 +1647,7 @@ TEST_F(ExtensionUpdaterTest, TestManifestFetchesBuilderAddExtension) { EXPECT_EQ(1u, ManifestFetchersCount(downloader.get())); // Extensions with empty IDs should be rejected. - EXPECT_FALSE(downloader->AddPendingExtension(std::string(), GURL(), 0)); + EXPECT_FALSE(downloader->AddPendingExtension("", GURL(), 0)); downloader->StartAllPending(); EXPECT_EQ(1u, ManifestFetchersCount(downloader.get())); diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc index 09b7f8e..81db7ed 100644 --- a/chrome/browser/extensions/webstore_installer.cc +++ b/chrome/browser/extensions/webstore_installer.cc @@ -125,8 +125,7 @@ void GetDownloadFilePath( base::FilePath file = directory.AppendASCII(id + "_" + random_number + ".crx"); - int uniquifier = - file_util::GetUniquePathNumber(file, base::FilePath::StringType()); + int uniquifier = file_util::GetUniquePathNumber(file, FILE_PATH_LITERAL("")); if (uniquifier > 0) { file = file.InsertBeforeExtensionASCII( base::StringPrintf(" (%d)", uniquifier)); diff --git a/chrome/browser/extensions/webstore_standalone_installer.cc b/chrome/browser/extensions/webstore_standalone_installer.cc index 7df550f..cadce50 100644 --- a/chrome/browser/extensions/webstore_standalone_installer.cc +++ b/chrome/browser/extensions/webstore_standalone_installer.cc @@ -80,7 +80,7 @@ void WebstoreStandaloneInstaller::OnWebstoreRequestFailure() { void WebstoreStandaloneInstaller::OnWebstoreResponseParseSuccess( DictionaryValue* webstore_data) { if (!CheckRequestorAlive()) { - CompleteInstall(std::string()); + CompleteInstall(""); return; } @@ -141,13 +141,13 @@ void WebstoreStandaloneInstaller::OnWebstoreResponseParseSuccess( // Assume ownership of webstore_data. webstore_data_.reset(webstore_data); - scoped_refptr<WebstoreInstallHelper> helper = - new WebstoreInstallHelper(this, - id_, - manifest, - std::string(), // We don't have any icon data. - icon_url, - profile_->GetRequestContext()); + scoped_refptr<WebstoreInstallHelper> helper = new WebstoreInstallHelper( + this, + id_, + manifest, + "", // We don't have any icon data. + icon_url, + profile_->GetRequestContext()); // The helper will call us back via OnWebstoreParseSucces or // OnWebstoreParseFailure. helper->Start(); @@ -165,7 +165,7 @@ void WebstoreStandaloneInstaller::OnWebstoreParseSuccess( CHECK_EQ(id_, id); if (!CheckRequestorAlive()) { - CompleteInstall(std::string()); + CompleteInstall(""); return; } @@ -190,7 +190,7 @@ void WebstoreStandaloneInstaller::OnWebstoreParseFailure( void WebstoreStandaloneInstaller::InstallUIProceed() { if (!CheckRequestorAlive()) { - CompleteInstall(std::string()); + CompleteInstall(""); return; } @@ -219,7 +219,7 @@ void WebstoreStandaloneInstaller::InstallUIAbort(bool user_initiated) { void WebstoreStandaloneInstaller::OnExtensionInstallSuccess( const std::string& id) { CHECK_EQ(id_, id); - CompleteInstall(std::string()); + CompleteInstall(""); } void WebstoreStandaloneInstaller::OnExtensionInstallFailure( diff --git a/chrome/browser/feedback/feedback_util.cc b/chrome/browser/feedback/feedback_util.cc index f892a87..7133c60 100644 --- a/chrome/browser/feedback/feedback_util.cc +++ b/chrome/browser/feedback/feedback_util.cc @@ -283,7 +283,7 @@ void FeedbackUtil::SendReport(scoped_refptr<FeedbackData> data) { // CHROMEOS_RELEASE_VERSION from /etc/lsb-release #if !defined(OS_CHROMEOS) // Add OS version (eg, for WinXP SP2: "5.1.2600 Service Pack 2"). - std::string os_version; + std::string os_version = ""; SetOSVersion(&os_version); AddFeedbackData(&feedback_data, std::string(kOsVersionTag), os_version); #endif diff --git a/chrome/browser/file_select_helper.cc b/chrome/browser/file_select_helper.cc index 48cf490..15e4a05 100644 --- a/chrome/browser/file_select_helper.cc +++ b/chrome/browser/file_select_helper.cc @@ -423,10 +423,9 @@ void FileSelectHelper::RunFileChooserOnUIThread( params.title, default_file_name, select_file_types_.get(), - select_file_types_.get() && !select_file_types_->extensions.empty() - ? 1 - : 0, // 1-based index of default extension to show. - base::FilePath::StringType(), + select_file_types_.get() && !select_file_types_->extensions.empty() ? + 1 : 0, // 1-based index of default extension to show. + FILE_PATH_LITERAL(""), owning_window, #if defined(OS_ANDROID) &accept_types); diff --git a/chrome/browser/google/google_util.cc b/chrome/browser/google/google_util.cc index 50900bd..d66a585 100644 --- a/chrome/browser/google/google_util.cc +++ b/chrome/browser/google/google_util.cc @@ -32,7 +32,7 @@ #endif #ifndef LINKDOCTOR_SERVER_REQUEST_URL -#define LINKDOCTOR_SERVER_REQUEST_URL std::string() +#define LINKDOCTOR_SERVER_REQUEST_URL "" #endif namespace { diff --git a/chrome/browser/google/google_util_unittest.cc b/chrome/browser/google/google_util_unittest.cc index 75b7067..cf4c610 100644 --- a/chrome/browser/google/google_util_unittest.cc +++ b/chrome/browser/google/google_util_unittest.cc @@ -53,7 +53,7 @@ TEST(GoogleUtilTest, GoodHomePagesSecure) { } TEST(GoogleUtilTest, BadHomePages) { - EXPECT_FALSE(IsGoogleHomePageUrl(std::string())); + EXPECT_FALSE(IsGoogleHomePageUrl("")); // If specified, only the "www" subdomain is OK. EXPECT_FALSE(IsGoogleHomePageUrl("http://maps.google.com")); @@ -237,7 +237,7 @@ TEST(GoogleUtilTest, BadSearches) { "http://www.google.com/search/nogood?q=something")); EXPECT_FALSE(IsGoogleSearchUrl( "http://www.google.com/webhp/nogood#q=something")); - EXPECT_FALSE(IsGoogleSearchUrl(std::string())); + EXPECT_FALSE(IsGoogleSearchUrl("")); // Case sensitive paths. EXPECT_FALSE(IsGoogleSearchUrl( diff --git a/chrome/browser/google_apis/base_operations.cc b/chrome/browser/google_apis/base_operations.cc index 6692a8a..c6f425c 100644 --- a/chrome/browser/google_apis/base_operations.cc +++ b/chrome/browser/google_apis/base_operations.cc @@ -186,7 +186,7 @@ void UrlFetchOperationBase::Start(const std::string& access_token, request_type == URLFetcher::PATCH) { // Set empty upload content-type and upload content, so that // the request will have no "Content-type: " header and no content. - url_fetcher_->SetUploadData(std::string(), std::string()); + url_fetcher_->SetUploadData("", ""); } } diff --git a/chrome/browser/google_apis/base_operations_unittest.cc b/chrome/browser/google_apis/base_operations_unittest.cc index 047e5c2..2f7e01a 100644 --- a/chrome/browser/google_apis/base_operations_unittest.cc +++ b/chrome/browser/google_apis/base_operations_unittest.cc @@ -66,9 +66,9 @@ class BaseOperationsTest : public testing::Test { virtual void SetUp() OVERRIDE { profile_.reset(new TestingProfile); runner_.reset(new OperationRunner(profile_.get(), - NULL /* url_request_context_getter */, - std::vector<std::string>() /* scopes */, - std::string() /* custom user agent */)); + NULL /* url_request_context_getter */, + std::vector<std::string>() /* scopes */, + "" /* custom user agent */)); runner_->Initialize(); LOG(ERROR) << "Initialized."; } diff --git a/chrome/browser/google_apis/drive_api_operations.cc b/chrome/browser/google_apis/drive_api_operations.cc index 1206743..7bab455 100644 --- a/chrome/browser/google_apis/drive_api_operations.cc +++ b/chrome/browser/google_apis/drive_api_operations.cc @@ -200,7 +200,7 @@ GURL CreateDirectoryOperation::GetURL() const { if (parent_resource_id_.empty() || directory_name_.empty()) { return GURL(); } - return url_generator_.GetFilelistUrl(GURL(), std::string()); + return url_generator_.GetFilelistUrl(GURL(), ""); } net::URLFetcher::RequestType CreateDirectoryOperation::GetRequestType() const { diff --git a/chrome/browser/google_apis/drive_api_operations_unittest.cc b/chrome/browser/google_apis/drive_api_operations_unittest.cc index b6a0f61..36c2c89 100644 --- a/chrome/browser/google_apis/drive_api_operations_unittest.cc +++ b/chrome/browser/google_apis/drive_api_operations_unittest.cc @@ -867,7 +867,7 @@ TEST_F(DriveApiOperationsTest, UploadExistingFileOperation) { kTestContentType, kTestContent.size(), "resource_id", // The resource id of the file to be overwritten. - std::string(), // No etag. + "", // No etag. CreateComposedCallback( base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error, &upload_url))); diff --git a/chrome/browser/google_apis/drive_api_url_generator_unittest.cc b/chrome/browser/google_apis/drive_api_url_generator_unittest.cc index bcb6c6d..818fb2d 100644 --- a/chrome/browser/google_apis/drive_api_url_generator_unittest.cc +++ b/chrome/browser/google_apis/drive_api_url_generator_unittest.cc @@ -69,7 +69,7 @@ TEST_F(DriveApiUrlGeneratorTest, GetFilelistUrl) { // Use default URL, if |override_url| is empty. // Do not add q parameter if |search_string| is empty. EXPECT_EQ("https://www.googleapis.com/drive/v2/files", - url_generator_.GetFilelistUrl(GURL(), std::string()).spec()); + url_generator_.GetFilelistUrl(GURL(), "").spec()); // Set q parameter if non-empty |search_string| is given. EXPECT_EQ("https://www.googleapis.com/drive/v2/files?q=query", @@ -77,10 +77,9 @@ TEST_F(DriveApiUrlGeneratorTest, GetFilelistUrl) { // Use the |override_url| for the base URL if given. // The behavior for the |search_string| should be as same as above cases. - EXPECT_EQ( - "https://localhost/drive/v2/files", - url_generator_.GetFilelistUrl(GURL("https://localhost/drive/v2/files"), - std::string()).spec()); + EXPECT_EQ("https://localhost/drive/v2/files", + url_generator_.GetFilelistUrl( + GURL("https://localhost/drive/v2/files"), "").spec()); EXPECT_EQ("https://localhost/drive/v2/files?q=query", url_generator_.GetFilelistUrl( GURL("https://localhost/drive/v2/files"), "query").spec()); diff --git a/chrome/browser/google_apis/drive_uploader_unittest.cc b/chrome/browser/google_apis/drive_uploader_unittest.cc index f522a87..5f3bb62 100644 --- a/chrome/browser/google_apis/drive_uploader_unittest.cc +++ b/chrome/browser/google_apis/drive_uploader_unittest.cc @@ -298,7 +298,7 @@ TEST_F(DriveUploaderTest, UploadExisting0KB) { base::FilePath::FromUTF8Unsafe(kTestDrivePath), local_path, kTestMimeType, - std::string(), // etag + "", // etag test_util::CreateCopyResultCallback( &error, &drive_path, &file_path, &resource_entry)); test_util::RunBlockingPoolTask(); @@ -330,7 +330,7 @@ TEST_F(DriveUploaderTest, UploadExisting512KB) { base::FilePath::FromUTF8Unsafe(kTestDrivePath), local_path, kTestMimeType, - std::string(), // etag + "", // etag test_util::CreateCopyResultCallback( &error, &drive_path, &file_path, &resource_entry)); test_util::RunBlockingPoolTask(); @@ -363,7 +363,7 @@ TEST_F(DriveUploaderTest, UploadExisting1234KB) { base::FilePath::FromUTF8Unsafe(kTestDrivePath), local_path, kTestMimeType, - std::string(), // etag + "", // etag test_util::CreateCopyResultCallback( &error, &drive_path, &file_path, &resource_entry)); test_util::RunBlockingPoolTask(); @@ -429,7 +429,7 @@ TEST_F(DriveUploaderTest, InitiateUploadFail) { base::FilePath::FromUTF8Unsafe(kTestDrivePath), local_path, kTestMimeType, - std::string(), // etag + "", // etag test_util::CreateCopyResultCallback( &error, &drive_path, &file_path, &resource_entry)); test_util::RunBlockingPoolTask(); @@ -508,7 +508,7 @@ TEST_F(DriveUploaderTest, ResumeUploadFail) { base::FilePath::FromUTF8Unsafe(kTestDrivePath), local_path, kTestMimeType, - std::string(), // etag + "", // etag test_util::CreateCopyResultCallback( &error, &drive_path, &file_path, &resource_entry)); test_util::RunBlockingPoolTask(); @@ -528,7 +528,7 @@ TEST_F(DriveUploaderTest, NonExistingSourceFile) { base::FilePath::FromUTF8Unsafe(kTestDrivePath), temp_dir_.path().AppendASCII("_this_path_should_not_exist_"), kTestMimeType, - std::string(), // etag + "", // etag test_util::CreateCopyResultCallback( &error, &drive_path, &file_path, &resource_entry)); test_util::RunBlockingPoolTask(); diff --git a/chrome/browser/google_apis/fake_drive_service.cc b/chrome/browser/google_apis/fake_drive_service.cc index d5cb4ad..d91aced 100644 --- a/chrome/browser/google_apis/fake_drive_service.cc +++ b/chrome/browser/google_apis/fake_drive_service.cc @@ -340,10 +340,10 @@ void FakeDriveService::GetAllResourceList( DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!callback.is_null()); - GetResourceList(GURL(), // no next feed - 0, // start changestamp - std::string(), // empty search query - std::string(), // no directory resource id, + GetResourceList(GURL(), // no next feed + 0, // start changestamp + "", // empty search query + "", // no directory resource id, callback); } @@ -354,9 +354,9 @@ void FakeDriveService::GetResourceListInDirectory( DCHECK(!directory_resource_id.empty()); DCHECK(!callback.is_null()); - GetResourceList(GURL(), // no next feed - 0, // start changestamp - std::string(), // empty search query + GetResourceList(GURL(), // no next feed + 0, // start changestamp + "", // empty search query directory_resource_id, callback); } @@ -367,10 +367,10 @@ void FakeDriveService::Search(const std::string& search_query, DCHECK(!search_query.empty()); DCHECK(!callback.is_null()); - GetResourceList(GURL(), // no next feed - 0, // start changestamp + GetResourceList(GURL(), // no next feed + 0, // start changestamp search_query, - std::string(), // no directory resource id, + "", // no directory resource id, callback); } @@ -395,10 +395,10 @@ void FakeDriveService::GetChangeList(int64 start_changestamp, DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!callback.is_null()); - GetResourceList(GURL(), // no next feed + GetResourceList(GURL(), // no next feed start_changestamp, - std::string(), // empty search query - std::string(), // no directory resource id, + "", // empty search query + "", // no directory resource id, callback); } diff --git a/chrome/browser/google_apis/fake_drive_service_unittest.cc b/chrome/browser/google_apis/fake_drive_service_unittest.cc index 2f94ba5..e89ed15 100644 --- a/chrome/browser/google_apis/fake_drive_service_unittest.cc +++ b/chrome/browser/google_apis/fake_drive_service_unittest.cc @@ -96,9 +96,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_All) { scoped_ptr<ResourceList> resource_list; fake_service_.GetResourceList( GURL(), - 0, // start_changestamp - std::string(), // search_query - std::string(), // directory_resource_id + 0, // start_changestamp + "", // search_query + "", // directory_resource_id test_util::CreateCopyResultCallback(&error, &resource_list)); message_loop_.RunUntilIdle(); @@ -117,9 +117,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_WithStartIndex) { scoped_ptr<ResourceList> resource_list; fake_service_.GetResourceList( GURL("http://dummyurl/?start-offset=2"), - 0, // start_changestamp - std::string(), // search_query - std::string(), // directory_resource_id + 0, // start_changestamp + "", // search_query + "", // directory_resource_id test_util::CreateCopyResultCallback(&error, &resource_list)); message_loop_.RunUntilIdle(); @@ -139,9 +139,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_WithStartIndexAndMaxResults) { scoped_ptr<ResourceList> resource_list; fake_service_.GetResourceList( GURL("http://localhost/?start-offset=2&max-results=5"), - 0, // start_changestamp - std::string(), // search_query - std::string(), // directory_resource_id + 0, // start_changestamp + "", // search_query + "", // directory_resource_id test_util::CreateCopyResultCallback(&error, &resource_list)); message_loop_.RunUntilIdle(); @@ -168,9 +168,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_WithDefaultMaxResultsChanged) { scoped_ptr<ResourceList> resource_list; fake_service_.GetResourceList( GURL(), - 0, // start_changestamp - std::string(), // search_query - std::string(), // directory_resource_id + 0, // start_changestamp + "", // search_query + "", // directory_resource_id test_util::CreateCopyResultCallback(&error, &resource_list)); message_loop_.RunUntilIdle(); @@ -196,8 +196,8 @@ TEST_F(FakeDriveServiceTest, GetResourceList_InRootDirectory) { scoped_ptr<ResourceList> resource_list; fake_service_.GetResourceList( GURL(), - 0, // start_changestamp - std::string(), // search_query + 0, // start_changestamp + "", // search_query fake_service_.GetRootResourceId(), // directory_resource_id test_util::CreateCopyResultCallback(&error, &resource_list)); message_loop_.RunUntilIdle(); @@ -217,9 +217,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_Search) { scoped_ptr<ResourceList> resource_list; fake_service_.GetResourceList( GURL(), - 0, // start_changestamp - "File", // search_query - std::string(), // directory_resource_id + 0, // start_changestamp + "File", // search_query + "", // directory_resource_id test_util::CreateCopyResultCallback(&error, &resource_list)); message_loop_.RunUntilIdle(); @@ -239,9 +239,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_SearchWithAttribute) { scoped_ptr<ResourceList> resource_list; fake_service_.GetResourceList( GURL(), - 0, // start_changestamp + 0, // start_changestamp "title:1.txt", // search_query - std::string(), // directory_resource_id + "", // directory_resource_id test_util::CreateCopyResultCallback(&error, &resource_list)); message_loop_.RunUntilIdle(); @@ -261,9 +261,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_SearchMultipleQueries) { scoped_ptr<ResourceList> resource_list; fake_service_.GetResourceList( GURL(), - 0, // start_changestamp + 0, // start_changestamp "Directory 1", // search_query - std::string(), // directory_resource_id + "", // directory_resource_id test_util::CreateCopyResultCallback(&error, &resource_list)); message_loop_.RunUntilIdle(); @@ -274,9 +274,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_SearchMultipleQueries) { fake_service_.GetResourceList( GURL(), - 0, // start_changestamp + 0, // start_changestamp "\"Directory 1\"", // search_query - std::string(), // directory_resource_id + "", // directory_resource_id test_util::CreateCopyResultCallback(&error, &resource_list)); message_loop_.RunUntilIdle(); @@ -299,9 +299,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_NoNewEntries) { scoped_ptr<ResourceList> resource_list; fake_service_.GetResourceList( GURL(), - 654321 + 1, // start_changestamp - std::string(), // search_query - std::string(), // directory_resource_id + 654321 + 1, // start_changestamp + "", // search_query + "", // directory_resource_id test_util::CreateCopyResultCallback(&error, &resource_list)); message_loop_.RunUntilIdle(); @@ -331,9 +331,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_WithNewEntry) { scoped_ptr<ResourceList> resource_list; fake_service_.GetResourceList( GURL(), - 654321 + 1, // start_changestamp - std::string(), // search_query - std::string(), // directory_resource_id + 654321 + 1, // start_changestamp + "", // search_query + "", // directory_resource_id test_util::CreateCopyResultCallback(&error, &resource_list)); message_loop_.RunUntilIdle(); @@ -354,9 +354,9 @@ TEST_F(FakeDriveServiceTest, GetResourceList_Offline) { scoped_ptr<ResourceList> resource_list; fake_service_.GetResourceList( GURL(), - 0, // start_changestamp - std::string(), // search_query - std::string(), // directory_resource_id + 0, // start_changestamp + "", // search_query + "", // directory_resource_id test_util::CreateCopyResultCallback(&error, &resource_list)); message_loop_.RunUntilIdle(); @@ -845,7 +845,7 @@ TEST_F(FakeDriveServiceTest, DeleteResource_ExistingFile) { GDataErrorCode error = GDATA_OTHER_ERROR; fake_service_.DeleteResource("file:2_file_resource_id", - std::string(), // etag + "", // etag test_util::CreateCopyResultCallback(&error)); message_loop_.RunUntilIdle(); @@ -860,7 +860,7 @@ TEST_F(FakeDriveServiceTest, DeleteResource_NonexistingFile) { GDataErrorCode error = GDATA_OTHER_ERROR; fake_service_.DeleteResource("file:nonexisting_resource_id", - std::string(), // etag + "", // etag test_util::CreateCopyResultCallback(&error)); message_loop_.RunUntilIdle(); @@ -874,7 +874,7 @@ TEST_F(FakeDriveServiceTest, DeleteResource_Offline) { GDataErrorCode error = GDATA_OTHER_ERROR; fake_service_.DeleteResource("file:2_file_resource_id", - std::string(), // etag + "", // etag test_util::CreateCopyResultCallback(&error)); message_loop_.RunUntilIdle(); @@ -1506,7 +1506,7 @@ TEST_F(FakeDriveServiceTest, InitiateUploadExistingFile_Offline) { "test/foo", 13, "file:2_file_resource_id", - std::string(), // etag + "", // etag test_util::CreateCopyResultCallback(&error, &upload_location)); message_loop_.RunUntilIdle(); @@ -1525,7 +1525,7 @@ TEST_F(FakeDriveServiceTest, InitiateUploadExistingFile_NotFound) { "test/foo", 13, "non_existent", - std::string(), // etag + "", // etag test_util::CreateCopyResultCallback(&error, &upload_location)); message_loop_.RunUntilIdle(); diff --git a/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc b/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc index 7f2395d..1a15c62 100644 --- a/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc +++ b/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc @@ -325,10 +325,10 @@ TEST_F(GDataWapiOperationsTest, GetResourceListOperation_DefaultFeed) { &operation_registry_, request_context_getter_.get(), *url_generator_, - GURL(), // Pass an empty URL to use the default feed - 0, // start changestamp - std::string(), // search string - std::string(), // directory resource ID + GURL(), // Pass an empty URL to use the default feed + 0, // start changestamp + "", // search string + "", // directory resource ID CreateComposedCallback( base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&result_code, &result_data))); @@ -360,9 +360,9 @@ TEST_F(GDataWapiOperationsTest, GetResourceListOperation_ValidFeed) { request_context_getter_.get(), *url_generator_, test_server_.GetURL("/files/chromeos/gdata/root_feed.json"), - 0, // start changestamp - std::string(), // search string - std::string(), // directory resource ID + 0, // start changestamp + "", // search string + "", // directory resource ID CreateComposedCallback( base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&result_code, &result_data))); @@ -395,9 +395,9 @@ TEST_F(GDataWapiOperationsTest, GetResourceListOperation_InvalidFeed) { request_context_getter_.get(), *url_generator_, test_server_.GetURL("/files/chromeos/gdata/testfile.txt"), - 0, // start changestamp - std::string(), // search string - std::string(), // directory resource ID + 0, // start changestamp + "", // search string + "", // directory resource ID CreateComposedCallback( base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&result_code, &result_data))); @@ -548,10 +548,11 @@ TEST_F(GDataWapiOperationsTest, DeleteResourceOperation) { &operation_registry_, request_context_getter_.get(), *url_generator_, - CreateComposedCallback(base::Bind(&test_util::RunAndQuit), - test_util::CreateCopyResultCallback(&result_code)), + CreateComposedCallback( + base::Bind(&test_util::RunAndQuit), + test_util::CreateCopyResultCallback(&result_code)), "file:2_file_resource_id", - std::string()); + ""); operation->Start(kTestGDataAuthToken, kTestUserAgent, base::Bind(&test_util::DoNothingForReAuthenticateCallback)); @@ -1134,7 +1135,7 @@ TEST_F(GDataWapiOperationsTest, UploadNewLargeFile) { // The test is almost identical to UploadNewFile. The only difference is the // expectation for the Content-Range header. TEST_F(GDataWapiOperationsTest, UploadNewEmptyFile) { - const std::string kUploadContent; + const std::string kUploadContent = ""; GDataErrorCode result_code = GDATA_OTHER_ERROR; GURL upload_url; @@ -1243,7 +1244,7 @@ TEST_F(GDataWapiOperationsTest, UploadExistingFile) { "text/plain", kUploadContent.size(), "file:foo", - std::string() /* etag */); + "" /* etag */); initiate_operation->Start( kTestGDataAuthToken, kTestUserAgent, diff --git a/chrome/browser/google_apis/gdata_wapi_parser_unittest.cc b/chrome/browser/google_apis/gdata_wapi_parser_unittest.cc index 1356cf6..f85d325 100644 --- a/chrome/browser/google_apis/gdata_wapi_parser_unittest.cc +++ b/chrome/browser/google_apis/gdata_wapi_parser_unittest.cc @@ -324,7 +324,7 @@ TEST(GDataWAPIParserTest, ResourceEntryHasDocumentExtension) { EXPECT_FALSE(ResourceEntry::HasHostedDocumentExtension( base::FilePath(FILE_PATH_LITERAL("Test")))); EXPECT_FALSE(ResourceEntry::HasHostedDocumentExtension( - base::FilePath())); + base::FilePath(FILE_PATH_LITERAL("")))); } TEST(GDataWAPIParserTest, ResourceEntryClassifyEntryKind) { diff --git a/chrome/browser/google_apis/gdata_wapi_service.cc b/chrome/browser/google_apis/gdata_wapi_service.cc index 2649049..47edcf6 100644 --- a/chrome/browser/google_apis/gdata_wapi_service.cc +++ b/chrome/browser/google_apis/gdata_wapi_service.cc @@ -199,14 +199,15 @@ void GDataWapiService::GetAllResourceList( DCHECK(!callback.is_null()); runner_->StartOperationWithRetry( - new GetResourceListOperation(operation_registry(), - url_request_context_getter_, - url_generator_, - GURL(), // No override url - 0, // start changestamp - std::string(), // empty search query - std::string(), // no directory resource id - callback)); + new GetResourceListOperation( + operation_registry(), + url_request_context_getter_, + url_generator_, + GURL(), // No override url + 0, // start changestamp + "", // empty search query + "", // no directory resource id + callback)); } void GDataWapiService::GetResourceListInDirectory( @@ -217,14 +218,15 @@ void GDataWapiService::GetResourceListInDirectory( DCHECK(!callback.is_null()); runner_->StartOperationWithRetry( - new GetResourceListOperation(operation_registry(), - url_request_context_getter_, - url_generator_, - GURL(), // No override url - 0, // start changestamp - std::string(), // empty search query - directory_resource_id, - callback)); + new GetResourceListOperation( + operation_registry(), + url_request_context_getter_, + url_generator_, + GURL(), // No override url + 0, // start changestamp + "", // empty search query + directory_resource_id, + callback)); } void GDataWapiService::Search(const std::string& search_query, @@ -234,14 +236,15 @@ void GDataWapiService::Search(const std::string& search_query, DCHECK(!callback.is_null()); runner_->StartOperationWithRetry( - new GetResourceListOperation(operation_registry(), - url_request_context_getter_, - url_generator_, - GURL(), // No override url - 0, // start changestamp - search_query, - std::string(), // no directory resource id - callback)); + new GetResourceListOperation( + operation_registry(), + url_request_context_getter_, + url_generator_, + GURL(), // No override url + 0, // start changestamp + search_query, + "", // no directory resource id + callback)); } void GDataWapiService::SearchInDirectory( @@ -271,14 +274,15 @@ void GDataWapiService::GetChangeList(int64 start_changestamp, DCHECK(!callback.is_null()); runner_->StartOperationWithRetry( - new GetResourceListOperation(operation_registry(), - url_request_context_getter_, - url_generator_, - GURL(), // No override url - start_changestamp, - std::string(), // empty search query - std::string(), // no directory resource id - callback)); + new GetResourceListOperation( + operation_registry(), + url_request_context_getter_, + url_generator_, + GURL(), // No override url + start_changestamp, + "", // empty search query + "", // no directory resource id + callback)); } void GDataWapiService::ContinueGetResourceList( @@ -289,14 +293,15 @@ void GDataWapiService::ContinueGetResourceList( DCHECK(!callback.is_null()); runner_->StartOperationWithRetry( - new GetResourceListOperation(operation_registry(), - url_request_context_getter_, - url_generator_, - override_url, - 0, // start changestamp - std::string(), // empty search query - std::string(), // no directory resource id - callback)); + new GetResourceListOperation( + operation_registry(), + url_request_context_getter_, + url_generator_, + override_url, + 0, // start changestamp + "", // empty search query + "", // no directory resource id + callback)); } void GDataWapiService::GetResourceEntry( diff --git a/chrome/browser/google_apis/gdata_wapi_url_generator_unittest.cc b/chrome/browser/google_apis/gdata_wapi_url_generator_unittest.cc index de80699..571a661 100644 --- a/chrome/browser/google_apis/gdata_wapi_url_generator_unittest.cc +++ b/chrome/browser/google_apis/gdata_wapi_url_generator_unittest.cc @@ -32,29 +32,29 @@ TEST_F(GDataWapiUrlGeneratorTest, AddInitiateUploadUrlParams) { } TEST_F(GDataWapiUrlGeneratorTest, AddFeedUrlParams) { - EXPECT_EQ( - "http://www.example.com/?v=3&alt=json&showroot=true&" - "showfolders=true" - "&include-shared=true" - "&max-results=100" - "&include-installed-apps=true", - GDataWapiUrlGenerator::AddFeedUrlParams(GURL("http://www.example.com"), - 100, // num_items_to_fetch - 0, // changestamp - std::string() // search_string - ).spec()); - EXPECT_EQ( - "http://www.example.com/?v=3&alt=json&showroot=true&" - "showfolders=true" - "&include-shared=true" - "&max-results=100" - "&include-installed-apps=true" - "&start-index=123", - GDataWapiUrlGenerator::AddFeedUrlParams(GURL("http://www.example.com"), - 100, // num_items_to_fetch - 123, // changestamp - std::string() // search_string - ).spec()); + EXPECT_EQ("http://www.example.com/?v=3&alt=json&showroot=true&" + "showfolders=true" + "&include-shared=true" + "&max-results=100" + "&include-installed-apps=true", + GDataWapiUrlGenerator::AddFeedUrlParams( + GURL("http://www.example.com"), + 100, // num_items_to_fetch + 0, // changestamp + "" // search_string + ).spec()); + EXPECT_EQ("http://www.example.com/?v=3&alt=json&showroot=true&" + "showfolders=true" + "&include-shared=true" + "&max-results=100" + "&include-installed-apps=true" + "&start-index=123", + GDataWapiUrlGenerator::AddFeedUrlParams( + GURL("http://www.example.com"), + 100, // num_items_to_fetch + 123, // changestamp + "" // search_string + ).spec()); EXPECT_EQ("http://www.example.com/?v=3&alt=json&showroot=true&" "showfolders=true" "&include-shared=true" @@ -72,52 +72,53 @@ TEST_F(GDataWapiUrlGeneratorTest, AddFeedUrlParams) { TEST_F(GDataWapiUrlGeneratorTest, GenerateResourceListUrl) { // This is the very basic URL for the GetResourceList operation. - EXPECT_EQ("https://docs.google.com/feeds/default/private/full" - "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true" - "&max-results=500&include-installed-apps=true", - url_generator_.GenerateResourceListUrl( - GURL(), // override_url, - 0, // start_changestamp, - std::string(), // search_string, - std::string() // directory resource ID - ).spec()); + EXPECT_EQ( + "https://docs.google.com/feeds/default/private/full" + "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true" + "&max-results=500&include-installed-apps=true", + url_generator_.GenerateResourceListUrl(GURL(), // override_url, + 0, // start_changestamp, + "", // search_string, + "" // directory resource ID + ).spec()); // With an override URL provided, the base URL is changed, but the default // parameters remain as-is. - EXPECT_EQ("http://localhost/" - "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true" - "&max-results=500&include-installed-apps=true", - url_generator_.GenerateResourceListUrl( - GURL("http://localhost/"), // override_url, - 0, // start_changestamp, - std::string(), // search_string, - std::string() // directory resource ID - ).spec()); + EXPECT_EQ( + "http://localhost/" + "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true" + "&max-results=500&include-installed-apps=true", + url_generator_.GenerateResourceListUrl( + GURL("http://localhost/"), // override_url, + 0, // start_changestamp, + "", // search_string, + "" // directory resource ID + ).spec()); // With a non-zero start_changestamp provided, the base URL is changed from // "full" to "changes", and "start-index" parameter is added. - EXPECT_EQ("https://docs.google.com/feeds/default/private/changes" - "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true" - "&max-results=500&include-installed-apps=true" - "&start-index=100", - url_generator_.GenerateResourceListUrl( - GURL(), // override_url, - 100, // start_changestamp, - std::string(), // search_string, - std::string() // directory resource ID - ).spec()); + EXPECT_EQ( + "https://docs.google.com/feeds/default/private/changes" + "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true" + "&max-results=500&include-installed-apps=true" + "&start-index=100", + url_generator_.GenerateResourceListUrl(GURL(), // override_url, + 100, // start_changestamp, + "", // search_string, + "" // directory resource ID + ).spec()); // With a non-empty search string provided, "max-results" value is changed, // and "q" parameter is added. - EXPECT_EQ("https://docs.google.com/feeds/default/private/full" - "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true" - "&max-results=50&include-installed-apps=true&q=foo", - url_generator_.GenerateResourceListUrl( - GURL(), // override_url, - 0, // start_changestamp, - "foo", // search_string, - std::string() // directory resource ID - ).spec()); + EXPECT_EQ( + "https://docs.google.com/feeds/default/private/full" + "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true" + "&max-results=50&include-installed-apps=true&q=foo", + url_generator_.GenerateResourceListUrl(GURL(), // override_url, + 0, // start_changestamp, + "foo", // search_string, + "" // directory resource ID + ).spec()); // With a non-empty directory resource ID provided, the base URL is // changed, but the default parameters remain. @@ -126,23 +127,24 @@ TEST_F(GDataWapiUrlGeneratorTest, GenerateResourceListUrl) { "?v=3&alt=json&showroot=true&showfolders=true&include-shared=true" "&max-results=500&include-installed-apps=true", url_generator_.GenerateResourceListUrl(GURL(), // override_url, - 0, // start_changestamp, - std::string(), // search_string, + 0, // start_changestamp, + "", // search_string, "XXX" // directory resource ID ).spec()); // With a non-empty override_url provided, the base URL is changed, but // the default parameters remain. Note that start-index should not be // overridden. - EXPECT_EQ("http://example.com/" - "?start-index=123&v=3&alt=json&showroot=true&showfolders=true" - "&include-shared=true&max-results=500&include-installed-apps=true", - url_generator_.GenerateResourceListUrl( - GURL("http://example.com/?start-index=123"), // override_url, - 100, // start_changestamp, - std::string(), // search_string, - "XXX" // directory resource ID - ).spec()); + EXPECT_EQ( + "http://example.com/" + "?start-index=123&v=3&alt=json&showroot=true&showfolders=true" + "&include-shared=true&max-results=500&include-installed-apps=true", + url_generator_.GenerateResourceListUrl( + GURL("http://example.com/?start-index=123"), // override_url, + 100, // start_changestamp, + "", // search_string, + "XXX" // directory resource ID + ).spec()); } TEST_F(GDataWapiUrlGeneratorTest, GenerateEditUrl) { diff --git a/chrome/browser/google_apis/operation_util_unittest.cc b/chrome/browser/google_apis/operation_util_unittest.cc index 14e4c5dd..8a8ffe4 100644 --- a/chrome/browser/google_apis/operation_util_unittest.cc +++ b/chrome/browser/google_apis/operation_util_unittest.cc @@ -11,7 +11,7 @@ namespace util { TEST(GenerateIfMatchHeaderTest, GenerateIfMatchHeader) { // The header matched to all etag should be returned for empty etag. - EXPECT_EQ("If-Match: *", GenerateIfMatchHeader(std::string())); + EXPECT_EQ("If-Match: *", GenerateIfMatchHeader("")); // Otherwise, the returned header should be matched to the given etag. EXPECT_EQ("If-Match: abcde", GenerateIfMatchHeader("abcde")); diff --git a/chrome/browser/google_apis/test_server/http_server_unittest.cc b/chrome/browser/google_apis/test_server/http_server_unittest.cc index d837baf..e242098 100644 --- a/chrome/browser/google_apis/test_server/http_server_unittest.cc +++ b/chrome/browser/google_apis/test_server/http_server_unittest.cc @@ -38,7 +38,7 @@ std::string GetContentTypeFromFetcher(const net::URLFetcher& fetcher) { if (headers->GetMimeType(&content_type)) return content_type; } - return std::string(); + return ""; } } // namespace diff --git a/chrome/browser/history/history_querying_unittest.cc b/chrome/browser/history/history_querying_unittest.cc index ed138e8..c1355dd 100644 --- a/chrome/browser/history/history_querying_unittest.cc +++ b/chrome/browser/history/history_querying_unittest.cc @@ -468,7 +468,7 @@ TEST_F(HistoryQueryTest, Paging) { // Since results are fetched 1 and 2 at a time, entry #0 and #6 will not // be de-duplicated. int expected_results[] = { 4, 2, 3, 1, 7, 6, 5, 0 }; - TestPaging(std::string(), expected_results, arraysize(expected_results)); + TestPaging("", expected_results, arraysize(expected_results)); } TEST_F(HistoryQueryTest, FTSPaging) { diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/history/history_tab_helper.cc index 5438b97..a984557 100644 --- a/chrome/browser/history/history_tab_helper.cc +++ b/chrome/browser/history/history_tab_helper.cc @@ -53,8 +53,7 @@ void HistoryTabHelper::UpdateHistoryForNavigation( void HistoryTabHelper::UpdateHistoryPageTitle(const NavigationEntry& entry) { HistoryService* hs = GetHistoryService(); if (hs) - hs->SetPageTitle(entry.GetVirtualURL(), - entry.GetTitleForDisplay(std::string())); + hs->SetPageTitle(entry.GetVirtualURL(), entry.GetTitleForDisplay("")); } history::HistoryAddPageArgs diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc index c988e55..e465a80 100644 --- a/chrome/browser/history/history_unittest.cc +++ b/chrome/browser/history/history_unittest.cc @@ -164,19 +164,20 @@ class HistoryBackendDBTest : public HistoryUnitTestBase { std::vector<GURL> url_chain; url_chain.push_back(GURL("foo-url")); - DownloadRow download(base::FilePath(FILE_PATH_LITERAL("foo-path")), - base::FilePath(FILE_PATH_LITERAL("foo-path")), - url_chain, - GURL(std::string()), - time, - time, - 0, - 512, - state, - content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, - content::DOWNLOAD_INTERRUPT_REASON_NONE, - 0, - 0); + DownloadRow download( + base::FilePath(FILE_PATH_LITERAL("foo-path")), + base::FilePath(FILE_PATH_LITERAL("foo-path")), + url_chain, + GURL(""), + time, + time, + 0, + 512, + state, + content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, + content::DOWNLOAD_INTERRUPT_REASON_NONE, + 0, + 0); return db_->CreateDownload(download); } @@ -316,7 +317,7 @@ TEST_F(HistoryBackendDBTest, MigrateDownloadsReasonPathsAndDangerType) { int64 db_handle = 0; // Null path. s.BindInt64(0, ++db_handle); - s.BindString(1, std::string()); + s.BindString(1, ""); s.BindString(2, "http://whatever.com/index.html"); s.BindInt64(3, now.ToTimeT()); s.BindInt64(4, 100); @@ -463,19 +464,20 @@ TEST_F(HistoryBackendDBTest, DownloadNukeRecordsMissingURLs) { CreateBackendAndDatabase(); base::Time now(base::Time::Now()); std::vector<GURL> url_chain; - DownloadRow download(base::FilePath(FILE_PATH_LITERAL("foo-path")), - base::FilePath(FILE_PATH_LITERAL("foo-path")), - url_chain, - GURL(std::string()), - now, - now, - 0, - 512, - DownloadItem::COMPLETE, - content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, - content::DOWNLOAD_INTERRUPT_REASON_NONE, - 0, - 0); + DownloadRow download( + base::FilePath(FILE_PATH_LITERAL("foo-path")), + base::FilePath(FILE_PATH_LITERAL("foo-path")), + url_chain, + GURL(""), + now, + now, + 0, + 512, + DownloadItem::COMPLETE, + content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, + content::DOWNLOAD_INTERRUPT_REASON_NONE, + 0, + 0); // Creating records without any urls should fail. EXPECT_EQ(DownloadDatabase::kUninitializedHandle, diff --git a/chrome/browser/history/thumbnail_database_unittest.cc b/chrome/browser/history/thumbnail_database_unittest.cc index de3bd33..fc92feb 100644 --- a/chrome/browser/history/thumbnail_database_unittest.cc +++ b/chrome/browser/history/thumbnail_database_unittest.cc @@ -414,7 +414,7 @@ TEST_F(ThumbnailDatabaseTest, UpgradeToVersion6) { EXPECT_EQ(url, GURL(statement.ColumnString(1))); EXPECT_EQ(TOUCH_ICON, statement.ColumnInt(2)); // Any previous data in sizes should be cleared. - EXPECT_EQ(std::string(), statement.ColumnString(3)); + EXPECT_EQ(std::string(""), statement.ColumnString(3)); statement.Assign(db.db_.GetCachedStatement(SQL_FROM_HERE, "SELECT icon_id, last_updated, image_data, width, height " @@ -854,7 +854,7 @@ TEST_F(ThumbnailDatabaseTest, FaviconSizesToAndFromString) { // Valid input. FaviconSizes sizes_empty; - ThumbnailDatabase::DatabaseStringToFaviconSizes(std::string(), &sizes_empty); + ThumbnailDatabase::DatabaseStringToFaviconSizes("", &sizes_empty); EXPECT_EQ(0u, sizes_empty.size()); FaviconSizes sizes_valid; diff --git a/chrome/browser/importer/firefox_importer_utils.cc b/chrome/browser/importer/firefox_importer_utils.cc index 8ffe8f2..0535cf6 100644 --- a/chrome/browser/importer/firefox_importer_utils.cc +++ b/chrome/browser/importer/firefox_importer_utils.cc @@ -255,12 +255,12 @@ std::string ReadBrowserConfigProp(const base::FilePath& app_path, const std::string& pref_key) { std::string content; if (!ReadPrefFile(app_path.AppendASCII("browserconfig.properties"), &content)) - return std::string(); + return ""; // This file has the syntax: key=value. size_t prop_index = content.find(pref_key + "="); if (prop_index == std::string::npos) - return std::string(); + return ""; size_t start = prop_index + pref_key.length(); size_t stop = std::string::npos; @@ -270,7 +270,7 @@ std::string ReadBrowserConfigProp(const base::FilePath& app_path, if (start == std::string::npos || stop == std::string::npos || (start == stop)) { LOG(WARNING) << "Firefox property " << pref_key << " could not be parsed."; - return std::string(); + return ""; } return content.substr(start + 1, stop - start - 1); @@ -280,7 +280,7 @@ std::string ReadPrefsJsValue(const base::FilePath& profile_path, const std::string& pref_key) { std::string content; if (!ReadPrefFile(profile_path.AppendASCII("prefs.js"), &content)) - return std::string(); + return ""; return GetPrefsJsValue(content, pref_key); } @@ -411,7 +411,7 @@ std::string GetPrefsJsValue(const std::string& content, if (start == std::string::npos || stop == std::string::npos || stop < start) { LOG(WARNING) << "Firefox property " << pref_key << " could not be parsed."; - return std::string(); + return ""; } // String values have double quotes we don't need to return to the caller. diff --git a/chrome/browser/internal_auth_unittest.cc b/chrome/browser/internal_auth_unittest.cc index da8954e..42080cd 100644 --- a/chrome/browser/internal_auth_unittest.cc +++ b/chrome/browser/internal_auth_unittest.cc @@ -69,10 +69,9 @@ TEST_F(InternalAuthTest, BadGeneration) { token, long_string_, map)); // Trying empty domain. - token = InternalAuthGeneration::GeneratePassport(std::string(), map); + token = InternalAuthGeneration::GeneratePassport("", map); ASSERT_TRUE(token.empty()); - ASSERT_FALSE( - InternalAuthVerification::VerifyPassport(token, std::string(), map)); + ASSERT_FALSE(InternalAuthVerification::VerifyPassport(token, "", map)); std::string dummy("abcdefghij"); for (size_t i = 1000; i--;) { @@ -88,7 +87,7 @@ TEST_F(InternalAuthTest, BadGeneration) { ASSERT_FALSE(InternalAuthVerification::VerifyPassport(token, "zapata", map)); map.clear(); - map[std::string()] = "value"; + map[""] = "value"; // Trying empty key. token = InternalAuthGeneration::GeneratePassport("zapata", map); ASSERT_TRUE(token.empty()); diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index b0c5010..76d5df7 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc @@ -691,10 +691,8 @@ void IOThread::EnableSpdy(const std::string& mode) { const std::string& element = *it; std::vector<std::string> name_value; base::SplitString(element, '=', &name_value); - const std::string& option = - name_value.size() > 0 ? name_value[0] : std::string(); - const std::string value = - name_value.size() > 1 ? name_value[1] : std::string(); + const std::string& option = name_value.size() > 0 ? name_value[0] : ""; + const std::string value = name_value.size() > 1 ? name_value[1] : ""; if (option == kOff) { net::HttpStreamFactory::set_spdy_enabled(false); @@ -741,11 +739,10 @@ void IOThread::RegisterPrefs(PrefRegistrySimple* registry) { "spdyproxy"); registry->RegisterBooleanPref(prefs::kDisableAuthNegotiateCnameLookup, false); registry->RegisterBooleanPref(prefs::kEnableAuthNegotiatePort, false); - registry->RegisterStringPref(prefs::kAuthServerWhitelist, std::string()); - registry->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, - std::string()); - registry->RegisterStringPref(prefs::kGSSAPILibraryName, std::string()); - registry->RegisterStringPref(prefs::kSpdyProxyAuthOrigin, std::string()); + registry->RegisterStringPref(prefs::kAuthServerWhitelist, ""); + registry->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, ""); + registry->RegisterStringPref(prefs::kGSSAPILibraryName, ""); + registry->RegisterStringPref(prefs::kSpdyProxyAuthOrigin, ""); registry->RegisterBooleanPref(prefs::kEnableReferrers, true); registry->RegisterInt64Pref(prefs::kHttpReceivedContentLength, 0); registry->RegisterInt64Pref(prefs::kHttpOriginalContentLength, 0); diff --git a/chrome/browser/language_usage_metrics_unittest.cc b/chrome/browser/language_usage_metrics_unittest.cc index e007e70..db6e987 100644 --- a/chrome/browser/language_usage_metrics_unittest.cc +++ b/chrome/browser/language_usage_metrics_unittest.cc @@ -16,7 +16,7 @@ TEST(LanguageUsageMetricsTest, ParseAcceptLanguages) { EXPECT_EQ(JAPANESE, *language_set.begin()); // Empty language. - LanguageUsageMetrics::ParseAcceptLanguages(std::string(), &language_set); + LanguageUsageMetrics::ParseAcceptLanguages("", &language_set); EXPECT_EQ(0U, language_set.size()); // Country code is ignored. @@ -86,6 +86,6 @@ TEST(LanguageUsageMetricsTest, ToLanguage) { EXPECT_EQ(JAPANESE, LanguageUsageMetrics::ToLanguage("ja-JP")); // Invalid locales are considered as unknown language. - EXPECT_EQ(UNKNOWN_LANGUAGE, LanguageUsageMetrics::ToLanguage(std::string())); + EXPECT_EQ(UNKNOWN_LANGUAGE, LanguageUsageMetrics::ToLanguage("")); EXPECT_EQ(UNKNOWN_LANGUAGE, LanguageUsageMetrics::ToLanguage("xx")); } diff --git a/chrome/browser/logging_chrome_browsertest.cc b/chrome/browser/logging_chrome_browsertest.cc index df32456..9728fd3 100644 --- a/chrome/browser/logging_chrome_browsertest.cc +++ b/chrome/browser/logging_chrome_browsertest.cc @@ -44,7 +44,7 @@ class ChromeLoggingTest : public testing::Test { // Tests the log file name getter without an environment variable. TEST_F(ChromeLoggingTest, LogFileName) { - SaveEnvironmentVariable(std::string()); + SaveEnvironmentVariable(""); base::FilePath filename = logging::GetLogFileName(); ASSERT_NE(base::FilePath::StringType::npos, diff --git a/chrome/browser/managed_mode/managed_user_service.cc b/chrome/browser/managed_mode/managed_user_service.cc index 80b2bc8..0cc29f5 100644 --- a/chrome/browser/managed_mode/managed_user_service.cc +++ b/chrome/browser/managed_mode/managed_user_service.cc @@ -154,10 +154,10 @@ void ManagedUserService::RegisterUserPrefs(PrefRegistrySyncable* registry) { ManagedModeURLFilter::BLOCK, PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterStringPref(prefs::kManagedModeLocalPassphrase, - std::string(), + "", PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterStringPref(prefs::kManagedModeLocalSalt, - std::string(), + "", PrefRegistrySyncable::UNSYNCABLE_PREF); } @@ -203,7 +203,7 @@ bool ManagedUserService::UserMayLoad(const extensions::Extension* extension, string16* error) const { string16 tmp_error; // |extension| can be NULL in unit tests. - if (ExtensionManagementPolicyImpl(extension ? extension->id() : std::string(), + if (ExtensionManagementPolicyImpl(extension ? extension->id() : "", &tmp_error)) return true; @@ -244,8 +244,7 @@ bool ManagedUserService::UserMayModifySettings( const extensions::Extension* extension, string16* error) const { // |extension| can be NULL in unit tests. - return ExtensionManagementPolicyImpl( - extension ? extension->id() : std::string(), error); + return ExtensionManagementPolicyImpl(extension ? extension->id() : "", error); } void ManagedUserService::Observe(int type, diff --git a/chrome/browser/media/media_stream_devices_controller.cc b/chrome/browser/media/media_stream_devices_controller.cc index 2d844a4..c83e74d 100644 --- a/chrome/browser/media/media_stream_devices_controller.cc +++ b/chrome/browser/media/media_stream_devices_controller.cc @@ -279,11 +279,11 @@ void MediaStreamDevicesController::HandleTabMediaRequest() { if (request_.audio_type == content::MEDIA_TAB_AUDIO_CAPTURE) { devices.push_back(content::MediaStreamDevice( - content::MEDIA_TAB_AUDIO_CAPTURE, std::string(), std::string())); + content::MEDIA_TAB_AUDIO_CAPTURE, "", "")); } if (request_.video_type == content::MEDIA_TAB_VIDEO_CAPTURE) { devices.push_back(content::MediaStreamDevice( - content::MEDIA_TAB_VIDEO_CAPTURE, std::string(), std::string())); + content::MEDIA_TAB_VIDEO_CAPTURE, "", "")); } callback_.Run(devices); diff --git a/chrome/browser/media_galleries/media_galleries_dialog_controller.cc b/chrome/browser/media_galleries/media_galleries_dialog_controller.cc index bcd3ae3..98ba8da 100644 --- a/chrome/browser/media_galleries/media_galleries_dialog_controller.cc +++ b/chrome/browser/media_galleries/media_galleries_dialog_controller.cc @@ -147,7 +147,7 @@ string16 MediaGalleriesDialogController::GetHeader() const { } string16 MediaGalleriesDialogController::GetSubtext() const { - std::string extension_name(extension_ ? extension_->name() : std::string()); + std::string extension_name(extension_ ? extension_->name() : ""); return l10n_util::GetStringFUTF16(IDS_MEDIA_GALLERIES_DIALOG_SUBTEXT, UTF8ToUTF16(extension_name)); } @@ -184,9 +184,7 @@ void MediaGalleriesDialogController::OnAddFolderClicked() { ui::SelectFileDialog::SELECT_FOLDER, l10n_util::GetStringUTF16(IDS_MEDIA_GALLERIES_DIALOG_ADD_GALLERY_TITLE), user_data_dir, - NULL, - 0, - base::FilePath::StringType(), + NULL, 0, FILE_PATH_LITERAL(""), web_contents_->GetView()->GetTopLevelNativeWindow(), NULL); } diff --git a/chrome/browser/media_galleries/media_galleries_preferences.cc b/chrome/browser/media_galleries/media_galleries_preferences.cc index 48689ee..78316ef 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences.cc +++ b/chrome/browser/media_galleries/media_galleries_preferences.cc @@ -258,7 +258,7 @@ void MediaGalleriesPreferences::InitFromPrefs(bool notify_observers) { } } if (notify_observers) - NotifyChangeObservers(std::string()); + NotifyChangeObservers(""); } void MediaGalleriesPreferences::NotifyChangeObservers( diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc index ec39326..72fff96 100644 --- a/chrome/browser/metrics/metrics_log.cc +++ b/chrome/browser/metrics/metrics_log.cc @@ -969,7 +969,7 @@ void MetricsLog::RecordOmniboxOpenedURL(const AutocompleteLog& log) { // Write the XML version. OPEN_ELEMENT_FOR_SCOPE("uielement"); WriteAttribute("action", "autocomplete"); - WriteAttribute("targetidhash", std::string()); + WriteAttribute("targetidhash", ""); // TODO(kochi): Properly track windows. WriteIntAttribute("window", 0); if (log.tab_id != -1) { diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc index c25c8e6..e68d7bf 100644 --- a/chrome/browser/metrics/metrics_service.cc +++ b/chrome/browser/metrics/metrics_service.cc @@ -391,13 +391,13 @@ class MetricsMemoryDetails : public MemoryDetails { // static void MetricsService::RegisterPrefs(PrefRegistrySimple* registry) { DCHECK(IsSingleThreaded()); - registry->RegisterStringPref(prefs::kMetricsClientID, std::string()); + registry->RegisterStringPref(prefs::kMetricsClientID, ""); registry->RegisterIntegerPref(prefs::kMetricsLowEntropySource, kLowEntropySourceNotSet); registry->RegisterInt64Pref(prefs::kMetricsClientIDTimestamp, 0); registry->RegisterInt64Pref(prefs::kStabilityLaunchTimeSec, 0); registry->RegisterInt64Pref(prefs::kStabilityLastTimestampSec, 0); - registry->RegisterStringPref(prefs::kStabilityStatsVersion, std::string()); + registry->RegisterStringPref(prefs::kStabilityStatsVersion, ""); registry->RegisterInt64Pref(prefs::kStabilityStatsBuildTime, 0); registry->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); registry->RegisterBooleanPref(prefs::kStabilitySessionEndCompleted, true); diff --git a/chrome/browser/nacl_host/pnacl_file_host_unittest.cc b/chrome/browser/nacl_host/pnacl_file_host_unittest.cc index 6e30c29..eb2a74a 100644 --- a/chrome/browser/nacl_host/pnacl_file_host_unittest.cc +++ b/chrome/browser/nacl_host/pnacl_file_host_unittest.cc @@ -57,7 +57,7 @@ TEST(PnaclFileHostTest, TestFilenamesWithPnaclPath) { &out_path)); // Other bad files. - EXPECT_FALSE(PnaclCanOpenFile(std::string(), &out_path)); + EXPECT_FALSE(PnaclCanOpenFile("", &out_path)); EXPECT_FALSE(PnaclCanOpenFile(".", &out_path)); EXPECT_FALSE(PnaclCanOpenFile("..", &out_path)); #if defined(OS_WIN) diff --git a/chrome/browser/net/chrome_fraudulent_certificate_reporter_unittest.cc b/chrome/browser/net/chrome_fraudulent_certificate_reporter_unittest.cc index f1d1714..4326fb9 100644 --- a/chrome/browser/net/chrome_fraudulent_certificate_reporter_unittest.cc +++ b/chrome/browser/net/chrome_fraudulent_certificate_reporter_unittest.cc @@ -123,7 +123,8 @@ class NotSendingTestReporter : public TestReporter { class MockURLRequest : public net::URLRequest { public: explicit MockURLRequest(net::URLRequestContext* context) - : net::URLRequest(GURL(std::string()), NULL, context) {} + : net::URLRequest(GURL(""), NULL, context) { + } private: }; diff --git a/chrome/browser/net/chrome_network_delegate_unittest.cc b/chrome/browser/net/chrome_network_delegate_unittest.cc index b5c8151..f822195 100644 --- a/chrome/browser/net/chrome_network_delegate_unittest.cc +++ b/chrome/browser/net/chrome_network_delegate_unittest.cc @@ -234,7 +234,7 @@ TEST_F(ChromeNetworkDelegateSafeSearchTest, SafeSearchOn) { "q=goog&" + kBothParameters); // Test that another website is not affected, without parameters. - CheckAddedParameters("http://google.com/finance", std::string()); + CheckAddedParameters("http://google.com/finance", ""); // Test that another website is not affected, with parameters. CheckAddedParameters("http://google.com/finance?q=goog", "q=goog"); @@ -255,10 +255,10 @@ TEST_F(ChromeNetworkDelegateSafeSearchTest, SafeSearchOff) { SetDelegate(delegate.get()); // Test the home page. - CheckAddedParameters("http://google.com/", std::string()); + CheckAddedParameters("http://google.com/", ""); // Test the search home page. - CheckAddedParameters("http://google.com/webhp", std::string()); + CheckAddedParameters("http://google.com/webhp", ""); // Test the home page with parameters. CheckAddedParameters("http://google.com/search?q=google", diff --git a/chrome/browser/net/dns_probe_job_unittest.cc b/chrome/browser/net/dns_probe_job_unittest.cc index 1fe8766..06d6965 100644 --- a/chrome/browser/net/dns_probe_job_unittest.cc +++ b/chrome/browser/net/dns_probe_job_unittest.cc @@ -54,7 +54,7 @@ void DnsProbeJobTest::RunProbe(MockDnsClientRule::Result good_result, const uint16 kTypeA = net::dns_protocol::kTypeA; MockDnsClientRuleList rules; rules.push_back(MockDnsClientRule("google.com", kTypeA, good_result)); - rules.push_back(MockDnsClientRule(std::string(), kTypeA, bad_result)); + rules.push_back(MockDnsClientRule("", kTypeA, bad_result)); scoped_ptr<DnsClient> dns_client = CreateMockDnsClient(config, rules); dns_client->SetConfig(config); diff --git a/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc b/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc index f582d1b..7f33790 100644 --- a/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc +++ b/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc @@ -118,10 +118,8 @@ class HttpPipeliningCompatibilityClientTest : public testing::Test { HttpPipeliningCompatibilityClient::Options options) { HttpPipeliningCompatibilityClient client(NULL); net::TestCompletionCallback callback; - client.Start(test_server_.GetURL(std::string()).spec(), - requests, - options, - callback.callback(), + client.Start(test_server_.GetURL("").spec(), + requests, options, callback.callback(), context_->GetURLRequestContext()); callback.WaitForResult(); } diff --git a/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc b/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc index c69fc93..3ab5d69 100644 --- a/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc +++ b/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc @@ -135,9 +135,9 @@ TEST_F(PrefProxyConfigTrackerImplTest, BaseConfiguration) { } TEST_F(PrefProxyConfigTrackerImplTest, DynamicPrefOverrides) { - pref_service_->SetManagedPref(prefs::kProxy, - ProxyConfigDictionary::CreateFixedServers( - "http://example.com:3128", std::string())); + pref_service_->SetManagedPref( + prefs::kProxy, + ProxyConfigDictionary::CreateFixedServers("http://example.com:3128", "")); loop_.RunUntilIdle(); net::ProxyConfig actual_config; diff --git a/chrome/browser/net/url_info.cc b/chrome/browser/net/url_info.cc index 1046827..ddba658 100644 --- a/chrome/browser/net/url_info.cc +++ b/chrome/browser/net/url_info.cc @@ -361,7 +361,7 @@ std::string UrlInfo::GetAsciiMotivation() const { return RemoveJs(referring_url_.spec()); default: - return std::string(); + return ""; } } diff --git a/chrome/browser/page_cycler/page_cycler.cc b/chrome/browser/page_cycler/page_cycler.cc index b78e1fe..04086d2 100644 --- a/chrome/browser/page_cycler/page_cycler.cc +++ b/chrome/browser/page_cycler/page_cycler.cc @@ -192,12 +192,10 @@ void PageCycler::PrepareResultsOnBackgroundThread() { base::ProcessId pid = base::GetCurrentProcId(); #endif // OS_WIN ChromeProcessList chrome_processes(GetRunningChromeProcesses(pid)); - output += perf_test::MemoryUsageInfoToString( - std::string(), chrome_processes, pid); - output += - perf_test::IOPerfInfoToString(std::string(), chrome_processes, pid); - output += perf_test::SystemCommitChargeToString( - std::string(), base::GetSystemCommitCharge(), false); + output += perf_test::MemoryUsageInfoToString("", chrome_processes, pid); + output += perf_test::IOPerfInfoToString("", chrome_processes, pid); + output += perf_test::SystemCommitChargeToString("", + base::GetSystemCommitCharge(), false); output.append("Pages: [" + urls_string_ + "]\n"); output.append("*RESULT times: t_ref= [" + timings_string_ + "] ms\n"); } diff --git a/chrome/browser/password_manager/native_backend_kwallet_x.cc b/chrome/browser/password_manager/native_backend_kwallet_x.cc index 9c6003d..74d6bb9 100644 --- a/chrome/browser/password_manager/native_backend_kwallet_x.cc +++ b/chrome/browser/password_manager/native_backend_kwallet_x.cc @@ -186,7 +186,7 @@ bool NativeBackendKWallet::StartKWalletd() { builder.AppendString("kwalletd"); // serviceName builder.AppendArrayOfStrings(empty); // urls builder.AppendArrayOfStrings(empty); // envs - builder.AppendString(std::string()); // startup_id + builder.AppendString(""); // startup_id builder.AppendBool(false); // blind scoped_ptr<dbus::Response> response( klauncher->CallMethodAndBlock( diff --git a/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc b/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc index 11af55a..ad00e11 100644 --- a/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc +++ b/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc @@ -315,7 +315,7 @@ dbus::Response* NativeBackendKWalletTest::KLauncherMethodCall( scoped_ptr<dbus::Response> response(dbus::Response::CreateEmpty()); dbus::MessageWriter writer(response.get()); writer.AppendInt32(klauncher_ret_); - writer.AppendString(std::string()); // dbus_name + writer.AppendString(""); // dbus_name writer.AppendString(klauncher_error_); writer.AppendInt32(1234); // pid return response.release(); diff --git a/chrome/browser/plugins/plugin_finder.cc b/chrome/browser/plugins/plugin_finder.cc index 0070387..32ad157 100644 --- a/chrome/browser/plugins/plugin_finder.cc +++ b/chrome/browser/plugins/plugin_finder.cc @@ -292,11 +292,9 @@ scoped_ptr<PluginMetadata> PluginFinder::GetPluginMetadata( std::string identifier = GetIdentifier(plugin); PluginMetadata* metadata = new PluginMetadata(identifier, GetGroupName(plugin), - false, - GURL(), - GURL(), + false, GURL(), GURL(), plugin.name, - std::string()); + ""); for (size_t i = 0; i < plugin.mime_types.size(); ++i) metadata->AddMatchingMimeType(plugin.mime_types[i].mime_type); diff --git a/chrome/browser/plugins/plugin_metadata_unittest.cc b/chrome/browser/plugins/plugin_metadata_unittest.cc index b542b1b..3e3bf99 100644 --- a/chrome/browser/plugins/plugin_metadata_unittest.cc +++ b/chrome/browser/plugins/plugin_metadata_unittest.cc @@ -34,11 +34,9 @@ TEST(PluginMetadataTest, SecurityStatus) { PluginMetadata plugin_metadata("claybrick-writer", ASCIIToUTF16("ClayBrick Writer"), - true, - GURL(), - GURL(), + true, GURL(), GURL(), ASCIIToUTF16("ClayBrick"), - std::string()); + ""); #if defined(OS_LINUX) EXPECT_EQ(kRequiresAuthorization, GetSecurityStatus(&plugin_metadata, "1.2.3")); diff --git a/chrome/browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc b/chrome/browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc index 9f3c403..269ca75 100644 --- a/chrome/browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc +++ b/chrome/browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc @@ -127,7 +127,7 @@ TEST_F(CloudPolicyRefreshSchedulerTest, InitialRefreshManagedAlreadyFetched) { } TEST_F(CloudPolicyRefreshSchedulerTest, Unregistered) { - client_.SetDMToken(std::string()); + client_.SetDMToken(""); scoped_ptr<CloudPolicyRefreshScheduler> scheduler(CreateRefreshScheduler()); client_.NotifyPolicyFetched(); client_.NotifyRegistrationStateChanged(); @@ -182,7 +182,7 @@ TEST_F(CloudPolicyRefreshSchedulerSteadyStateTest, OnRegistrationStateChanged) { EXPECT_EQ(GetLastDelay(), base::TimeDelta()); task_runner_->ClearPendingTasks(); - client_.SetDMToken(std::string()); + client_.SetDMToken(""); client_.NotifyRegistrationStateChanged(); EXPECT_TRUE(task_runner_->GetPendingTasks().empty()); } diff --git a/chrome/browser/policy/cloud/cloud_policy_service_unittest.cc b/chrome/browser/policy/cloud/cloud_policy_service_unittest.cc index b1c7ccb..90b344b 100644 --- a/chrome/browser/policy/cloud/cloud_policy_service_unittest.cc +++ b/chrome/browser/policy/cloud/cloud_policy_service_unittest.cc @@ -118,7 +118,7 @@ TEST_F(CloudPolicyServiceTest, RefreshPolicySuccess) { TEST_F(CloudPolicyServiceTest, RefreshPolicyNotRegistered) { // Clear the token so the client is not registered. - client_.SetDMToken(std::string()); + client_.SetDMToken(""); EXPECT_CALL(client_, FetchPolicy()).Times(0); EXPECT_CALL(*this, OnPolicyRefresh(false)).Times(1); diff --git a/chrome/browser/policy/cloud/device_management_service_unittest.cc b/chrome/browser/policy/cloud/device_management_service_unittest.cc index b83ca80..ae84965 100644 --- a/chrome/browser/policy/cloud/device_management_service_unittest.cc +++ b/chrome/browser/policy/cloud/device_management_service_unittest.cc @@ -513,7 +513,7 @@ TEST_F(DeviceManagementServiceTest, CancelDuringCallback) { // Generate a callback. net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); - SendResponse(fetcher, status, 500, std::string()); + SendResponse(fetcher, status, 500, ""); // Job should have been reset. EXPECT_FALSE(request_job.get()); @@ -534,7 +534,7 @@ TEST_F(DeviceManagementServiceTest, RetryOnProxyError) { // Generate a callback with a proxy failure. net::URLRequestStatus status(net::URLRequestStatus::FAILED, net::ERR_PROXY_CONNECTION_FAILED); - SendResponse(fetcher, status, 200, std::string()); + SendResponse(fetcher, status, 200, ""); // Verify that a new URLFetcher was started that bypasses the proxy. fetcher = GetFetcher(); @@ -564,7 +564,7 @@ TEST_F(DeviceManagementServiceTest, RetryOnBadResponseFromProxy) { // Generate a callback with a valid http response, that was generated by // a bad/wrong proxy. net::URLRequestStatus status; - SendResponse(fetcher, status, 200, std::string()); + SendResponse(fetcher, status, 200, ""); // Verify that a new URLFetcher was started that bypasses the proxy. fetcher = GetFetcher(); diff --git a/chrome/browser/policy/cloud/mock_cloud_policy_client.cc b/chrome/browser/policy/cloud/mock_cloud_policy_client.cc index 92b67e7..7008ec3 100644 --- a/chrome/browser/policy/cloud/mock_cloud_policy_client.cc +++ b/chrome/browser/policy/cloud/mock_cloud_policy_client.cc @@ -10,11 +10,7 @@ namespace em = enterprise_management; namespace policy { MockCloudPolicyClient::MockCloudPolicyClient() - : CloudPolicyClient(std::string(), - std::string(), - USER_AFFILIATION_NONE, - NULL, - NULL) {} + : CloudPolicyClient("", "", USER_AFFILIATION_NONE, NULL, NULL) {} MockCloudPolicyClient::~MockCloudPolicyClient() {} diff --git a/chrome/browser/policy/cloud/mock_device_management_service.cc b/chrome/browser/policy/cloud/mock_device_management_service.cc index f7836ce..987cf62 100644 --- a/chrome/browser/policy/cloud/mock_device_management_service.cc +++ b/chrome/browser/policy/cloud/mock_device_management_service.cc @@ -116,7 +116,7 @@ ACTION_P2(CreateAsyncMockDeviceManagementJob, service, mock_job) { MockDeviceManagementJob::~MockDeviceManagementJob() {} MockDeviceManagementService::MockDeviceManagementService() - : DeviceManagementService(std::string()) {} + : DeviceManagementService("") {} MockDeviceManagementService::~MockDeviceManagementService() {} diff --git a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc index 321b3732..a801f83 100644 --- a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc +++ b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc @@ -409,10 +409,9 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, ManualOptions) { ProxyPolicyHandler::PROXY_MANUALLY_CONFIGURED_PROXY_SERVER_MODE)); UpdateProviderPolicy(policy); - VerifyProxyPrefs("chromium.org", - std::string(), - "http://chromium.org/override", - ProxyPrefs::MODE_FIXED_SERVERS); + VerifyProxyPrefs( + "chromium.org", "", "http://chromium.org/override", + ProxyPrefs::MODE_FIXED_SERVERS); } TEST_F(ConfigurationPolicyPrefStoreProxyTest, ManualOptionsReversedApplyOrder) { @@ -427,10 +426,9 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, ManualOptionsReversedApplyOrder) { base::Value::CreateStringValue("chromium.org")); UpdateProviderPolicy(policy); - VerifyProxyPrefs("chromium.org", - std::string(), - "http://chromium.org/override", - ProxyPrefs::MODE_FIXED_SERVERS); + VerifyProxyPrefs( + "chromium.org", "", "http://chromium.org/override", + ProxyPrefs::MODE_FIXED_SERVERS); } TEST_F(ConfigurationPolicyPrefStoreProxyTest, ManualOptionsInvalid) { @@ -452,8 +450,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, NoProxyServerMode) { base::Value::CreateIntegerValue( ProxyPolicyHandler::PROXY_SERVER_MODE)); UpdateProviderPolicy(policy); - VerifyProxyPrefs( - std::string(), std::string(), std::string(), ProxyPrefs::MODE_DIRECT); + VerifyProxyPrefs("", "", "", ProxyPrefs::MODE_DIRECT); } TEST_F(ConfigurationPolicyPrefStoreProxyTest, NoProxyModeName) { @@ -461,8 +458,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, NoProxyModeName) { policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, base::Value::CreateStringValue(ProxyPrefs::kDirectProxyModeName)); UpdateProviderPolicy(policy); - VerifyProxyPrefs( - std::string(), std::string(), std::string(), ProxyPrefs::MODE_DIRECT); + VerifyProxyPrefs("", "", "", ProxyPrefs::MODE_DIRECT); } TEST_F(ConfigurationPolicyPrefStoreProxyTest, AutoDetectProxyServerMode) { @@ -472,10 +468,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, AutoDetectProxyServerMode) { base::Value::CreateIntegerValue( ProxyPolicyHandler::PROXY_AUTO_DETECT_PROXY_SERVER_MODE)); UpdateProviderPolicy(policy); - VerifyProxyPrefs(std::string(), - std::string(), - std::string(), - ProxyPrefs::MODE_AUTO_DETECT); + VerifyProxyPrefs("", "", "", ProxyPrefs::MODE_AUTO_DETECT); } TEST_F(ConfigurationPolicyPrefStoreProxyTest, AutoDetectProxyModeName) { @@ -484,10 +477,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, AutoDetectProxyModeName) { base::Value::CreateStringValue( ProxyPrefs::kAutoDetectProxyModeName)); UpdateProviderPolicy(policy); - VerifyProxyPrefs(std::string(), - std::string(), - std::string(), - ProxyPrefs::MODE_AUTO_DETECT); + VerifyProxyPrefs("", "", "", ProxyPrefs::MODE_AUTO_DETECT); } TEST_F(ConfigurationPolicyPrefStoreProxyTest, PacScriptProxyMode) { @@ -498,9 +488,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, PacScriptProxyMode) { base::Value::CreateStringValue( ProxyPrefs::kPacScriptProxyModeName)); UpdateProviderPolicy(policy); - VerifyProxyPrefs(std::string(), - "http://short.org/proxy.pac", - std::string(), + VerifyProxyPrefs("", "http://short.org/proxy.pac", "", ProxyPrefs::MODE_PAC_SCRIPT); } @@ -518,21 +506,15 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, PacScriptProxyModeInvalid) { // for unset properties. TEST_F(ConfigurationPolicyPrefStoreProxyTest, PacScriptProxyModeBug78016) { PolicyMap policy; - policy.Set(key::kProxyServer, - POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_USER, - base::Value::CreateStringValue(std::string())); - policy.Set(key::kProxyPacUrl, - POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_USER, + policy.Set(key::kProxyServer, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, + base::Value::CreateStringValue("")); + policy.Set(key::kProxyPacUrl, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, base::Value::CreateStringValue("http://short.org/proxy.pac")); policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, base::Value::CreateStringValue( ProxyPrefs::kPacScriptProxyModeName)); UpdateProviderPolicy(policy); - VerifyProxyPrefs(std::string(), - "http://short.org/proxy.pac", - std::string(), + VerifyProxyPrefs("", "http://short.org/proxy.pac", "", ProxyPrefs::MODE_PAC_SCRIPT); } @@ -542,8 +524,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, UseSystemProxyServerMode) { base::Value::CreateIntegerValue( ProxyPolicyHandler::PROXY_USE_SYSTEM_PROXY_SERVER_MODE)); UpdateProviderPolicy(policy); - VerifyProxyPrefs( - std::string(), std::string(), std::string(), ProxyPrefs::MODE_SYSTEM); + VerifyProxyPrefs("", "", "", ProxyPrefs::MODE_SYSTEM); } TEST_F(ConfigurationPolicyPrefStoreProxyTest, UseSystemProxyMode) { @@ -551,8 +532,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, UseSystemProxyMode) { policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, base::Value::CreateStringValue(ProxyPrefs::kSystemProxyModeName)); UpdateProviderPolicy(policy); - VerifyProxyPrefs( - std::string(), std::string(), std::string(), ProxyPrefs::MODE_SYSTEM); + VerifyProxyPrefs("", "", "", ProxyPrefs::MODE_SYSTEM); } TEST_F(ConfigurationPolicyPrefStoreProxyTest, @@ -565,10 +545,7 @@ TEST_F(ConfigurationPolicyPrefStoreProxyTest, base::Value::CreateStringValue( ProxyPrefs::kAutoDetectProxyModeName)); UpdateProviderPolicy(policy); - VerifyProxyPrefs(std::string(), - std::string(), - std::string(), - ProxyPrefs::MODE_AUTO_DETECT); + VerifyProxyPrefs("", "", "", ProxyPrefs::MODE_AUTO_DETECT); } TEST_F(ConfigurationPolicyPrefStoreProxyTest, ProxyInvalid) { @@ -791,7 +768,7 @@ TEST_F(ConfigurationPolicyPrefStoreDefaultSearchTest, Disabled) { base::FundamentalValue expected_enabled(false); EXPECT_TRUE(base::Value::Equals(&expected_enabled, value)); EXPECT_TRUE(store_->GetValue(prefs::kDefaultSearchProviderSearchURL, &value)); - base::StringValue expected_search_url((std::string())); + base::StringValue expected_search_url(""); EXPECT_TRUE(base::Value::Equals(&expected_search_url, value)); } @@ -931,10 +908,8 @@ TEST_F(ConfigurationPolicyPrefStorePromptDownloadTest, Default) { TEST_F(ConfigurationPolicyPrefStorePromptDownloadTest, SetDownloadDirectory) { PolicyMap policy; EXPECT_FALSE(store_->GetValue(prefs::kPromptForDownload, NULL)); - policy.Set(key::kDownloadDirectory, - POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_USER, - base::Value::CreateStringValue(std::string())); + policy.Set(key::kDownloadDirectory, POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_USER, base::Value::CreateStringValue("")); UpdateProviderPolicy(policy); // Setting a DownloadDirectory should disable the PromptForDownload pref. diff --git a/chrome/browser/policy/policy_map_unittest.cc b/chrome/browser/policy/policy_map_unittest.cc index 367ce06..a2f6207 100644 --- a/chrome/browser/policy/policy_map_unittest.cc +++ b/chrome/browser/policy/policy_map_unittest.cc @@ -103,13 +103,9 @@ TEST(PolicyMapTest, MergeFrom) { Value::CreateBooleanValue(false)); b.Set(key::kBookmarkBarEnabled, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_MACHINE, Value::CreateBooleanValue(true)); - b.Set(key::kDefaultSearchProviderSearchURL, - POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_MACHINE, - Value::CreateStringValue(std::string())); - b.Set(key::kDisableSpdy, - POLICY_LEVEL_RECOMMENDED, - POLICY_SCOPE_USER, + b.Set(key::kDefaultSearchProviderSearchURL, POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_MACHINE, Value::CreateStringValue("")); + b.Set(key::kDisableSpdy, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER, Value::CreateBooleanValue(true)); a.MergeFrom(b); @@ -125,10 +121,8 @@ TEST(PolicyMapTest, MergeFrom) { c.Set(key::kBookmarkBarEnabled, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_MACHINE, Value::CreateBooleanValue(true)); // POLICY_LEVEL_MANDATORY over POLICY_LEVEL_RECOMMENDED. - c.Set(key::kDefaultSearchProviderSearchURL, - POLICY_LEVEL_MANDATORY, - POLICY_SCOPE_MACHINE, - Value::CreateStringValue(std::string())); + c.Set(key::kDefaultSearchProviderSearchURL, POLICY_LEVEL_MANDATORY, + POLICY_SCOPE_MACHINE, Value::CreateStringValue("")); // Merge new ones. c.Set(key::kDisableSpdy, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER, Value::CreateBooleanValue(true)); diff --git a/chrome/browser/policy/policy_prefs_browsertest.cc b/chrome/browser/policy/policy_prefs_browsertest.cc index 23173bc..bce4fe0 100644 --- a/chrome/browser/policy/policy_prefs_browsertest.cc +++ b/chrome/browser/policy/policy_prefs_browsertest.cc @@ -519,8 +519,8 @@ IN_PROC_BROWSER_TEST_P(PolicyPrefsTest, CheckPolicyIndicators) { // set by policy. PolicyMap policies; UpdateProviderPolicy(policies); - VerifyControlledSettingIndicators( - browser(), indicator_selector, std::string(), std::string(), false); + VerifyControlledSettingIndicators(browser(), indicator_selector, + "", "", false); // Check that the appropriate controlled setting indicator is shown when a // value is enforced by policy. policies.LoadFrom(&(*indicator_test_case)->policy(), diff --git a/chrome/browser/policy/url_blacklist_manager_unittest.cc b/chrome/browser/policy/url_blacklist_manager_unittest.cc index b1f69d1..3e5ac0f 100644 --- a/chrome/browser/policy/url_blacklist_manager_unittest.cc +++ b/chrome/browser/policy/url_blacklist_manager_unittest.cc @@ -240,83 +240,31 @@ INSTANTIATE_TEST_CASE_P( URLBlacklistFilterToComponentsTest, testing::Values( FilterTestParams("google.com", - std::string(), - ".google.com", - true, - 0u, - std::string()), + "", ".google.com", true, 0u, ""), FilterTestParams(".google.com", - std::string(), - "google.com", - false, - 0u, - std::string()), + "", "google.com", false, 0u, ""), FilterTestParams("http://google.com", - "http", - ".google.com", - true, - 0u, - std::string()), + "http", ".google.com", true, 0u, ""), FilterTestParams("google.com/", - std::string(), - ".google.com", - true, - 0u, - "/"), + "", ".google.com", true, 0u, "/"), FilterTestParams("http://google.com:8080/whatever", - "http", - ".google.com", - true, - 8080u, - "/whatever"), + "http", ".google.com", true, 8080u, "/whatever"), FilterTestParams("http://user:pass@google.com:8080/whatever", - "http", - ".google.com", - true, - 8080u, - "/whatever"), + "http", ".google.com", true, 8080u, "/whatever"), FilterTestParams("123.123.123.123", - std::string(), - "123.123.123.123", - false, - 0u, - std::string()), + "", "123.123.123.123", false, 0u, ""), FilterTestParams("https://123.123.123.123", - "https", - "123.123.123.123", - false, - 0u, - std::string()), + "https", "123.123.123.123", false, 0u, ""), FilterTestParams("123.123.123.123/", - std::string(), - "123.123.123.123", - false, - 0u, - "/"), + "", "123.123.123.123", false, 0u, "/"), FilterTestParams("http://123.123.123.123:123/whatever", - "http", - "123.123.123.123", - false, - 123u, - "/whatever"), + "http", "123.123.123.123", false, 123u, "/whatever"), FilterTestParams("*", - std::string(), - std::string(), - true, - 0u, - std::string()), + "", "", true, 0u, ""), FilterTestParams("ftp://*", - "ftp", - std::string(), - true, - 0u, - std::string()), + "ftp", "", true, 0u, ""), FilterTestParams("http://*/whatever", - "http", - std::string(), - true, - 0u, - "/whatever"))); + "http", "", true, 0u, "/whatever"))); TEST_F(URLBlacklistManagerTest, Filtering) { URLBlacklist blacklist; diff --git a/chrome/browser/popup_blocker_browsertest.cc b/chrome/browser/popup_blocker_browsertest.cc index aacbbef..c2e3ede 100644 --- a/chrome/browser/popup_blocker_browsertest.cc +++ b/chrome/browser/popup_blocker_browsertest.cc @@ -55,7 +55,7 @@ class PopupBlockerBrowserTest : public InProcessBrowserTest { // Do a round trip to the renderer first to flush any in-flight IPCs to // create a to-be-blocked window. WebContents* tab = browser->tab_strip_model()->GetActiveWebContents(); - CHECK(content::ExecuteScript(tab, std::string())); + CHECK(content::ExecuteScript(tab, "")); BlockedContentTabHelper* blocked_content_tab_helper = BlockedContentTabHelper::FromWebContents(tab); std::vector<WebContents*> blocked_contents; @@ -127,12 +127,12 @@ IN_PROC_BROWSER_TEST_F(PopupBlockerBrowserTest, MultiplePopups) { IN_PROC_BROWSER_TEST_F(PopupBlockerBrowserTest, AllowPopupThroughContentSetting) { GURL url(GetTestURL()); - browser()->profile()->GetHostContentSettingsMap() - ->SetContentSetting(ContentSettingsPattern::FromURL(url), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTINGS_TYPE_POPUPS, - std::string(), - CONTENT_SETTING_ALLOW); + browser()->profile()->GetHostContentSettingsMap()->SetContentSetting( + ContentSettingsPattern::FromURL(url), + ContentSettingsPattern::Wildcard(), + CONTENT_SETTINGS_TYPE_POPUPS, + "", + CONTENT_SETTING_ALLOW); NavigateAndCheckPopupShown(browser(), url); } diff --git a/chrome/browser/predictors/autocomplete_action_predictor.cc b/chrome/browser/predictors/autocomplete_action_predictor.cc index 184e7a7..cc183c36 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor.cc +++ b/chrome/browser/predictors/autocomplete_action_predictor.cc @@ -148,7 +148,7 @@ void AutocompleteActionPredictor::StartPrerendering( prerender::PrerenderManagerFactory::GetForProfile(profile_)) { content::SessionStorageNamespace* session_storage_namespace = NULL; content::SessionStorageNamespaceMap::const_iterator it = - session_storage_namespace_map.find(std::string()); + session_storage_namespace_map.find(""); if (it != session_storage_namespace_map.end()) session_storage_namespace = it->second; prerender_handle_.reset( diff --git a/chrome/browser/predictors/resource_prefetch_predictor.cc b/chrome/browser/predictors/resource_prefetch_predictor.cc index b37f3a1..a6d7cbd 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor.cc +++ b/chrome/browser/predictors/resource_prefetch_predictor.cc @@ -1012,8 +1012,7 @@ void ResourcePrefetchPredictor::LearnNavigation( } else { bool is_host = key_type == PREFETCH_KEY_TYPE_HOST; PrefetchData empty_data( - !is_host ? PREFETCH_KEY_TYPE_HOST : PREFETCH_KEY_TYPE_URL, - std::string()); + !is_host ? PREFETCH_KEY_TYPE_HOST : PREFETCH_KEY_TYPE_URL , ""); const PrefetchData& host_data = is_host ? cache_entry->second : empty_data; const PrefetchData& url_data = is_host ? empty_data : cache_entry->second; BrowserThread::PostTask( diff --git a/chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc b/chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc index fa5be14..d39e892 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc +++ b/chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc @@ -167,45 +167,34 @@ void ResourcePrefetchPredictorTablesTest::TestDeleteSingleDataPoint() { void ResourcePrefetchPredictorTablesTest::TestUpdateData() { PrefetchData google(PREFETCH_KEY_TYPE_URL, "http://www.google.com"); google.last_visit = base::Time::FromInternalValue(10); - google.resources.push_back(ResourceRow(std::string(), - "http://www.google.com/style.css", - ResourceType::STYLESHEET, - 6, - 2, - 0, - 1.0)); - google.resources.push_back(ResourceRow(std::string(), - "http://www.google.com/image.png", - ResourceType::IMAGE, - 6, - 4, - 1, - 4.2)); - google.resources.push_back(ResourceRow(std::string(), - "http://www.google.com/a.xml", - ResourceType::LAST_TYPE, - 1, - 0, - 0, - 6.1)); - google.resources - .push_back(ResourceRow(std::string(), - "http://www.resources.google.com/script.js", - ResourceType::SCRIPT, - 12, - 0, - 0, - 8.5)); + google.resources.push_back(ResourceRow( + "", + "http://www.google.com/style.css", + ResourceType::STYLESHEET, + 6, 2, 0, 1.0)); + google.resources.push_back(ResourceRow( + "", + "http://www.google.com/image.png", + ResourceType::IMAGE, + 6, 4, 1, 4.2)); + google.resources.push_back(ResourceRow( + "", + "http://www.google.com/a.xml", + ResourceType::LAST_TYPE, + 1, 0, 0, 6.1)); + google.resources.push_back(ResourceRow( + "", + "http://www.resources.google.com/script.js", + ResourceType::SCRIPT, + 12, 0, 0, 8.5)); PrefetchData yahoo(PREFETCH_KEY_TYPE_HOST, "www.yahoo.com"); yahoo.last_visit = base::Time::FromInternalValue(7); - yahoo.resources.push_back(ResourceRow(std::string(), - "http://www.yahoo.com/image.png", - ResourceType::IMAGE, - 120, - 1, - 1, - 10.0)); + yahoo.resources.push_back(ResourceRow( + "", + "http://www.yahoo.com/image.png", + ResourceType::IMAGE, + 120, 1, 1, 10.0)); tables_->UpdateData(google, yahoo); @@ -287,78 +276,59 @@ void ResourcePrefetchPredictorTablesTest::InitializeSampleData() { { // Url data. PrefetchData google(PREFETCH_KEY_TYPE_URL, "http://www.google.com"); google.last_visit = base::Time::FromInternalValue(1); - google.resources.push_back(ResourceRow(std::string(), - "http://www.google.com/style.css", - ResourceType::STYLESHEET, - 5, - 2, - 1, - 1.1)); - google.resources.push_back(ResourceRow(std::string(), - "http://www.google.com/script.js", - ResourceType::SCRIPT, - 4, - 0, - 1, - 2.1)); - google.resources.push_back(ResourceRow(std::string(), - "http://www.google.com/image.png", - ResourceType::IMAGE, - 6, - 3, - 0, - 2.2)); - google.resources.push_back(ResourceRow(std::string(), - "http://www.google.com/a.font", - ResourceType::LAST_TYPE, - 2, - 0, - 0, - 5.1)); - google.resources - .push_back(ResourceRow(std::string(), - "http://www.resources.google.com/script.js", - ResourceType::SCRIPT, - 11, - 0, - 0, - 8.5)); + google.resources.push_back(ResourceRow( + "", + "http://www.google.com/style.css", + ResourceType::STYLESHEET, + 5, 2, 1, 1.1)); + google.resources.push_back(ResourceRow( + "", + "http://www.google.com/script.js", + ResourceType::SCRIPT, + 4, 0, 1, 2.1)); + google.resources.push_back(ResourceRow( + "", + "http://www.google.com/image.png", + ResourceType::IMAGE, + 6, 3, 0, 2.2)); + google.resources.push_back(ResourceRow( + "", + "http://www.google.com/a.font", + ResourceType::LAST_TYPE, + 2, 0, 0, 5.1)); + google.resources.push_back(ResourceRow( + "", + "http://www.resources.google.com/script.js", + ResourceType::SCRIPT, + 11, 0, 0, 8.5)); PrefetchData reddit(PREFETCH_KEY_TYPE_URL, "http://www.reddit.com"); reddit.last_visit = base::Time::FromInternalValue(2); - reddit.resources - .push_back(ResourceRow(std::string(), - "http://reddit-resource.com/script1.js", - ResourceType::SCRIPT, - 4, - 0, - 1, - 1.0)); - reddit.resources - .push_back(ResourceRow(std::string(), - "http://reddit-resource.com/script2.js", - ResourceType::SCRIPT, - 2, - 0, - 0, - 2.1)); + reddit.resources.push_back(ResourceRow( + "", + "http://reddit-resource.com/script1.js", + ResourceType::SCRIPT, + 4, 0, 1, 1.0)); + reddit.resources.push_back(ResourceRow( + "", + "http://reddit-resource.com/script2.js", + ResourceType::SCRIPT, + 2, 0, 0, 2.1)); PrefetchData yahoo(PREFETCH_KEY_TYPE_URL, "http://www.yahoo.com"); yahoo.last_visit = base::Time::FromInternalValue(3); - yahoo.resources.push_back(ResourceRow(std::string(), - "http://www.google.com/image.png", - ResourceType::IMAGE, - 20, - 1, - 0, - 10.0)); + yahoo.resources.push_back(ResourceRow( + "", + "http://www.google.com/image.png", + ResourceType::IMAGE, + 20, 1, 0, 10.0)); test_url_data_.clear(); test_url_data_.insert(std::make_pair("http://www.google.com", google)); test_url_data_.insert(std::make_pair("http://www.reddit.com", reddit)); test_url_data_.insert(std::make_pair("http://www.yahoo.com", yahoo)); - PrefetchData empty_host_data(PREFETCH_KEY_TYPE_HOST, std::string()); + PrefetchData empty_host_data(PREFETCH_KEY_TYPE_HOST, ""); tables_->UpdateData(google, empty_host_data); tables_->UpdateData(reddit, empty_host_data); tables_->UpdateData(yahoo, empty_host_data); @@ -367,61 +337,45 @@ void ResourcePrefetchPredictorTablesTest::InitializeSampleData() { { // Host data. PrefetchData facebook(PREFETCH_KEY_TYPE_HOST, "www.facebook.com"); facebook.last_visit = base::Time::FromInternalValue(4); - facebook.resources - .push_back(ResourceRow(std::string(), - "http://www.facebook.com/style.css", - ResourceType::STYLESHEET, - 5, - 2, - 1, - 1.1)); - facebook.resources - .push_back(ResourceRow(std::string(), - "http://www.facebook.com/script.js", - ResourceType::SCRIPT, - 4, - 0, - 1, - 2.1)); - facebook.resources - .push_back(ResourceRow(std::string(), - "http://www.facebook.com/image.png", - ResourceType::IMAGE, - 6, - 3, - 0, - 2.2)); - facebook.resources.push_back(ResourceRow(std::string(), - "http://www.facebook.com/a.font", - ResourceType::LAST_TYPE, - 2, - 0, - 0, - 5.1)); - facebook.resources - .push_back(ResourceRow(std::string(), - "http://www.resources.facebook.com/script.js", - ResourceType::SCRIPT, - 11, - 0, - 0, - 8.5)); + facebook.resources.push_back(ResourceRow( + "", + "http://www.facebook.com/style.css", + ResourceType::STYLESHEET, + 5, 2, 1, 1.1)); + facebook.resources.push_back(ResourceRow( + "", + "http://www.facebook.com/script.js", + ResourceType::SCRIPT, + 4, 0, 1, 2.1)); + facebook.resources.push_back(ResourceRow( + "", + "http://www.facebook.com/image.png", + ResourceType::IMAGE, + 6, 3, 0, 2.2)); + facebook.resources.push_back(ResourceRow( + "", + "http://www.facebook.com/a.font", + ResourceType::LAST_TYPE, + 2, 0, 0, 5.1)); + facebook.resources.push_back(ResourceRow( + "", + "http://www.resources.facebook.com/script.js", + ResourceType::SCRIPT, + 11, 0, 0, 8.5)); PrefetchData yahoo(PREFETCH_KEY_TYPE_HOST, "www.yahoo.com"); yahoo.last_visit = base::Time::FromInternalValue(5); - yahoo.resources.push_back(ResourceRow(std::string(), - "http://www.google.com/image.png", - ResourceType::IMAGE, - 20, - 1, - 0, - 10.0)); + yahoo.resources.push_back(ResourceRow( + "", + "http://www.google.com/image.png", + ResourceType::IMAGE, + 20, 1, 0, 10.0)); test_host_data_.clear(); test_host_data_.insert(std::make_pair("www.facebook.com", facebook)); test_host_data_.insert(std::make_pair("www.yahoo.com", yahoo)); - PrefetchData empty_url_data(PREFETCH_KEY_TYPE_URL, std::string()); + PrefetchData empty_url_data(PREFETCH_KEY_TYPE_URL, ""); tables_->UpdateData(empty_url_data, facebook); tables_->UpdateData(empty_url_data, yahoo); } diff --git a/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc b/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc index b6203da..891b70c 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc +++ b/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc @@ -176,8 +176,9 @@ ResourcePrefetchPredictorTest::ResourcePrefetchPredictorTest() profile_(new TestingProfile()), predictor_(NULL), mock_tables_(new StrictMock<MockResourcePrefetchPredictorTables>()), - empty_url_data_(PREFETCH_KEY_TYPE_URL, std::string()), - empty_host_data_(PREFETCH_KEY_TYPE_HOST, std::string()) {} + empty_url_data_(PREFETCH_KEY_TYPE_URL, ""), + empty_host_data_(PREFETCH_KEY_TYPE_HOST, "") { +} ResourcePrefetchPredictorTest::~ResourcePrefetchPredictorTest() { profile_.reset(NULL); @@ -213,70 +214,52 @@ void ResourcePrefetchPredictorTest::InitializeSampleData() { { // Url data. PrefetchData google(PREFETCH_KEY_TYPE_URL, "http://www.google.com/"); google.last_visit = base::Time::FromInternalValue(1); - google.resources.push_back(ResourceRow(std::string(), - "http://google.com/style1.css", - ResourceType::STYLESHEET, - 3, - 2, - 1, - 1.0)); - google.resources.push_back(ResourceRow(std::string(), - "http://google.com/script3.js", - ResourceType::SCRIPT, - 4, - 0, - 1, - 2.1)); - google.resources.push_back(ResourceRow(std::string(), - "http://google.com/script4.js", - ResourceType::SCRIPT, - 11, - 0, - 0, - 2.1)); - google.resources.push_back(ResourceRow(std::string(), - "http://google.com/image1.png", - ResourceType::IMAGE, - 6, - 3, - 0, - 2.2)); - google.resources.push_back(ResourceRow(std::string(), - "http://google.com/a.font", - ResourceType::LAST_TYPE, - 2, - 0, - 0, - 5.1)); + google.resources.push_back(ResourceRow( + "", + "http://google.com/style1.css", + ResourceType::STYLESHEET, + 3, 2, 1, 1.0)); + google.resources.push_back(ResourceRow( + "", + "http://google.com/script3.js", + ResourceType::SCRIPT, + 4, 0, 1, 2.1)); + google.resources.push_back(ResourceRow( + "", + "http://google.com/script4.js", + ResourceType::SCRIPT, + 11, 0, 0, 2.1)); + google.resources.push_back(ResourceRow( + "", + "http://google.com/image1.png", + ResourceType::IMAGE, + 6, 3, 0, 2.2)); + google.resources.push_back(ResourceRow( + "", + "http://google.com/a.font", + ResourceType::LAST_TYPE, + 2, 0, 0, 5.1)); PrefetchData reddit(PREFETCH_KEY_TYPE_URL, "http://www.reddit.com/"); reddit.last_visit = base::Time::FromInternalValue(2); - reddit.resources - .push_back(ResourceRow(std::string(), - "http://reddit-resource.com/script1.js", - ResourceType::SCRIPT, - 4, - 0, - 1, - 1.0)); - reddit.resources - .push_back(ResourceRow(std::string(), - "http://reddit-resource.com/script2.js", - ResourceType::SCRIPT, - 2, - 0, - 0, - 2.1)); + reddit.resources.push_back(ResourceRow( + "", + "http://reddit-resource.com/script1.js", + ResourceType::SCRIPT, + 4, 0, 1, 1.0)); + reddit.resources.push_back(ResourceRow( + "", + "http://reddit-resource.com/script2.js", + ResourceType::SCRIPT, + 2, 0, 0, 2.1)); PrefetchData yahoo(PREFETCH_KEY_TYPE_URL, "http://www.yahoo.com/"); yahoo.last_visit = base::Time::FromInternalValue(3); - yahoo.resources.push_back(ResourceRow(std::string(), - "http://google.com/image.png", - ResourceType::IMAGE, - 20, - 1, - 0, - 10.0)); + yahoo.resources.push_back(ResourceRow( + "", + "http://google.com/image.png", + ResourceType::IMAGE, + 20, 1, 0, 10.0)); test_url_data_.clear(); test_url_data_.insert(std::make_pair("http://www.google.com/", google)); @@ -287,55 +270,39 @@ void ResourcePrefetchPredictorTest::InitializeSampleData() { { // Host data. PrefetchData facebook(PREFETCH_KEY_TYPE_HOST, "www.facebook.com"); facebook.last_visit = base::Time::FromInternalValue(4); - facebook.resources - .push_back(ResourceRow(std::string(), - "http://www.facebook.com/style.css", - ResourceType::STYLESHEET, - 5, - 2, - 1, - 1.1)); - facebook.resources - .push_back(ResourceRow(std::string(), - "http://www.facebook.com/script.js", - ResourceType::SCRIPT, - 4, - 0, - 1, - 2.1)); - facebook.resources - .push_back(ResourceRow(std::string(), - "http://www.facebook.com/image.png", - ResourceType::IMAGE, - 6, - 3, - 0, - 2.2)); - facebook.resources.push_back(ResourceRow(std::string(), - "http://www.facebook.com/a.font", - ResourceType::LAST_TYPE, - 2, - 0, - 0, - 5.1)); - facebook.resources - .push_back(ResourceRow(std::string(), - "http://www.resources.facebook.com/script.js", - ResourceType::SCRIPT, - 11, - 0, - 0, - 8.5)); + facebook.resources.push_back(ResourceRow( + "", + "http://www.facebook.com/style.css", + ResourceType::STYLESHEET, + 5, 2, 1, 1.1)); + facebook.resources.push_back(ResourceRow( + "", + "http://www.facebook.com/script.js", + ResourceType::SCRIPT, + 4, 0, 1, 2.1)); + facebook.resources.push_back(ResourceRow( + "", + "http://www.facebook.com/image.png", + ResourceType::IMAGE, + 6, 3, 0, 2.2)); + facebook.resources.push_back(ResourceRow( + "", + "http://www.facebook.com/a.font", + ResourceType::LAST_TYPE, + 2, 0, 0, 5.1)); + facebook.resources.push_back(ResourceRow( + "", + "http://www.resources.facebook.com/script.js", + ResourceType::SCRIPT, + 11, 0, 0, 8.5)); PrefetchData yahoo(PREFETCH_KEY_TYPE_HOST, "www.yahoo.com"); yahoo.last_visit = base::Time::FromInternalValue(5); - yahoo.resources.push_back(ResourceRow(std::string(), - "http://google.com/image.png", - ResourceType::IMAGE, - 20, - 1, - 0, - 10.0)); + yahoo.resources.push_back(ResourceRow( + "", + "http://google.com/image.png", + ResourceType::IMAGE, + 20, 1, 0, 10.0)); test_host_data_.clear(); test_host_data_.insert(std::make_pair("www.facebook.com", facebook)); @@ -376,14 +343,9 @@ TEST_F(ResourcePrefetchPredictorTest, NavigationNotRecorded) { // Single navigation but history count is low, so should not record. AddUrlToHistory("http://www.google.com", 1); - URLRequestSummary main_frame = - CreateURLRequestSummary(1, - 1, - "http://www.google.com", - "http://www.google.com", - ResourceType::MAIN_FRAME, - std::string(), - false); + URLRequestSummary main_frame = CreateURLRequestSummary( + 1, 1, "http://www.google.com", "http://www.google.com", + ResourceType::MAIN_FRAME, "", false); predictor_->RecordURLRequest(main_frame); EXPECT_EQ(1, static_cast<int>(predictor_->inflight_navigations_.size())); @@ -402,27 +364,15 @@ TEST_F(ResourcePrefetchPredictorTest, NavigationNotRecorded) { predictor_->RecordUrlResponse(resource3); PrefetchData host_data(PREFETCH_KEY_TYPE_HOST, "www.google.com"); - host_data.resources.push_back(ResourceRow(std::string(), - "http://google.com/style1.css", - ResourceType::STYLESHEET, - 1, - 0, - 0, - 1.0)); - host_data.resources.push_back(ResourceRow(std::string(), - "http://google.com/script1.js", - ResourceType::SCRIPT, - 1, - 0, - 0, - 2.0)); - host_data.resources.push_back(ResourceRow(std::string(), - "http://google.com/script2.js", - ResourceType::SCRIPT, - 1, - 0, - 0, - 3.0)); + host_data.resources.push_back(ResourceRow( + "", "http://google.com/style1.css", + ResourceType::STYLESHEET, 1, 0, 0, 1.0)); + host_data.resources.push_back(ResourceRow( + "", "http://google.com/script1.js", + ResourceType::SCRIPT, 1, 0, 0, 2.0)); + host_data.resources.push_back(ResourceRow( + "", "http://google.com/script2.js", + ResourceType::SCRIPT, 1, 0, 0, 3.0)); EXPECT_CALL(*mock_tables_, UpdateData(empty_url_data_, host_data)); predictor_->OnNavigationComplete(main_frame.navigation_id); @@ -434,14 +384,9 @@ TEST_F(ResourcePrefetchPredictorTest, NavigationUrlNotInDB) { // resources and also for number of resources saved. AddUrlToHistory("http://www.google.com", 4); - URLRequestSummary main_frame = - CreateURLRequestSummary(1, - 1, - "http://www.google.com", - "http://www.google.com", - ResourceType::MAIN_FRAME, - std::string(), - false); + URLRequestSummary main_frame = CreateURLRequestSummary( + 1, 1, "http://www.google.com", "http://www.google.com", + ResourceType::MAIN_FRAME, "", false); predictor_->RecordURLRequest(main_frame); EXPECT_EQ(1, static_cast<int>(predictor_->inflight_navigations_.size())); @@ -479,34 +424,18 @@ TEST_F(ResourcePrefetchPredictorTest, NavigationUrlNotInDB) { resource7.resource_type); PrefetchData url_data(PREFETCH_KEY_TYPE_URL, "http://www.google.com/"); - url_data.resources.push_back(ResourceRow(std::string(), - "http://google.com/style1.css", - ResourceType::STYLESHEET, - 1, - 0, - 0, - 1.0)); - url_data.resources.push_back(ResourceRow(std::string(), - "http://google.com/script1.js", - ResourceType::SCRIPT, - 1, - 0, - 0, - 2.0)); - url_data.resources.push_back(ResourceRow(std::string(), - "http://google.com/script2.js", - ResourceType::SCRIPT, - 1, - 0, - 0, - 3.0)); - url_data.resources.push_back(ResourceRow(std::string(), - "http://google.com/style2.css", - ResourceType::STYLESHEET, - 1, - 0, - 0, - 7.0)); + url_data.resources.push_back(ResourceRow( + "", "http://google.com/style1.css", + ResourceType::STYLESHEET, 1, 0, 0, 1.0)); + url_data.resources.push_back(ResourceRow( + "", "http://google.com/script1.js", + ResourceType::SCRIPT, 1, 0, 0, 2.0)); + url_data.resources.push_back(ResourceRow( + "", "http://google.com/script2.js", + ResourceType::SCRIPT, 1, 0, 0, 3.0)); + url_data.resources.push_back(ResourceRow( + "", "http://google.com/style2.css", + ResourceType::STYLESHEET, 1, 0, 0, 7.0)); EXPECT_CALL(*mock_tables_, UpdateData(url_data, empty_host_data_)); PrefetchData host_data(PREFETCH_KEY_TYPE_HOST, "www.google.com"); @@ -532,14 +461,9 @@ TEST_F(ResourcePrefetchPredictorTest, NavigationUrlInDB) { EXPECT_EQ(3, static_cast<int>(predictor_->url_table_cache_->size())); EXPECT_EQ(2, static_cast<int>(predictor_->host_table_cache_->size())); - URLRequestSummary main_frame = - CreateURLRequestSummary(1, - 1, - "http://www.google.com", - "http://www.google.com", - ResourceType::MAIN_FRAME, - std::string(), - false); + URLRequestSummary main_frame = CreateURLRequestSummary( + 1, 1, "http://www.google.com", "http://www.google.com", + ResourceType::MAIN_FRAME, "", false); predictor_->RecordURLRequest(main_frame); EXPECT_EQ(1, static_cast<int>(predictor_->inflight_navigations_.size())); @@ -577,34 +501,18 @@ TEST_F(ResourcePrefetchPredictorTest, NavigationUrlInDB) { resource7.resource_type); PrefetchData url_data(PREFETCH_KEY_TYPE_URL, "http://www.google.com/"); - url_data.resources.push_back(ResourceRow(std::string(), - "http://google.com/style1.css", - ResourceType::STYLESHEET, - 4, - 2, - 0, - 1.0)); - url_data.resources.push_back(ResourceRow(std::string(), - "http://google.com/script1.js", - ResourceType::SCRIPT, - 1, - 0, - 0, - 2.0)); - url_data.resources.push_back(ResourceRow(std::string(), - "http://google.com/script4.js", - ResourceType::SCRIPT, - 11, - 1, - 1, - 2.1)); - url_data.resources.push_back(ResourceRow(std::string(), - "http://google.com/script2.js", - ResourceType::SCRIPT, - 1, - 0, - 0, - 3.0)); + url_data.resources.push_back(ResourceRow( + "", "http://google.com/style1.css", + ResourceType::STYLESHEET, 4, 2, 0, 1.0)); + url_data.resources.push_back(ResourceRow( + "", "http://google.com/script1.js", + ResourceType::SCRIPT, 1, 0, 0, 2.0)); + url_data.resources.push_back(ResourceRow( + "", "http://google.com/script4.js", + ResourceType::SCRIPT, 11, 1, 1, 2.1)); + url_data.resources.push_back(ResourceRow( + "", "http://google.com/script2.js", + ResourceType::SCRIPT, 1, 0, 0, 3.0)); EXPECT_CALL(*mock_tables_, UpdateData(url_data, empty_host_data_)); EXPECT_CALL(*mock_tables_, @@ -612,34 +520,18 @@ TEST_F(ResourcePrefetchPredictorTest, NavigationUrlInDB) { PREFETCH_KEY_TYPE_HOST)); PrefetchData host_data(PREFETCH_KEY_TYPE_HOST, "www.google.com"); - host_data.resources.push_back(ResourceRow(std::string(), - "http://google.com/style1.css", - ResourceType::STYLESHEET, - 1, - 0, - 0, - 1.0)); - host_data.resources.push_back(ResourceRow(std::string(), - "http://google.com/script1.js", - ResourceType::SCRIPT, - 1, - 0, - 0, - 2.0)); - host_data.resources.push_back(ResourceRow(std::string(), - "http://google.com/script2.js", - ResourceType::SCRIPT, - 1, - 0, - 0, - 3.0)); - host_data.resources.push_back(ResourceRow(std::string(), - "http://google.com/style2.css", - ResourceType::STYLESHEET, - 1, - 0, - 0, - 7.0)); + host_data.resources.push_back(ResourceRow( + "", "http://google.com/style1.css", + ResourceType::STYLESHEET, 1, 0, 0, 1.0)); + host_data.resources.push_back(ResourceRow( + "", "http://google.com/script1.js", + ResourceType::SCRIPT, 1, 0, 0, 2.0)); + host_data.resources.push_back(ResourceRow( + "", "http://google.com/script2.js", + ResourceType::SCRIPT, 1, 0, 0, 3.0)); + host_data.resources.push_back(ResourceRow( + "", "http://google.com/style2.css", + ResourceType::STYLESHEET, 1, 0, 0, 7.0)); EXPECT_CALL(*mock_tables_, UpdateData(empty_url_data_, host_data)); predictor_->OnNavigationComplete(main_frame.navigation_id); @@ -660,14 +552,9 @@ TEST_F(ResourcePrefetchPredictorTest, NavigationUrlNotInDBAndDBFull) { EXPECT_EQ(3, static_cast<int>(predictor_->url_table_cache_->size())); EXPECT_EQ(2, static_cast<int>(predictor_->host_table_cache_->size())); - URLRequestSummary main_frame = - CreateURLRequestSummary(1, - 1, - "http://www.nike.com", - "http://www.nike.com", - ResourceType::MAIN_FRAME, - std::string(), - false); + URLRequestSummary main_frame = CreateURLRequestSummary( + 1, 1, "http://www.nike.com", "http://www.nike.com", + ResourceType::MAIN_FRAME, "", false); predictor_->RecordURLRequest(main_frame); EXPECT_EQ(1, static_cast<int>(predictor_->inflight_navigations_.size())); @@ -688,20 +575,12 @@ TEST_F(ResourcePrefetchPredictorTest, NavigationUrlNotInDBAndDBFull) { PREFETCH_KEY_TYPE_HOST)); PrefetchData url_data(PREFETCH_KEY_TYPE_URL, "http://www.nike.com/"); - url_data.resources.push_back(ResourceRow(std::string(), - "http://nike.com/style1.css", - ResourceType::STYLESHEET, - 1, - 0, - 0, - 1.0)); - url_data.resources.push_back(ResourceRow(std::string(), - "http://nike.com/image2.png", - ResourceType::IMAGE, - 1, - 0, - 0, - 2.0)); + url_data.resources.push_back(ResourceRow( + "", "http://nike.com/style1.css", + ResourceType::STYLESHEET, 1, 0, 0, 1.0)); + url_data.resources.push_back(ResourceRow( + "", "http://nike.com/image2.png", + ResourceType::IMAGE, 1, 0, 0, 2.0)); EXPECT_CALL(*mock_tables_, UpdateData(url_data, empty_host_data_)); PrefetchData host_data(PREFETCH_KEY_TYPE_HOST, "www.nike.com"); @@ -768,27 +647,15 @@ TEST_F(ResourcePrefetchPredictorTest, DeleteUrls) { } TEST_F(ResourcePrefetchPredictorTest, OnMainFrameRequest) { - URLRequestSummary summary1 = CreateURLRequestSummary(1, - 1, - "http://www.google.com", - "http://www.google.com", - ResourceType::MAIN_FRAME, - std::string(), - false); - URLRequestSummary summary2 = CreateURLRequestSummary(1, - 2, - "http://www.google.com", - "http://www.google.com", - ResourceType::MAIN_FRAME, - std::string(), - false); - URLRequestSummary summary3 = CreateURLRequestSummary(2, - 1, - "http://www.yahoo.com", - "http://www.yahoo.com", - ResourceType::MAIN_FRAME, - std::string(), - false); + URLRequestSummary summary1 = CreateURLRequestSummary( + 1, 1, "http://www.google.com", "http://www.google.com", + ResourceType::MAIN_FRAME, "", false); + URLRequestSummary summary2 = CreateURLRequestSummary( + 1, 2, "http://www.google.com", "http://www.google.com", + ResourceType::MAIN_FRAME, "", false); + URLRequestSummary summary3 = CreateURLRequestSummary( + 2, 1, "http://www.yahoo.com", "http://www.yahoo.com", + ResourceType::MAIN_FRAME, "", false); predictor_->OnMainFrameRequest(summary1); EXPECT_EQ(1, static_cast<int>(predictor_->inflight_navigations_.size())); @@ -798,20 +665,12 @@ TEST_F(ResourcePrefetchPredictorTest, OnMainFrameRequest) { EXPECT_EQ(3, static_cast<int>(predictor_->inflight_navigations_.size())); // Insert anther with same navigation id. It should replace. - URLRequestSummary summary4 = CreateURLRequestSummary(1, - 1, - "http://www.nike.com", - "http://www.nike.com", - ResourceType::MAIN_FRAME, - std::string(), - false); - URLRequestSummary summary5 = CreateURLRequestSummary(1, - 2, - "http://www.google.com", - "http://www.google.com", - ResourceType::MAIN_FRAME, - std::string(), - false); + URLRequestSummary summary4 = CreateURLRequestSummary( + 1, 1, "http://www.nike.com", "http://www.nike.com", + ResourceType::MAIN_FRAME, "", false); + URLRequestSummary summary5 = CreateURLRequestSummary( + 1, 2, "http://www.google.com", "http://www.google.com", + ResourceType::MAIN_FRAME, "", false); predictor_->OnMainFrameRequest(summary4); EXPECT_EQ(3, static_cast<int>(predictor_->inflight_navigations_.size())); @@ -822,13 +681,9 @@ TEST_F(ResourcePrefetchPredictorTest, OnMainFrameRequest) { predictor_->OnMainFrameRequest(summary5); EXPECT_EQ(3, static_cast<int>(predictor_->inflight_navigations_.size())); - URLRequestSummary summary6 = CreateURLRequestSummary(3, - 1, - "http://www.shoes.com", - "http://www.shoes.com", - ResourceType::MAIN_FRAME, - std::string(), - false); + URLRequestSummary summary6 = CreateURLRequestSummary( + 3, 1, "http://www.shoes.com", "http://www.shoes.com", + ResourceType::MAIN_FRAME, "", false); predictor_->OnMainFrameRequest(summary6); EXPECT_EQ(3, static_cast<int>(predictor_->inflight_navigations_.size())); @@ -841,27 +696,15 @@ TEST_F(ResourcePrefetchPredictorTest, OnMainFrameRequest) { } TEST_F(ResourcePrefetchPredictorTest, OnMainFrameRedirect) { - URLRequestSummary summary1 = CreateURLRequestSummary(1, - 1, - "http://www.google.com", - "http://www.google.com", - ResourceType::MAIN_FRAME, - std::string(), - false); - URLRequestSummary summary2 = CreateURLRequestSummary(1, - 2, - "http://www.google.com", - "http://www.google.com", - ResourceType::MAIN_FRAME, - std::string(), - false); - URLRequestSummary summary3 = CreateURLRequestSummary(2, - 1, - "http://www.yahoo.com", - "http://www.yahoo.com", - ResourceType::MAIN_FRAME, - std::string(), - false); + URLRequestSummary summary1 = CreateURLRequestSummary( + 1, 1, "http://www.google.com", "http://www.google.com", + ResourceType::MAIN_FRAME, "", false); + URLRequestSummary summary2 = CreateURLRequestSummary( + 1, 2, "http://www.google.com", "http://www.google.com", + ResourceType::MAIN_FRAME, "", false); + URLRequestSummary summary3 = CreateURLRequestSummary( + 2, 1, "http://www.yahoo.com", "http://www.yahoo.com", + ResourceType::MAIN_FRAME, "", false); predictor_->OnMainFrameRedirect(summary1); EXPECT_TRUE(predictor_->inflight_navigations_.empty()); @@ -888,14 +731,9 @@ TEST_F(ResourcePrefetchPredictorTest, OnSubresourceResponse) { EXPECT_TRUE(predictor_->inflight_navigations_.empty()); // Add an inflight navigation. - URLRequestSummary main_frame1 = - CreateURLRequestSummary(1, - 1, - "http://www.google.com", - "http://www.google.com", - ResourceType::MAIN_FRAME, - std::string(), - false); + URLRequestSummary main_frame1 = CreateURLRequestSummary( + 1, 1, "http://www.google.com", "http://www.google.com", + ResourceType::MAIN_FRAME, "", false); predictor_->OnMainFrameRequest(main_frame1); EXPECT_EQ(1, static_cast<int>(predictor_->inflight_navigations_.size())); diff --git a/chrome/browser/predictors/resource_prefetcher_unittest.cc b/chrome/browser/predictors/resource_prefetcher_unittest.cc index 865c8af..9d5ef5a 100644 --- a/chrome/browser/predictors/resource_prefetcher_unittest.cc +++ b/chrome/browser/predictors/resource_prefetcher_unittest.cc @@ -111,8 +111,7 @@ class ResourcePrefetcherTest : public testing::Test { void OnReceivedRedirect(const std::string& url) { - prefetcher_->OnReceivedRedirect( - GetInFlightRequest(url), GURL(std::string()), NULL); + prefetcher_->OnReceivedRedirect(GetInFlightRequest(url), GURL(""), NULL); } void OnAuthRequired(const std::string& url) { prefetcher_->OnAuthRequired(GetInFlightRequest(url), NULL); diff --git a/chrome/browser/prefs/command_line_pref_store_unittest.cc b/chrome/browser/prefs/command_line_pref_store_unittest.cc index 1e23383..5d2c939 100644 --- a/chrome/browser/prefs/command_line_pref_store_unittest.cc +++ b/chrome/browser/prefs/command_line_pref_store_unittest.cc @@ -116,7 +116,7 @@ TEST(CommandLinePrefStoreTest, MultipleSwitches) { ASSERT_EQ(Value::TYPE_DICTIONARY, value->GetType()); ProxyConfigDictionary dict(static_cast<const DictionaryValue*>(value)); - std::string string_result; + std::string string_result = ""; ASSERT_TRUE(dict.GetProxyServer(&string_result)); EXPECT_EQ("proxy", string_result); @@ -172,9 +172,9 @@ TEST(CommandLinePrefStoreTest, ManualProxyModeInference) { store2->VerifyProxyMode(ProxyPrefs::MODE_PAC_SCRIPT); CommandLine cl3(CommandLine::NO_PROGRAM); - cl3.AppendSwitchASCII(switches::kProxyServer, std::string()); + cl3.AppendSwitchASCII(switches::kProxyServer, ""); scoped_refptr<TestCommandLinePrefStore> store3 = - new TestCommandLinePrefStore(&cl3); + new TestCommandLinePrefStore(&cl3); store3->VerifyProxyMode(ProxyPrefs::MODE_DIRECT); } diff --git a/chrome/browser/prefs/proxy_config_dictionary.cc b/chrome/browser/prefs/proxy_config_dictionary.cc index b6db822..a99fa7c 100644 --- a/chrome/browser/prefs/proxy_config_dictionary.cc +++ b/chrome/browser/prefs/proxy_config_dictionary.cc @@ -67,20 +67,12 @@ bool ProxyConfigDictionary::HasBypassList() const { // static DictionaryValue* ProxyConfigDictionary::CreateDirect() { - return CreateDictionary(ProxyPrefs::MODE_DIRECT, - std::string(), - false, - std::string(), - std::string()); + return CreateDictionary(ProxyPrefs::MODE_DIRECT, "", false, "", ""); } // static DictionaryValue* ProxyConfigDictionary::CreateAutoDetect() { - return CreateDictionary(ProxyPrefs::MODE_AUTO_DETECT, - std::string(), - false, - std::string(), - std::string()); + return CreateDictionary(ProxyPrefs::MODE_AUTO_DETECT, "", false, "", ""); } // static @@ -88,10 +80,7 @@ DictionaryValue* ProxyConfigDictionary::CreatePacScript( const std::string& pac_url, bool pac_mandatory) { return CreateDictionary(ProxyPrefs::MODE_PAC_SCRIPT, - pac_url, - pac_mandatory, - std::string(), - std::string()); + pac_url, pac_mandatory, "", ""); } // static @@ -99,11 +88,8 @@ DictionaryValue* ProxyConfigDictionary::CreateFixedServers( const std::string& proxy_server, const std::string& bypass_list) { if (!proxy_server.empty()) { - return CreateDictionary(ProxyPrefs::MODE_FIXED_SERVERS, - std::string(), - false, - proxy_server, - bypass_list); + return CreateDictionary( + ProxyPrefs::MODE_FIXED_SERVERS, "", false, proxy_server, bypass_list); } else { return CreateDirect(); } @@ -111,11 +97,7 @@ DictionaryValue* ProxyConfigDictionary::CreateFixedServers( // static DictionaryValue* ProxyConfigDictionary::CreateSystem() { - return CreateDictionary(ProxyPrefs::MODE_SYSTEM, - std::string(), - false, - std::string(), - std::string()); + return CreateDictionary(ProxyPrefs::MODE_SYSTEM, "", false, "", ""); } // static diff --git a/chrome/browser/prefs/proxy_policy_unittest.cc b/chrome/browser/prefs/proxy_policy_unittest.cc index 512e514..ec51894 100644 --- a/chrome/browser/prefs/proxy_policy_unittest.cc +++ b/chrome/browser/prefs/proxy_policy_unittest.cc @@ -68,9 +68,9 @@ void assertBypassList(const ProxyConfigDictionary& dict, void assertProxyModeWithoutParams(const ProxyConfigDictionary& dict, ProxyPrefs::ProxyMode proxy_mode) { assertProxyMode(dict, proxy_mode); - assertProxyServer(dict, std::string()); - assertPacUrl(dict, std::string()); - assertBypassList(dict, std::string()); + assertProxyServer(dict, ""); + assertPacUrl(dict, ""); + assertBypassList(dict, ""); } } // namespace @@ -130,7 +130,7 @@ TEST_F(ProxyPolicyTest, OverridesCommandLineOptions) { ProxyConfigDictionary dict(prefs->GetDictionary(prefs::kProxy)); assertProxyMode(dict, ProxyPrefs::MODE_FIXED_SERVERS); assertProxyServer(dict, "789"); - assertPacUrl(dict, std::string()); + assertPacUrl(dict, ""); assertBypassList(dict, "123"); // Try a second time time with the managed PrefStore in place, the @@ -140,7 +140,7 @@ TEST_F(ProxyPolicyTest, OverridesCommandLineOptions) { ProxyConfigDictionary dict2(prefs->GetDictionary(prefs::kProxy)); assertProxyMode(dict2, ProxyPrefs::MODE_FIXED_SERVERS); assertProxyServer(dict2, "ghi"); - assertPacUrl(dict2, std::string()); + assertPacUrl(dict2, ""); assertBypassList(dict2, "abc"); } @@ -160,7 +160,7 @@ TEST_F(ProxyPolicyTest, OverridesUnrelatedCommandLineOptions) { ProxyConfigDictionary dict(prefs->GetDictionary(prefs::kProxy)); assertProxyMode(dict, ProxyPrefs::MODE_FIXED_SERVERS); assertProxyServer(dict, "789"); - assertPacUrl(dict, std::string()); + assertPacUrl(dict, ""); assertBypassList(dict, "123"); // Try a second time time with the managed PrefStore in place, the diff --git a/chrome/browser/prefs/session_startup_pref.cc b/chrome/browser/prefs/session_startup_pref.cc index fbbf62f..d822cc0 100644 --- a/chrome/browser/prefs/session_startup_pref.cc +++ b/chrome/browser/prefs/session_startup_pref.cc @@ -45,7 +45,7 @@ void URLListToPref(const base::ListValue* url_list, SessionStartupPref* pref) { for (size_t i = 0; i < url_list->GetSize(); ++i) { std::string url_text; if (url_list->GetString(i, &url_text)) { - GURL fixed_url = URLFixerUpper::FixupURL(url_text, std::string()); + GURL fixed_url = URLFixerUpper::FixupURL(url_text, ""); pref->urls.push_back(fixed_url); } } diff --git a/chrome/browser/prerender/prerender_contents.cc b/chrome/browser/prerender/prerender_contents.cc index 508ec89..ff32646 100644 --- a/chrome/browser/prerender/prerender_contents.cc +++ b/chrome/browser/prerender/prerender_contents.cc @@ -465,8 +465,8 @@ WebContents* PrerenderContents::CreateWebContents( // TODO(ajwong): Remove the temporary map once prerendering is aware of // multiple session storage namespaces per tab. content::SessionStorageNamespaceMap session_storage_namespace_map; - session_storage_namespace_map[std::string()] = session_storage_namespace; - return WebContents::CreateWithSessionStorage( + session_storage_namespace_map[""] = session_storage_namespace; + return WebContents::CreateWithSessionStorage( WebContents::CreateParams(profile_), session_storage_namespace_map); } diff --git a/chrome/browser/prerender/prerender_histograms.cc b/chrome/browser/prerender/prerender_histograms.cc index 325c00e..d836cf8 100644 --- a/chrome/browser/prerender/prerender_histograms.cc +++ b/chrome/browser/prerender/prerender_histograms.cc @@ -92,9 +92,9 @@ bool OriginIsOmnibox(Origin origin) { #define PREFIXED_HISTOGRAM_INTERNAL(origin, experiment, wash, HISTOGRAM, \ histogram_name) { \ { \ - /* Do not rename. HISTOGRAM expects a local variable "name". */ \ - std::string name = ComposeHistogramName(std::string(), histogram_name); \ - HISTOGRAM; \ + /* Do not rename. HISTOGRAM expects a local variable "name". */ \ + std::string name = ComposeHistogramName("", histogram_name); \ + HISTOGRAM; \ } \ /* Do not rename. HISTOGRAM expects a local variable "name". */ \ std::string name = GetHistogramName(origin, experiment, wash, \ diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc index 131b45a..299567a 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc @@ -66,7 +66,7 @@ CloudPrintSetupFlow* CloudPrintSetupFlow::OpenDialog( chrome::GetActiveDesktop()); // Set the arguments for showing the gaia login page. DictionaryValue args; - args.SetString("user", std::string()); + args.SetString("user", ""); args.SetInteger("error", 0); args.SetBoolean("editable_user", true); diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc index 8c18da8..7bb6d73 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc @@ -87,7 +87,7 @@ void CloudPrintSetupSource::StartDataRequest( // None of the strings used here currently have sync-specific wording in // them. There is a unit test to catch if that happens. - dict->SetString("introduction", std::string()); + dict->SetString("introduction", ""); AddString(dict, "signinprefix", IDS_SYNC_LOGIN_SIGNIN_PREFIX); AddString(dict, "signinsuffix", IDS_SYNC_LOGIN_SIGNIN_SUFFIX); AddString(dict, "cannotbeblank", IDS_SYNC_CANNOT_BE_BLANK); diff --git a/chrome/browser/printing/print_dialog_cloud_interative_uitest.cc b/chrome/browser/printing/print_dialog_cloud_interative_uitest.cc index eb8eef4..2529a1d 100644 --- a/chrome/browser/printing/print_dialog_cloud_interative_uitest.cc +++ b/chrome/browser/printing/print_dialog_cloud_interative_uitest.cc @@ -251,7 +251,7 @@ net::URLRequestJob* PrintDialogCloudTest::Factory( return new net::URLRequestTestJob(request, network_delegate, net::URLRequestTestJob::test_headers(), - std::string(), + "", true); } diff --git a/chrome/browser/printing/print_dialog_cloud_unittest.cc b/chrome/browser/printing/print_dialog_cloud_unittest.cc index ce50f28..217fa53 100644 --- a/chrome/browser/printing/print_dialog_cloud_unittest.cc +++ b/chrome/browser/printing/print_dialog_cloud_unittest.cc @@ -270,7 +270,7 @@ TEST_F(CloudPrintDataSenderTest, NoData) { TEST_F(CloudPrintDataSenderTest, EmptyData) { EXPECT_CALL(*mock_helper_, CallJavascriptFunction(_, _, _)).Times(0); - std::string data; + std::string data(""); scoped_refptr<CloudPrintDataSender> print_data_sender( CreateSender(base::RefCountedString::TakeString(&data))); base::FilePath test_data_file_name = GetTestDataFileName(); diff --git a/chrome/browser/profiles/gaia_info_update_service_factory.cc b/chrome/browser/profiles/gaia_info_update_service_factory.cc index f8f46f7..88ef612 100644 --- a/chrome/browser/profiles/gaia_info_update_service_factory.cc +++ b/chrome/browser/profiles/gaia_info_update_service_factory.cc @@ -39,8 +39,7 @@ void GAIAInfoUpdateServiceFactory::RegisterUserPrefs( PrefRegistrySyncable* prefs) { prefs->RegisterInt64Pref(prefs::kProfileGAIAInfoUpdateTime, 0, PrefRegistrySyncable::UNSYNCABLE_PREF); - prefs->RegisterStringPref(prefs::kProfileGAIAInfoPictureURL, - std::string(), + prefs->RegisterStringPref(prefs::kProfileGAIAInfoPictureURL, "", PrefRegistrySyncable::UNSYNCABLE_PREF); } diff --git a/chrome/browser/profiles/gaia_info_update_service_unittest.cc b/chrome/browser/profiles/gaia_info_update_service_unittest.cc index 37dfdd7..dd85970 100644 --- a/chrome/browser/profiles/gaia_info_update_service_unittest.cc +++ b/chrome/browser/profiles/gaia_info_update_service_unittest.cc @@ -184,8 +184,7 @@ TEST_F(GAIAInfoUpdateServiceTest, LogOut) { GAIAInfoUpdateService service(profile()); EXPECT_FALSE(service.GetCachedPictureURL().empty()); // Log out. - profile()->GetPrefs() - ->SetString(prefs::kGoogleServicesUsername, std::string()); + profile()->GetPrefs()->SetString(prefs::kGoogleServicesUsername, ""); // Verify that the GAIA name and picture, and picture URL are unset. EXPECT_TRUE(GetCache()->GetGAIANameOfProfileAtIndex(0).empty()); @@ -194,8 +193,7 @@ TEST_F(GAIAInfoUpdateServiceTest, LogOut) { } TEST_F(GAIAInfoUpdateServiceTest, LogIn) { - profile()->GetPrefs() - ->SetString(prefs::kGoogleServicesUsername, std::string()); + profile()->GetPrefs()->SetString(prefs::kGoogleServicesUsername, ""); GAIAInfoUpdateServiceMock service(profile()); // Log in. diff --git a/chrome/browser/profiles/profile_downloader_unittest.cc b/chrome/browser/profiles/profile_downloader_unittest.cc index 5346694..2e47968 100644 --- a/chrome/browser/profiles/profile_downloader_unittest.cc +++ b/chrome/browser/profiles/profile_downloader_unittest.cc @@ -68,25 +68,25 @@ TEST_F(ProfileDownloaderTest, ParseData) { true); // Data with only name. - VerifyWithNameAndURL("Pat Smith", std::string(), std::string(), true); + VerifyWithNameAndURL("Pat Smith", "", "", true); // Data with only URL. VerifyWithNameAndURL( - std::string(), + "", "https://example.com/--Abc/AAAAAAAAAAI/AAAAAAAAACQ/Efg/photo.jpg", "https://example.com/--Abc/AAAAAAAAAAI/AAAAAAAAACQ/Efg/s32-c/photo.jpg", true); // Data without name or URL. - VerifyWithNameAndURL(std::string(), std::string(), std::string(), false); + VerifyWithNameAndURL("", "", "", false); // Data with an invalid URL. - VerifyWithNameAndURL(std::string(), "invalid url", std::string(), false); + VerifyWithNameAndURL( "", "invalid url", "", false); } TEST_F(ProfileDownloaderTest, DefaultURL) { // Empty URL should be default photo - EXPECT_TRUE(ProfileDownloader::IsDefaultProfileImageURL(std::string())); + EXPECT_TRUE(ProfileDownloader::IsDefaultProfileImageURL("")); // Picasa default photo EXPECT_TRUE(ProfileDownloader::IsDefaultProfileImageURL( "https://example.com/-4/AAAAAAAAAAA/AAAAAAAAAAE/G/s64-c/photo.jpg")); diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index a068fb3..f99cbba 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -289,8 +289,9 @@ void ProfileImpl::RegisterUserPrefs(PrefRegistrySyncable* registry) { registry->RegisterIntegerPref(prefs::kProfileAvatarIndex, -1, PrefRegistrySyncable::SYNCABLE_PREF); - registry->RegisterStringPref( - prefs::kProfileName, std::string(), PrefRegistrySyncable::SYNCABLE_PREF); + registry->RegisterStringPref(prefs::kProfileName, + "", + PrefRegistrySyncable::SYNCABLE_PREF); registry->RegisterBooleanPref(prefs::kProfileIsManaged, false, PrefRegistrySyncable::SYNCABLE_PREF); diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc index 69da963..59f2e69 100644 --- a/chrome/browser/profiles/profile_manager.cc +++ b/chrome/browser/profiles/profile_manager.cc @@ -890,7 +890,7 @@ void ProfileManager::CreateMultiProfileAsync( // static void ProfileManager::RegisterPrefs(PrefRegistrySimple* registry) { - registry->RegisterStringPref(prefs::kProfileLastUsed, std::string()); + registry->RegisterStringPref(prefs::kProfileLastUsed, ""); registry->RegisterIntegerPref(prefs::kProfilesNumCreated, 1); registry->RegisterListPref(prefs::kProfilesLastActive); } diff --git a/chrome/browser/referrer_policy_browsertest.cc b/chrome/browser/referrer_policy_browsertest.cc index 0b9f40f..83a32b4 100644 --- a/chrome/browser/referrer_policy_browsertest.cc +++ b/chrome/browser/referrer_policy_browsertest.cc @@ -376,7 +376,7 @@ IN_PROC_BROWSER_TEST_F(ReferrerPolicyTest, History) { EXPECT_ORIGIN_AS_REFERRER); // Navigate to C. - ui_test_utils::NavigateToURL(browser(), test_server_->GetURL(std::string())); + ui_test_utils::NavigateToURL(browser(), test_server_->GetURL("")); string16 expected_title = GetExpectedTitle(start_url, EXPECT_ORIGIN_AS_REFERRER); diff --git a/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc b/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc index be2ce33..f39e75a 100644 --- a/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc +++ b/chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_filter.cc @@ -316,7 +316,7 @@ int32_t PepperFlashClipboardMessageFilter::OnMsgWriteData( scw.WriteText(UTF8ToUTF16(data[i])); break; case PP_FLASH_CLIPBOARD_FORMAT_HTML: - scw.WriteHTML(UTF8ToUTF16(data[i]), std::string()); + scw.WriteHTML(UTF8ToUTF16(data[i]), ""); break; case PP_FLASH_CLIPBOARD_FORMAT_RTF: scw.WriteRTF(data[i]); diff --git a/chrome/browser/safe_browsing/browser_feature_extractor.cc b/chrome/browser/safe_browsing/browser_feature_extractor.cc index a40c66d..142f375 100644 --- a/chrome/browser/safe_browsing/browser_feature_extractor.cc +++ b/chrome/browser/safe_browsing/browser_feature_extractor.cc @@ -208,8 +208,8 @@ void BrowserFeatureExtractor::ExtractFeatures(const BrowseInfo* info, // 2) The first url on the same host as the candidate url (assuming that // it's different from the candidate url). if (url_index != -1) { - AddNavigationFeatures( - std::string(), controller, url_index, info->url_redirects, request); + AddNavigationFeatures("", controller, url_index, info->url_redirects, + request); } if (first_host_index != -1) { AddNavigationFeatures(features::kHostPrefix, diff --git a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc index ec8b4e3..74ec857 100644 --- a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc +++ b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc @@ -635,11 +635,11 @@ TEST_F(ClientSideDetectionHostTest, UpdateIPHostMap) { BrowseInfo* browse_info = GetBrowseInfo(); // Empty IP or host are skipped - UpdateIPHostMap("250.10.10.10", std::string()); + UpdateIPHostMap("250.10.10.10", ""); ASSERT_EQ(0U, browse_info->ips.size()); - UpdateIPHostMap(std::string(), "google.com/"); + UpdateIPHostMap("", "google.com/"); ASSERT_EQ(0U, browse_info->ips.size()); - UpdateIPHostMap(std::string(), std::string()); + UpdateIPHostMap("", ""); ASSERT_EQ(0U, browse_info->ips.size()); std::set<std::string> expected_hosts; diff --git a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc index ed533604..f5fd98b 100644 --- a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc +++ b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc @@ -252,8 +252,9 @@ TEST_F(ClientSideDetectionServiceTest, FetchModelTest) { Mock::VerifyAndClearExpectations(&service); // Empty model file. - SetModelFetchResponse(std::string(), true /* success */); - EXPECT_CALL(service, EndFetchModel(ClientSideDetectionService::MODEL_EMPTY)) + SetModelFetchResponse("", true /* success */); + EXPECT_CALL(service, EndFetchModel( + ClientSideDetectionService::MODEL_EMPTY)) .WillOnce(QuitCurrentMessageLoop()); service.StartFetchModel(); msg_loop_.Run(); // EndFetchModel will quit the message loop. @@ -575,7 +576,7 @@ TEST_F(ClientSideDetectionServiceTest, IsBadIpAddress) { ClientSideDetectionService::SetBadSubnets( model, &(csd_service_->bad_subnets_)); EXPECT_FALSE(csd_service_->IsBadIpAddress("blabla")); - EXPECT_FALSE(csd_service_->IsBadIpAddress(std::string())); + EXPECT_FALSE(csd_service_->IsBadIpAddress("")); EXPECT_TRUE(csd_service_->IsBadIpAddress( "2620:0:1000:3103:21a:a0ff:fe10:786e")); diff --git a/chrome/browser/safe_browsing/download_protection_service_unittest.cc b/chrome/browser/safe_browsing/download_protection_service_unittest.cc index af98856..e8da2ee 100644 --- a/chrome/browser/safe_browsing/download_protection_service_unittest.cc +++ b/chrome/browser/safe_browsing/download_protection_service_unittest.cc @@ -390,7 +390,7 @@ TEST_F(DownloadProtectionServiceTest, CheckClientDownloadFetchFailed) { net::FakeURLFetcherFactory factory(NULL); // HTTP request will fail. factory.SetFakeResponse( - DownloadProtectionService::GetDownloadRequestUrl(), std::string(), false); + DownloadProtectionService::GetDownloadRequestUrl(), "", false); base::FilePath a_tmp(FILE_PATH_LITERAL("a.tmp")); base::FilePath a_exe(FILE_PATH_LITERAL("a.exe")); diff --git a/chrome/browser/safe_browsing/malware_details.cc b/chrome/browser/safe_browsing/malware_details.cc index 7eb336d..41cf690 100644 --- a/chrome/browser/safe_browsing/malware_details.cc +++ b/chrome/browser/safe_browsing/malware_details.cc @@ -178,16 +178,16 @@ void MalwareDetails::StartCollection() { } // Add the nodes, starting from the page url. - AddUrl(page_url, GURL(), std::string(), NULL); + AddUrl(page_url, GURL(), "", NULL); // Add the resource_url and its original url, if non-empty and different. if (!resource_.original_url.is_empty() && resource_.url != resource_.original_url) { // Add original_url, as the parent of resource_url. - AddUrl(resource_.original_url, GURL(), std::string(), NULL); - AddUrl(resource_.url, resource_.original_url, std::string(), NULL); + AddUrl(resource_.original_url, GURL(), "", NULL); + AddUrl(resource_.url, resource_.original_url, "", NULL); } else { - AddUrl(resource_.url, GURL(), std::string(), NULL); + AddUrl(resource_.url, GURL(), "", NULL); } // Add the redirect urls, if non-empty. The redirect urls do not include the @@ -201,13 +201,13 @@ void MalwareDetails::StartCollection() { } // Set the previous redirect url as the parent of the next one for (unsigned int i = 0; i < resource_.redirect_urls.size(); ++i) { - AddUrl(resource_.redirect_urls[i], parent_url, std::string(), NULL); + AddUrl(resource_.redirect_urls[i], parent_url, "", NULL); parent_url = resource_.redirect_urls[i]; } // Add the referrer url. if (nav_entry && !referrer_url.is_empty()) { - AddUrl(referrer_url, GURL(), std::string(), NULL); + AddUrl(referrer_url, GURL(), "", NULL); } // Get URLs of frames, scripts etc from the DOM. @@ -287,7 +287,7 @@ void MalwareDetails::OnRedirectionCollectionReady() { void MalwareDetails::AddRedirectUrlList(const std::vector<GURL>& urls) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); for (size_t i = 0; i < urls.size()-1; ++i) { - AddUrl(urls[i], urls[i + 1], std::string(), NULL); + AddUrl(urls[i], urls[i+1], "", NULL); } } diff --git a/chrome/browser/safe_browsing/ping_manager.cc b/chrome/browser/safe_browsing/ping_manager.cc index 56580d00..6e73985 100644 --- a/chrome/browser/safe_browsing/ping_manager.cc +++ b/chrome/browser/safe_browsing/ping_manager.cc @@ -113,7 +113,7 @@ GURL SafeBrowsingPingManager::SafeBrowsingHitUrl( threat_type == SB_THREAT_TYPE_BINARY_MALWARE_HASH || threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL); std::string url = SafeBrowsingProtocolManagerHelper::ComposeUrl( - url_prefix_, "report", client_name_, version_, std::string()); + url_prefix_, "report", client_name_, version_, ""); std::string threat_list = "none"; switch (threat_type) { case SB_THREAT_TYPE_URL_MALWARE: diff --git a/chrome/browser/safe_browsing/protocol_manager_unittest.cc b/chrome/browser/safe_browsing/protocol_manager_unittest.cc index ca89ce5..0bd9c3a 100644 --- a/chrome/browser/safe_browsing/protocol_manager_unittest.cc +++ b/chrome/browser/safe_browsing/protocol_manager_unittest.cc @@ -378,7 +378,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, ExistingDatabase) { url_fetcher->set_status(net::URLRequestStatus()); url_fetcher->set_response_code(200); - url_fetcher->SetResponseString(std::string()); + url_fetcher->SetResponseString(""); url_fetcher->delegate()->OnURLFetchComplete(url_fetcher); EXPECT_TRUE(pm->IsUpdateScheduled()); @@ -424,7 +424,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, UpdateResponseBadBodyBackupSuccess) { // Respond to the backup successfully. backup_url_fetcher->set_status(net::URLRequestStatus()); backup_url_fetcher->set_response_code(200); - backup_url_fetcher->SetResponseString(std::string()); + backup_url_fetcher->SetResponseString(""); backup_url_fetcher->delegate()->OnURLFetchComplete(backup_url_fetcher); EXPECT_TRUE(pm->IsUpdateScheduled()); @@ -460,7 +460,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, UpdateResponseHttpErrorBackupError) { // Go ahead and respond to it. url_fetcher->set_status(net::URLRequestStatus()); url_fetcher->set_response_code(404); - url_fetcher->SetResponseString(std::string()); + url_fetcher->SetResponseString(""); url_fetcher->delegate()->OnURLFetchComplete(url_fetcher); // There should now be a backup request. @@ -471,7 +471,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, UpdateResponseHttpErrorBackupError) { // Respond to the backup unsuccessfully. backup_url_fetcher->set_status(net::URLRequestStatus()); backup_url_fetcher->set_response_code(404); - backup_url_fetcher->SetResponseString(std::string()); + backup_url_fetcher->SetResponseString(""); backup_url_fetcher->delegate()->OnURLFetchComplete(backup_url_fetcher); EXPECT_TRUE(pm->IsUpdateScheduled()); @@ -507,7 +507,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, UpdateResponseHttpErrorBackupSuccess) { // Go ahead and respond to it. url_fetcher->set_status(net::URLRequestStatus()); url_fetcher->set_response_code(404); - url_fetcher->SetResponseString(std::string()); + url_fetcher->SetResponseString(""); url_fetcher->delegate()->OnURLFetchComplete(url_fetcher); // There should now be a backup request. @@ -519,7 +519,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, UpdateResponseHttpErrorBackupSuccess) { // Respond to the backup successfully. backup_url_fetcher->set_status(net::URLRequestStatus()); backup_url_fetcher->set_response_code(200); - backup_url_fetcher->SetResponseString(std::string()); + backup_url_fetcher->SetResponseString(""); backup_url_fetcher->delegate()->OnURLFetchComplete(backup_url_fetcher); EXPECT_TRUE(pm->IsUpdateScheduled()); @@ -555,7 +555,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, UpdateResponseHttpErrorBackupTimeout) { // Go ahead and respond to it. url_fetcher->set_status(net::URLRequestStatus()); url_fetcher->set_response_code(404); - url_fetcher->SetResponseString(std::string()); + url_fetcher->SetResponseString(""); url_fetcher->delegate()->OnURLFetchComplete(url_fetcher); // There should now be a backup request. @@ -617,7 +617,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, // Respond to the backup unsuccessfully. backup_url_fetcher->set_status(net::URLRequestStatus()); backup_url_fetcher->set_response_code(404); - backup_url_fetcher->SetResponseString(std::string()); + backup_url_fetcher->SetResponseString(""); backup_url_fetcher->delegate()->OnURLFetchComplete(backup_url_fetcher); EXPECT_TRUE(pm->IsUpdateScheduled()); @@ -665,7 +665,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, // Respond to the backup unsuccessfully. backup_url_fetcher->set_status(net::URLRequestStatus()); backup_url_fetcher->set_response_code(200); - backup_url_fetcher->SetResponseString(std::string()); + backup_url_fetcher->SetResponseString(""); backup_url_fetcher->delegate()->OnURLFetchComplete(backup_url_fetcher); EXPECT_TRUE(pm->IsUpdateScheduled()); @@ -713,7 +713,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, // Respond to the backup unsuccessfully. backup_url_fetcher->set_status(net::URLRequestStatus()); backup_url_fetcher->set_response_code(404); - backup_url_fetcher->SetResponseString(std::string()); + backup_url_fetcher->SetResponseString(""); backup_url_fetcher->delegate()->OnURLFetchComplete(backup_url_fetcher); EXPECT_TRUE(pm->IsUpdateScheduled()); @@ -762,7 +762,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, // Respond to the backup unsuccessfully. backup_url_fetcher->set_status(net::URLRequestStatus()); backup_url_fetcher->set_response_code(200); - backup_url_fetcher->SetResponseString(std::string()); + backup_url_fetcher->SetResponseString(""); backup_url_fetcher->delegate()->OnURLFetchComplete(backup_url_fetcher); EXPECT_TRUE(pm->IsUpdateScheduled()); @@ -807,7 +807,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, UpdateResponseTimeoutBackupSuccess) { // Respond to the backup unsuccessfully. backup_url_fetcher->set_status(net::URLRequestStatus()); backup_url_fetcher->set_response_code(200); - backup_url_fetcher->SetResponseString(std::string()); + backup_url_fetcher->SetResponseString(""); backup_url_fetcher->delegate()->OnURLFetchComplete(backup_url_fetcher); EXPECT_TRUE(pm->IsUpdateScheduled()); @@ -888,7 +888,7 @@ TEST_F(SafeBrowsingProtocolManagerTest, EmptyRedirectResponse) { chunk_url_fetcher, "https://redirect-server.example.com/path"); chunk_url_fetcher->set_status(net::URLRequestStatus()); chunk_url_fetcher->set_response_code(200); - chunk_url_fetcher->SetResponseString(std::string()); + chunk_url_fetcher->SetResponseString(""); chunk_url_fetcher->delegate()->OnURLFetchComplete(chunk_url_fetcher); EXPECT_TRUE(pm->IsUpdateScheduled()); diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc index 032d5ec..3d0f2d9 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc @@ -1004,8 +1004,8 @@ void SafeBrowsingBlockingPageV2::PopulateMalwareStringDictionary( if (!CanShowMalwareDetailsOption()) { strings->SetBoolean(kDisplayCheckBox, false); - strings->SetString("confirm_text", std::string()); - strings->SetString(kBoxChecked, std::string()); + strings->SetString("confirm_text", ""); + strings->SetString(kBoxChecked, ""); } else { // Show the checkbox for sending malware details. strings->SetBoolean(kDisplayCheckBox, true); @@ -1022,7 +1022,7 @@ void SafeBrowsingBlockingPageV2::PopulateMalwareStringDictionary( if (IsPrefEnabled(prefs::kSafeBrowsingReportingEnabled)) strings->SetString(kBoxChecked, "yes"); else - strings->SetString(kBoxChecked, std::string()); + strings->SetString(kBoxChecked, ""); } strings->SetString("report_error", string16()); @@ -1042,11 +1042,10 @@ void SafeBrowsingBlockingPageV2::PopulatePhishingStringDictionary( string16(), l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_DESCRIPTION2)); - strings->SetString("details", std::string()); - strings->SetString("confirm_text", std::string()); - strings->SetString(kBoxChecked, std::string()); - strings->SetString( - "report_error", + strings->SetString("details", ""); + strings->SetString("confirm_text", ""); + strings->SetString(kBoxChecked, ""); + strings->SetString("report_error", l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_REPORT_ERROR)); strings->SetBoolean(kDisplayCheckBox, false); strings->SetString("learnMore", diff --git a/chrome/browser/safe_browsing/safe_browsing_util.cc b/chrome/browser/safe_browsing/safe_browsing_util.cc index 7e6710f..ef620a7 100644 --- a/chrome/browser/safe_browsing/safe_browsing_util.cc +++ b/chrome/browser/safe_browsing/safe_browsing_util.cc @@ -298,10 +298,8 @@ void CanonicalizeUrl(const GURL& url, url_unescaped_str.length(), &parsed); // 3. In hostname, remove all leading and trailing dots. - const std::string host = - (parsed.host.len > 0) - ? url_unescaped_str.substr(parsed.host.begin, parsed.host.len) - : std::string(); + const std::string host = (parsed.host.len > 0) ? url_unescaped_str.substr( + parsed.host.begin, parsed.host.len) : ""; const char kCharsToTrim[] = "."; std::string host_without_end_dots; TrimString(host, kCharsToTrim, &host_without_end_dots); @@ -311,11 +309,10 @@ void CanonicalizeUrl(const GURL& url, host_without_end_dots, '.')); // 5. In path, replace runs of consecutive slashes with a single slash. - std::string path = - (parsed.path.len > 0) - ? url_unescaped_str.substr(parsed.path.begin, parsed.path.len) - : std::string(); - std::string path_without_consecutive_slash(RemoveConsecutiveChars(path, '/')); + std::string path = (parsed.path.len > 0) ? url_unescaped_str.substr( + parsed.path.begin, parsed.path.len): ""; + std::string path_without_consecutive_slash(RemoveConsecutiveChars( + path, '/')); url_canon::Replacements<char> hp_replacements; hp_replacements.SetHost(host_without_consecutive_dots.data(), diff --git a/chrome/browser/safe_browsing/two_phase_uploader.cc b/chrome/browser/safe_browsing/two_phase_uploader.cc index df58625..9b6165e 100644 --- a/chrome/browser/safe_browsing/two_phase_uploader.cc +++ b/chrome/browser/safe_browsing/two_phase_uploader.cc @@ -63,7 +63,7 @@ void TwoPhaseUploader::OnURLFetchComplete(const net::URLFetcher* source) { if (!status.is_success()) { LOG(ERROR) << "URLFetcher failed, status=" << status.status() << " err=" << status.error(); - Finish(status.error(), response_code, std::string()); + Finish(status.error(), response_code, ""); return; } @@ -83,7 +83,7 @@ void TwoPhaseUploader::OnURLFetchComplete(const net::URLFetcher* source) { if (!source->GetResponseHeaders()->EnumerateHeader( NULL, kLocationHeader, &location)) { LOG(ERROR) << "no location header"; - Finish(net::OK, response_code, std::string()); + Finish(net::OK, response_code, ""); return; } DVLOG(1) << "upload location: " << location; diff --git a/chrome/browser/search/local_ntp_source.cc b/chrome/browser/search/local_ntp_source.cc index 38cbd7a..d1fde35 100644 --- a/chrome/browser/search/local_ntp_source.cc +++ b/chrome/browser/search/local_ntp_source.cc @@ -74,7 +74,7 @@ std::string LocalNtpSource::GetMimeType( path == kCloseBarActiveFilename) { return "image/png"; } - return std::string(); + return ""; } bool LocalNtpSource::ShouldServiceRequest( diff --git a/chrome/browser/search/local_omnibox_popup_source.cc b/chrome/browser/search/local_omnibox_popup_source.cc index fa2d940..1ae3c8a 100644 --- a/chrome/browser/search/local_omnibox_popup_source.cc +++ b/chrome/browser/search/local_omnibox_popup_source.cc @@ -76,7 +76,7 @@ std::string LocalOmniboxPopupSource::GetMimeType( if (path == kPageIconFilename || path == kPageIcon2xFilename || path == kSearchIconFilename || path == kSearchIcon2xFilename) return "image/png"; - return std::string(); + return ""; } bool LocalOmniboxPopupSource::ShouldServiceRequest( diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc index 726bc89..83186b4 100644 --- a/chrome/browser/search/search.cc +++ b/chrome/browser/search/search.cc @@ -527,8 +527,7 @@ uint64 GetUInt64ValueForFlagWithDefault(const std::string& flag, uint64 default_value, const FieldTrialFlags& flags) { uint64 value; - std::string str_value = - GetStringValueForFlagWithDefault(flag, std::string(), flags); + std::string str_value = GetStringValueForFlagWithDefault(flag, "", flags); if (base::StringToUint64(str_value, &value)) return value; return default_value; diff --git a/chrome/browser/search/search_unittest.cc b/chrome/browser/search/search_unittest.cc index 7c4bf4c..90ff642b 100644 --- a/chrome/browser/search/search_unittest.cc +++ b/chrome/browser/search/search_unittest.cc @@ -22,7 +22,7 @@ TEST(EmbeddedSearchFieldTrialTest, GetFieldTrialInfo) { uint64 group_number = 0; const uint64 ZERO = 0; - EXPECT_FALSE(GetFieldTrialInfo(std::string(), &flags, &group_number)); + EXPECT_FALSE(GetFieldTrialInfo("", &flags, &group_number)); EXPECT_EQ(ZERO, group_number); EXPECT_EQ(ZERO, flags.size()); @@ -62,10 +62,9 @@ TEST(EmbeddedSearchFieldTrialTest, GetFieldTrialInfo) { EXPECT_EQ(uint64(3), flags.size()); EXPECT_EQ(true, GetBoolValueForFlagWithDefault("bar", false, flags)); EXPECT_EQ(uint64(7), GetUInt64ValueForFlagWithDefault("baz", 0, flags)); - EXPECT_EQ("dogs", - GetStringValueForFlagWithDefault("cat", std::string(), flags)); - EXPECT_EQ("default", - GetStringValueForFlagWithDefault("moose", "default", flags)); + EXPECT_EQ("dogs", GetStringValueForFlagWithDefault("cat", "", flags)); + EXPECT_EQ("default", GetStringValueForFlagWithDefault( + "moose", "default", flags)); group_number = 0; flags.clear(); diff --git a/chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc b/chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc index aa47992..3237137 100644 --- a/chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc +++ b/chrome/browser/search_engines/template_url_prepopulate_data_unittest.cc @@ -167,7 +167,7 @@ TEST(TemplateURLPrepopulateDataTest, ProvidersFromPrefs) { entry->SetInteger("id", 1002); entry->SetString("name", "bar"); entry->SetString("keyword", "bark"); - entry->SetString("encoding", std::string()); + entry->SetString("encoding", ""); overrides->Append(entry->DeepCopy()); entry->SetInteger("id", 1003); entry->SetString("name", "baz"); diff --git a/chrome/browser/sessions/session_restore_browsertest.cc b/chrome/browser/sessions/session_restore_browsertest.cc index e82391e..5e2953a 100644 --- a/chrome/browser/sessions/session_restore_browsertest.cc +++ b/chrome/browser/sessions/session_restore_browsertest.cc @@ -985,7 +985,7 @@ IN_PROC_BROWSER_TEST_F(SessionRestoreTest, SessionStorageAfterTabReplace) { ASSERT_TRUE(controller->GetDefaultSessionStorageNamespace()); content::SessionStorageNamespaceMap session_storage_namespace_map; - session_storage_namespace_map[std::string()] = + session_storage_namespace_map[""] = controller->GetDefaultSessionStorageNamespace(); scoped_ptr<content::WebContents> web_contents( content::WebContents::CreateWithSessionStorage( diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc index c0be6de..2a656fe 100644 --- a/chrome/browser/shell_integration_linux.cc +++ b/chrome/browser/shell_integration_linux.cc @@ -435,7 +435,7 @@ ShellIntegration::DefaultWebClientSetPermission // static bool ShellIntegration::SetAsDefaultBrowser() { - return SetDefaultWebClient(std::string()); + return SetDefaultWebClient(""); } // static @@ -445,7 +445,7 @@ bool ShellIntegration::SetAsDefaultProtocolClient(const std::string& protocol) { // static ShellIntegration::DefaultWebClientState ShellIntegration::GetDefaultBrowser() { - return GetIsDefaultWebClient(std::string()); + return GetIsDefaultWebClient(""); } // static diff --git a/chrome/browser/shell_integration_unittest.cc b/chrome/browser/shell_integration_unittest.cc index 8715114..0b81311 100644 --- a/chrome/browser/shell_integration_unittest.cc +++ b/chrome/browser/shell_integration_unittest.cc @@ -644,7 +644,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) { test_cases[i].template_contents, web_app::GenerateApplicationNameFromURL(GURL(test_cases[i].url)), GURL(test_cases[i].url), - std::string(), + "", base::FilePath(), ASCIIToUTF16(test_cases[i].title), test_cases[i].icon_name, diff --git a/chrome/browser/signin/about_signin_internals.cc b/chrome/browser/signin/about_signin_internals.cc index e58a013..ad83b0d 100644 --- a/chrome/browser/signin/about_signin_internals.cc +++ b/chrome/browser/signin/about_signin_internals.cc @@ -25,8 +25,7 @@ AboutSigninInternals::AboutSigninInternals() : profile_(NULL) { for (size_t i = 0; i < kNumTokenPrefs; ++i) { signin_status_.token_info_map.insert(std::pair<std::string, TokenInfo>( kTokenPrefsArray[i], - TokenInfo( - std::string(), "Not Loaded", std::string(), kTokenPrefsArray[i]))); + TokenInfo("", "Not Loaded", "", kTokenPrefsArray[i]))); } } @@ -171,7 +170,7 @@ void AboutSigninInternals::NotifyTokenReceivedFailure( const std::string value_pref = TokenPrefPath(token_name) + ".value"; const std::string time_pref = TokenPrefPath(token_name) + ".time"; const std::string status_pref = TokenPrefPath(token_name) + ".status"; - profile_->GetPrefs()->SetString(value_pref.c_str(), std::string()); + profile_->GetPrefs()->SetString(value_pref.c_str(), ""); profile_->GetPrefs()->SetString(time_pref.c_str(), time_as_str); profile_->GetPrefs()->SetString(status_pref.c_str(), error); @@ -187,7 +186,7 @@ void AboutSigninInternals::NotifyClearStoredToken( signin_status_.token_info_map[token_name].token.clear(); const std::string value_pref = TokenPrefPath(token_name) + ".value"; - profile_->GetPrefs()->SetString(value_pref.c_str(), std::string()); + profile_->GetPrefs()->SetString(value_pref.c_str(), ""); NotifyObservers(); } diff --git a/chrome/browser/signin/about_signin_internals_factory.cc b/chrome/browser/signin/about_signin_internals_factory.cc index f5f197f..ccce353 100644 --- a/chrome/browser/signin/about_signin_internals_factory.cc +++ b/chrome/browser/signin/about_signin_internals_factory.cc @@ -42,8 +42,7 @@ void AboutSigninInternalsFactory::RegisterUserPrefs( for (int i = UNTIMED_FIELDS_BEGIN; i < UNTIMED_FIELDS_END; ++i) { const std::string pref_path = SigninStatusFieldToString( static_cast<UntimedSigninStatusField>(i)); - user_prefs->RegisterStringPref(pref_path.c_str(), - std::string(), + user_prefs->RegisterStringPref(pref_path.c_str(), "", PrefRegistrySyncable::UNSYNCABLE_PREF); } for (int i = TIMED_FIELDS_BEGIN; i < TIMED_FIELDS_END; ++i) { @@ -51,10 +50,10 @@ void AboutSigninInternalsFactory::RegisterUserPrefs( static_cast<TimedSigninStatusField>(i)) + ".value"; const std::string time = SigninStatusFieldToString( static_cast<TimedSigninStatusField>(i)) + ".time"; - user_prefs->RegisterStringPref( - value.c_str(), std::string(), PrefRegistrySyncable::UNSYNCABLE_PREF); - user_prefs->RegisterStringPref( - time.c_str(), std::string(), PrefRegistrySyncable::UNSYNCABLE_PREF); + user_prefs->RegisterStringPref(value.c_str(), "", + PrefRegistrySyncable::UNSYNCABLE_PREF); + user_prefs->RegisterStringPref(time.c_str(), "", + PrefRegistrySyncable::UNSYNCABLE_PREF); } // TokenService information for about:signin-internals. for (size_t i = 0; i < kNumTokenPrefs; i++) { @@ -62,12 +61,12 @@ void AboutSigninInternalsFactory::RegisterUserPrefs( const std::string value = pref + ".value"; const std::string status = pref + ".status"; const std::string time = pref + ".time"; - user_prefs->RegisterStringPref( - value.c_str(), std::string(), PrefRegistrySyncable::UNSYNCABLE_PREF); - user_prefs->RegisterStringPref( - status.c_str(), std::string(), PrefRegistrySyncable::UNSYNCABLE_PREF); - user_prefs->RegisterStringPref( - time.c_str(), std::string(), PrefRegistrySyncable::UNSYNCABLE_PREF); + user_prefs->RegisterStringPref(value.c_str(), "", + PrefRegistrySyncable::UNSYNCABLE_PREF); + user_prefs->RegisterStringPref(status.c_str(), "", + PrefRegistrySyncable::UNSYNCABLE_PREF); + user_prefs->RegisterStringPref(time.c_str(), "", + PrefRegistrySyncable::UNSYNCABLE_PREF); } } diff --git a/chrome/browser/signin/oauth2_token_service_unittest.cc b/chrome/browser/signin/oauth2_token_service_unittest.cc index 7095b43..3649374 100644 --- a/chrome/browser/signin/oauth2_token_service_unittest.cc +++ b/chrome/browser/signin/oauth2_token_service_unittest.cc @@ -138,7 +138,7 @@ TEST_F(OAuth2TokenServiceTest, FailureShouldNotRetry) { net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0); EXPECT_TRUE(fetcher); fetcher->set_response_code(net::HTTP_UNAUTHORIZED); - fetcher->SetResponseString(std::string()); + fetcher->SetResponseString(""); fetcher->delegate()->OnURLFetchComplete(fetcher); EXPECT_EQ(0, consumer_.number_of_correct_tokens_); EXPECT_EQ(1, consumer_.number_of_errors_); @@ -251,7 +251,7 @@ TEST_F(OAuth2TokenServiceTest, SuccessAndExpirationAndFailure) { fetcher = factory_.GetFetcherByID(0); EXPECT_TRUE(fetcher); fetcher->set_response_code(net::HTTP_UNAUTHORIZED); - fetcher->SetResponseString(std::string()); + fetcher->SetResponseString(""); fetcher->delegate()->OnURLFetchComplete(fetcher); EXPECT_EQ(1, consumer_.number_of_correct_tokens_); EXPECT_EQ(1, consumer_.number_of_errors_); @@ -374,7 +374,7 @@ TEST_F(OAuth2TokenServiceTest, SuccessAndSignOutAndRequest) { // Signs out service_->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken, - std::string()); + ""); service_->EraseTokensFromDB(); request = oauth2_service_->StartRequest(std::set<std::string>(), &consumer_); @@ -404,7 +404,7 @@ TEST_F(OAuth2TokenServiceTest, SuccessAndSignOutAndSignInAndSuccess) { // Signs out and signs in service_->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken, - std::string()); + ""); service_->EraseTokensFromDB(); service_->IssueAuthTokenForTest(GaiaConstants::kGaiaOAuth2LoginRefreshToken, "refreshToken"); @@ -486,7 +486,7 @@ TEST_F(OAuth2TokenServiceTest, RetryingConsumer) { net::TestURLFetcher* fetcher = factory_.GetFetcherByID(0); EXPECT_TRUE(fetcher); fetcher->set_response_code(net::HTTP_UNAUTHORIZED); - fetcher->SetResponseString(std::string()); + fetcher->SetResponseString(""); fetcher->delegate()->OnURLFetchComplete(fetcher); EXPECT_EQ(0, consumer.number_of_correct_tokens_); EXPECT_EQ(1, consumer.number_of_errors_); @@ -494,7 +494,7 @@ TEST_F(OAuth2TokenServiceTest, RetryingConsumer) { fetcher = factory_.GetFetcherByID(0); EXPECT_TRUE(fetcher); fetcher->set_response_code(net::HTTP_UNAUTHORIZED); - fetcher->SetResponseString(std::string()); + fetcher->SetResponseString(""); fetcher->delegate()->OnURLFetchComplete(fetcher); EXPECT_EQ(0, consumer.number_of_correct_tokens_); EXPECT_EQ(2, consumer.number_of_errors_); diff --git a/chrome/browser/signin/signin_internals_util.cc b/chrome/browser/signin/signin_internals_util.cc index f187418..adae0a1 100644 --- a/chrome/browser/signin/signin_internals_util.cc +++ b/chrome/browser/signin/signin_internals_util.cc @@ -98,11 +98,11 @@ std::string SigninStatusFieldToString(UntimedSigninStatusField field) { ENUM_CASE(LSID); case UNTIMED_FIELDS_END: NOTREACHED(); - return std::string(); + return ""; } NOTREACHED(); - return std::string(); + return ""; } std::string SigninStatusFieldToString(TimedSigninStatusField field) { @@ -113,11 +113,11 @@ std::string SigninStatusFieldToString(TimedSigninStatusField field) { ENUM_CASE(GET_USER_INFO_STATUS); case TIMED_FIELDS_END: NOTREACHED(); - return std::string(); + return ""; } NOTREACHED(); - return std::string(); + return ""; } SigninStatus::SigninStatus() @@ -203,10 +203,10 @@ std::string SigninStatusFieldToLabel(UntimedSigninStatusField field) { return "Sid (Hash)"; case UNTIMED_FIELDS_END: NOTREACHED(); - return std::string(); + return ""; } NOTREACHED(); - return std::string(); + return ""; } TimedSigninStatusValue SigninStatusFieldToLabel( @@ -226,10 +226,10 @@ TimedSigninStatusValue SigninStatusFieldToLabel( "Last OnGetUserInfo Time"); case TIMED_FIELDS_END: NOTREACHED(); - return TimedSigninStatusValue("Error", std::string()); + return TimedSigninStatusValue("Error", ""); } NOTREACHED(); - return TimedSigninStatusValue("Error", std::string()); + return TimedSigninStatusValue("Error", ""); } } // namespace diff --git a/chrome/browser/signin/signin_manager.cc b/chrome/browser/signin/signin_manager.cc index ab5befc..a8bc081 100644 --- a/chrome/browser/signin/signin_manager.cc +++ b/chrome/browser/signin/signin_manager.cc @@ -305,9 +305,10 @@ std::string SigninManager::SigninTypeToString( } NOTREACHED(); - return std::string(); + return ""; } + bool SigninManager::PrepareForSignin(SigninType type, const std::string& username, const std::string& password) { @@ -467,8 +468,7 @@ void SigninManager::StartSignInWithOAuth(const std::string& username, scopes.push_back(GaiaUrls::GetInstance()->oauth1_login_scope()); const std::string& locale = g_browser_process->GetApplicationLocale(); - client_login_->StartClientOAuth( - username, password, scopes, std::string(), locale); + client_login_->StartClientOAuth(username, password, scopes, "", locale); // Register for token availability. The signin manager will pre-login the // user when the GAIA service token is ready for use. Only do this if we @@ -549,9 +549,10 @@ void SigninManager::SignOut() { profile_->GetPrefs()->ClearPref(prefs::kGoogleServicesUsername); // Erase (now) stale information from AboutSigninInternals. - NotifyDiagnosticsObservers(USERNAME, std::string()); - NotifyDiagnosticsObservers(LSID, std::string()); - NotifyDiagnosticsObservers(signin_internals_util::SID, std::string()); + NotifyDiagnosticsObservers(USERNAME, ""); + NotifyDiagnosticsObservers(LSID, ""); + NotifyDiagnosticsObservers( + signin_internals_util::SID, ""); TokenService* token_service = TokenServiceFactory::GetForProfile(profile_); content::NotificationService::current()->Notify( diff --git a/chrome/browser/signin/signin_manager_factory.cc b/chrome/browser/signin/signin_manager_factory.cc index 11dd5e6..67e33c0 100644 --- a/chrome/browser/signin/signin_manager_factory.cc +++ b/chrome/browser/signin/signin_manager_factory.cc @@ -39,11 +39,9 @@ SigninManagerFactory* SigninManagerFactory::GetInstance() { } void SigninManagerFactory::RegisterUserPrefs(PrefRegistrySyncable* registry) { - registry->RegisterStringPref(prefs::kGoogleServicesLastUsername, - std::string(), + registry->RegisterStringPref(prefs::kGoogleServicesLastUsername, "", PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterStringPref(prefs::kGoogleServicesUsername, - std::string(), + registry->RegisterStringPref(prefs::kGoogleServicesUsername, "", PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterBooleanPref(prefs::kAutologinEnabled, true, PrefRegistrySyncable::UNSYNCABLE_PREF); @@ -56,8 +54,7 @@ void SigninManagerFactory::RegisterUserPrefs(PrefRegistrySyncable* registry) { // static void SigninManagerFactory::RegisterPrefs(PrefRegistrySimple* registry) { - registry->RegisterStringPref(prefs::kGoogleServicesUsernamePattern, - std::string()); + registry->RegisterStringPref(prefs::kGoogleServicesUsernamePattern, ""); } ProfileKeyedService* SigninManagerFactory::BuildServiceInstanceFor( diff --git a/chrome/browser/signin/signin_manager_unittest.cc b/chrome/browser/signin/signin_manager_unittest.cc index c49f7a1..79964d0 100644 --- a/chrome/browser/signin/signin_manager_unittest.cc +++ b/chrome/browser/signin/signin_manager_unittest.cc @@ -308,8 +308,7 @@ TEST_F(SigninManagerTest, SignInClientLogin) { manager_->Initialize(profile_.get()); EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty()); - manager_->StartSignIn( - "user@gmail.com", "password", std::string(), std::string()); + manager_->StartSignIn("user@gmail.com", "password", "", ""); EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty()); SimulateValidResponseClientLogin(true); @@ -341,7 +340,7 @@ TEST_F(SigninManagerTest, Prohibited) { EXPECT_TRUE(manager_->IsAllowedUsername("happy@google.com")); EXPECT_FALSE(manager_->IsAllowedUsername("test@invalid.com")); EXPECT_FALSE(manager_->IsAllowedUsername("test@notgoogle.com")); - EXPECT_FALSE(manager_->IsAllowedUsername(std::string())); + EXPECT_FALSE(manager_->IsAllowedUsername("")); } TEST_F(SigninManagerTest, TestAlternateWildcard) { @@ -354,7 +353,7 @@ TEST_F(SigninManagerTest, TestAlternateWildcard) { EXPECT_TRUE(manager_->IsAllowedUsername("happy@google.com")); EXPECT_FALSE(manager_->IsAllowedUsername("test@invalid.com")); EXPECT_FALSE(manager_->IsAllowedUsername("test@notgoogle.com")); - EXPECT_FALSE(manager_->IsAllowedUsername(std::string())); + EXPECT_FALSE(manager_->IsAllowedUsername("")); } TEST_F(SigninManagerTest, ProhibitedAtStartup) { @@ -422,7 +421,7 @@ TEST_F(SigninManagerTest, SignInWithCredentialsEmptyPasswordValidCookie) { net::CookieMonster::SetCookiesCallback()); // Since the password is empty, will verify the gaia cookies first. - manager_->StartSignInWithCredentials("0", "user@gmail.com", std::string()); + manager_->StartSignInWithCredentials("0", "user@gmail.com", ""); WaitUntilUIDone(); @@ -435,7 +434,7 @@ TEST_F(SigninManagerTest, SignInWithCredentialsEmptyPasswordNoValidCookie) { EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty()); // Since the password is empty, will verify the gaia cookies first. - manager_->StartSignInWithCredentials("0", "user@gmail.com", std::string()); + manager_->StartSignInWithCredentials("0", "user@gmail.com", ""); WaitUntilUIDone(); @@ -459,7 +458,7 @@ TEST_F(SigninManagerTest, SignInWithCredentialsEmptyPasswordInValidCookie) { net::CookieMonster::SetCookiesCallback()); // Since the password is empty, must verify the gaia cookies first. - manager_->StartSignInWithCredentials("0", "user@gmail.com", std::string()); + manager_->StartSignInWithCredentials("0", "user@gmail.com", ""); WaitUntilUIDone(); @@ -472,7 +471,7 @@ TEST_F(SigninManagerTest, SignInClientLoginNoGPlus) { manager_->Initialize(profile_.get()); EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty()); - manager_->StartSignIn("username", "password", std::string(), std::string()); + manager_->StartSignIn("username", "password", "", ""); EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty()); SimulateValidResponseClientLogin(false); @@ -483,7 +482,7 @@ TEST_F(SigninManagerTest, ClearTransientSigninData) { manager_->Initialize(profile_.get()); EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty()); - manager_->StartSignIn("username", "password", std::string(), std::string()); + manager_->StartSignIn("username", "password", "", ""); EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty()); SimulateValidResponseClientLogin(false); @@ -514,7 +513,7 @@ TEST_F(SigninManagerTest, ClearTransientSigninData) { TEST_F(SigninManagerTest, SignOutClientLogin) { manager_->Initialize(profile_.get()); - manager_->StartSignIn("username", "password", std::string(), std::string()); + manager_->StartSignIn("username", "password", "", ""); SimulateValidResponseClientLogin(false); manager_->OnClientLoginSuccess(credentials_); @@ -530,7 +529,7 @@ TEST_F(SigninManagerTest, SignOutClientLogin) { TEST_F(SigninManagerTest, SignInFailureClientLogin) { manager_->Initialize(profile_.get()); - manager_->StartSignIn("username", "password", std::string(), std::string()); + manager_->StartSignIn("username", "password", "", ""); GoogleServiceAuthError error(GoogleServiceAuthError::REQUEST_CANCELED); manager_->OnClientLoginFailure(error); @@ -548,7 +547,7 @@ TEST_F(SigninManagerTest, SignInFailureClientLogin) { TEST_F(SigninManagerTest, ProvideSecondFactorSuccess) { manager_->Initialize(profile_.get()); - manager_->StartSignIn("username", "password", std::string(), std::string()); + manager_->StartSignIn("username", "password", "", ""); GoogleServiceAuthError error(GoogleServiceAuthError::TWO_FACTOR); manager_->OnClientLoginFailure(error); @@ -567,7 +566,7 @@ TEST_F(SigninManagerTest, ProvideSecondFactorSuccess) { TEST_F(SigninManagerTest, ProvideSecondFactorFailure) { manager_->Initialize(profile_.get()); - manager_->StartSignIn("username", "password", std::string(), std::string()); + manager_->StartSignIn("username", "password", "", ""); GoogleServiceAuthError error1(GoogleServiceAuthError::TWO_FACTOR); manager_->OnClientLoginFailure(error1); @@ -597,7 +596,7 @@ TEST_F(SigninManagerTest, ProvideSecondFactorFailure) { TEST_F(SigninManagerTest, SignOutMidConnect) { manager_->Initialize(profile_.get()); - manager_->StartSignIn("username", "password", std::string(), std::string()); + manager_->StartSignIn("username", "password", "", ""); manager_->SignOut(); EXPECT_EQ(0U, google_login_success_.size()); EXPECT_EQ(0U, google_login_failure_.size()); diff --git a/chrome/browser/signin/token_service_unittest.cc b/chrome/browser/signin/token_service_unittest.cc index fbe83df..617a394 100644 --- a/chrome/browser/signin/token_service_unittest.cc +++ b/chrome/browser/signin/token_service_unittest.cc @@ -225,7 +225,7 @@ TEST_F(TokenServiceTest, OnTokenSuccessUpdate) { EXPECT_EQ(service_->GetTokenForService(GaiaConstants::kSyncService), "token2"); - service_->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, std::string()); + service_->OnIssueAuthTokenSuccess(GaiaConstants::kSyncService, ""); EXPECT_TRUE(service_->HasTokenForService(GaiaConstants::kSyncService)); EXPECT_EQ(service_->GetTokenForService(GaiaConstants::kSyncService), ""); } diff --git a/chrome/browser/spellchecker/spelling_service_client_unittest.cc b/chrome/browser/spellchecker/spelling_service_client_unittest.cc index 5833fce..d3243e8 100644 --- a/chrome/browser/spellchecker/spelling_service_client_unittest.cc +++ b/chrome/browser/spellchecker/spelling_service_client_unittest.cc @@ -343,7 +343,7 @@ TEST_F(SpellingServiceClientTest, AvailableServices) { // SpellingServiceClient::IsAvailable() describes why this function returns // false for suggestions.) If there is no language set, then we // do not allow any remote. - pref->SetString(prefs::kSpellCheckDictionary, std::string()); + pref->SetString(prefs::kSpellCheckDictionary, ""); EXPECT_FALSE(client_.IsAvailable(&profile_, kSuggest)); EXPECT_FALSE(client_.IsAvailable(&profile_, kSpellcheck)); diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc index 615c4c6..6942d1e 100644 --- a/chrome/browser/ssl/ssl_blocking_page.cc +++ b/chrome/browser/ssl/ssl_blocking_page.cc @@ -218,9 +218,9 @@ std::string SSLBlockingPage::GetHTMLContents() { l10n_util::GetStringUTF16( IDS_SSL_ERROR_PAGE_CANNOT_PROCEED)); } else { - strings.SetString("reasonForNotProceeding", std::string()); + strings.SetString("reasonForNotProceeding", ""); } - strings.SetString("errorType", std::string()); + strings.SetString("errorType", ""); } strings.SetString("textdirection", base::i18n::IsRTL() ? "rtl" : "ltr"); @@ -318,6 +318,6 @@ void SSLBlockingPage::SetExtraInfo( strings->SetString(keys[i], extra_info[i]); } for (; i < 5; i++) { - strings->SetString(keys[i], std::string()); + strings->SetString(keys[i], ""); } } diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc index d4afe0f..42cfbf6 100644 --- a/chrome/browser/ssl/ssl_browser_tests.cc +++ b/chrome/browser/ssl/ssl_browser_tests.cc @@ -738,9 +738,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_TestHTTPSErrorWithNoNavEntry) { IN_PROC_BROWSER_TEST_F(SSLUITest, TestBadHTTPSDownload) { ASSERT_TRUE(test_server()->Start()); ASSERT_TRUE(https_server_expired_.Start()); - GURL url_non_dangerous = test_server()->GetURL(std::string()); - GURL url_dangerous = - https_server_expired_.GetURL("files/downloads/dangerous/dangerous.exe"); + GURL url_non_dangerous = test_server()->GetURL(""); + GURL url_dangerous = https_server_expired_.GetURL( + "files/downloads/dangerous/dangerous.exe"); base::ScopedTempDir downloads_directory_; // Need empty temp dir to avoid having Chrome ask us for a new filename diff --git a/chrome/browser/storage_monitor/media_storage_util.cc b/chrome/browser/storage_monitor/media_storage_util.cc index dc9c61b..72602fa 100644 --- a/chrome/browser/storage_monitor/media_storage_util.cc +++ b/chrome/browser/storage_monitor/media_storage_util.cc @@ -187,9 +187,8 @@ std::string MediaStorageUtil::MakeDeviceId(Type type, bool MediaStorageUtil::CrackDeviceId(const std::string& device_id, Type* type, std::string* unique_id) { size_t prefix_length = device_id.find_first_of(':'); - std::string prefix = prefix_length != std::string::npos - ? device_id.substr(0, prefix_length + 1) - : std::string(); + std::string prefix = prefix_length != std::string::npos ? + device_id.substr(0, prefix_length + 1) : ""; Type found_type; if (prefix == kRemovableMassStorageWithDCIMPrefix) { diff --git a/chrome/browser/sync/glue/session_model_associator_unittest.cc b/chrome/browser/sync/glue/session_model_associator_unittest.cc index e5ceab1e..d1f63bb 100644 --- a/chrome/browser/sync/glue/session_model_associator_unittest.cc +++ b/chrome/browser/sync/glue/session_model_associator_unittest.cc @@ -375,7 +375,7 @@ TEST_F(SyncSessionModelAssociatorTest, SetSessionTabFromDelegate) { // Create tab specifics with an empty favicon. Ensure it gets ignored and not // stored into the synced favicon lookups. TEST_F(SyncSessionModelAssociatorTest, LoadEmptyFavicon) { - std::string favicon; + std::string favicon = ""; std::string favicon_url = "http://www.faviconurl.com/favicon.ico"; std::string page_url = "http://www.faviconurl.com/page.html"; sync_pb::SessionTab tab; diff --git a/chrome/browser/sync/glue/sync_backend_host_unittest.cc b/chrome/browser/sync/glue/sync_backend_host_unittest.cc index d05dd46..96d1acb 100644 --- a/chrome/browser/sync/glue/sync_backend_host_unittest.cc +++ b/chrome/browser/sync/glue/sync_backend_host_unittest.cc @@ -194,7 +194,7 @@ class SyncBackendHostTest : public testing::Test { WillOnce(InvokeWithoutArgs(QuitMessageLoop)); backend_->Initialize(&mock_frontend_, syncer::WeakHandle<syncer::JsEventHandler>(), - GURL(std::string()), + GURL(""), credentials_, true, &fake_manager_factory_, diff --git a/chrome/browser/sync/glue/synced_session.h b/chrome/browser/sync/glue/synced_session.h index 80ff9be..a1d0d68 100644 --- a/chrome/browser/sync/glue/synced_session.h +++ b/chrome/browser/sync/glue/synced_session.h @@ -74,7 +74,7 @@ struct SyncedSession { case SyncedSession::TYPE_TABLET: return "tablet"; default: - return std::string(); + return ""; } } diff --git a/chrome/browser/sync/invalidations/invalidator_storage.cc b/chrome/browser/sync/invalidations/invalidator_storage.cc index e88d0e2..acbbd47 100644 --- a/chrome/browser/sync/invalidations/invalidator_storage.cc +++ b/chrome/browser/sync/invalidations/invalidator_storage.cc @@ -282,10 +282,8 @@ void InvalidatorStorage::SetBootstrapData(const std::string& data) { } std::string InvalidatorStorage::GetBootstrapData() const { - std::string base64_data( - pref_service_ - ? pref_service_->GetString(prefs::kInvalidatorInvalidationState) - : std::string()); + std::string base64_data(pref_service_ ? + pref_service_->GetString(prefs::kInvalidatorInvalidationState) : ""); std::string data; base::Base64Decode(base64_data, &data); return data; diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index a58fff4..2d8bbd3 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -726,7 +726,7 @@ void ProfileSyncService::ClearUnrecoverableError() { std::string ProfileSyncService::GetExperimentNameForDataType( syncer::ModelType data_type) { NOTREACHED(); - return std::string(); + return ""; } void ProfileSyncService::RegisterNewDataType(syncer::ModelType data_type) { diff --git a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc index 1ad62a1..bc62c97 100644 --- a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc @@ -706,9 +706,9 @@ TEST_F(ProfileSyncServiceBookmarkTest, ServerChangeProcessing) { "'about:blank','gnotesWin','location=0,menubar=0," \ "scrollbars=0,status=0,toolbar=0,width=300," \ "height=300,resizable');});"); - adds.AddURL(std::wstring(), javascript_url, other_bookmarks_id(), 0); - int64 u6 = adds.AddURL( - L"Sync1", "http://www.syncable.edu/", mobile_bookmarks_id(), 0); + adds.AddURL(L"", javascript_url, other_bookmarks_id(), 0); + int64 u6 = adds.AddURL(L"Sync1", "http://www.syncable.edu/", + mobile_bookmarks_id(), 0); syncer::ChangeRecordList::const_iterator it; // The bookmark model shouldn't yet have seen any of the nodes of |adds|. diff --git a/chrome/browser/sync/profile_sync_service_harness.cc b/chrome/browser/sync/profile_sync_service_harness.cc index eb0b074..c290374 100644 --- a/chrome/browser/sync/profile_sync_service_harness.cc +++ b/chrome/browser/sync/profile_sync_service_harness.cc @@ -134,7 +134,7 @@ ProfileSyncServiceHarness* ProfileSyncServiceHarness::CreateAndAttach( NOTREACHED() << "Profile has never signed into sync."; return NULL; } - return new ProfileSyncServiceHarness(profile, std::string(), std::string()); + return new ProfileSyncServiceHarness(profile, "", ""); } void ProfileSyncServiceHarness::SetCredentials(const std::string& username, @@ -179,8 +179,7 @@ bool ProfileSyncServiceHarness::SetupSync( service_->SetSetupInProgress(true); // Authenticate sync client using GAIA credentials. - service_->signin() - ->StartSignIn(username_, password_, std::string(), std::string()); + service_->signin()->StartSignIn(username_, password_, "", ""); // Wait for the OnBackendInitialized() callback. if (!AwaitBackendInitialized()) { @@ -1015,7 +1014,7 @@ std::string ProfileSyncServiceHarness::GetSerializedProgressMarker( syncer::ProgressMarkerMap::const_iterator it = markers_map.find(model_type); - return (it != markers_map.end()) ? it->second : std::string(); + return (it != markers_map.end()) ? it->second : ""; } std::string ProfileSyncServiceHarness::GetClientInfoString( diff --git a/chrome/browser/sync/profile_sync_service_session_unittest.cc b/chrome/browser/sync/profile_sync_service_session_unittest.cc index 4ed28ab..1ee92a6 100644 --- a/chrome/browser/sync/profile_sync_service_session_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_session_unittest.cc @@ -85,10 +85,8 @@ class FakeProfileSyncService : public TestProfileSyncService { virtual ~FakeProfileSyncService() {} virtual scoped_ptr<DeviceInfo> GetLocalDeviceInfo() const OVERRIDE { - return scoped_ptr<DeviceInfo>(new DeviceInfo("client_name", - std::string(), - std::string(), - sync_pb::SyncEnums::TYPE_WIN)); + return scoped_ptr<DeviceInfo>( + new DeviceInfo("client_name", "", "", sync_pb::SyncEnums::TYPE_WIN)); } }; diff --git a/chrome/browser/sync/profile_sync_service_startup_unittest.cc b/chrome/browser/sync/profile_sync_service_startup_unittest.cc index d85946e..1a00308 100644 --- a/chrome/browser/sync/profile_sync_service_startup_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_startup_unittest.cc @@ -189,10 +189,9 @@ TEST_F(ProfileSyncServiceStartupTest, StartFirstTime) { // Create some tokens in the token service; the service will startup when // it is notified that tokens are available. sync_->SetSetupInProgress(true); - sync_->signin() - ->StartSignIn("test_user", std::string(), std::string(), std::string()); - TokenServiceFactory::GetForProfile(profile_.get()) - ->IssueAuthTokenForTest(GaiaConstants::kSyncService, "sync_token"); + sync_->signin()->StartSignIn("test_user", "", "", ""); + TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest( + GaiaConstants::kSyncService, "sync_token"); TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest( GaiaConstants::kGaiaOAuth2LoginRefreshToken, "oauth2_login_token"); sync_->SetSetupInProgress(false); @@ -236,8 +235,7 @@ TEST_F(ProfileSyncServiceStartupTest, StartNoCredentials) { EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber()); sync_->SetSetupInProgress(true); - sync_->signin() - ->StartSignIn("test_user", std::string(), std::string(), std::string()); + sync_->signin()->StartSignIn("test_user", "", "", ""); // NOTE: Unlike StartFirstTime, this test does not issue any auth tokens. token_service->LoadTokensFromDB(); sync_->SetSetupInProgress(false); @@ -271,10 +269,9 @@ TEST_F(ProfileSyncServiceStartupTest, StartInvalidCredentials) { EXPECT_CALL(*data_type_manager, Stop()).Times(1); EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber()); sync_->SetSetupInProgress(true); - sync_->signin() - ->StartSignIn("test_user", std::string(), std::string(), std::string()); - token_service->IssueAuthTokenForTest(GaiaConstants::kSyncService, - "sync_token"); + sync_->signin()->StartSignIn("test_user", "", "", ""); + token_service->IssueAuthTokenForTest( + GaiaConstants::kSyncService, "sync_token"); sync_->SetSetupInProgress(false); MessageLoop::current()->Run(); diff --git a/chrome/browser/sync/sync_prefs.cc b/chrome/browser/sync/sync_prefs.cc index a5c58e8..0c7a4bd 100644 --- a/chrome/browser/sync/sync_prefs.cc +++ b/chrome/browser/sync/sync_prefs.cc @@ -87,10 +87,10 @@ void SyncPrefs::RegisterUserPrefs(PrefRegistrySyncable* registry) { false, PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterStringPref(prefs::kSyncEncryptionBootstrapToken, - std::string(), + "", PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterStringPref(prefs::kSyncKeystoreEncryptionBootstrapToken, - std::string(), + "", PrefRegistrySyncable::UNSYNCABLE_PREF); #if defined(OS_CHROMEOS) registry->RegisterStringPref(prefs::kSyncSpareBootstrapToken, @@ -99,7 +99,7 @@ void SyncPrefs::RegisterUserPrefs(PrefRegistrySyncable* registry) { #endif registry->RegisterStringPref(prefs::kSyncSessionsGUID, - std::string(), + "", PrefRegistrySyncable::UNSYNCABLE_PREF); // We will start prompting people about new data types after the launch of @@ -181,9 +181,9 @@ void SyncPrefs::SetStartSuppressed(bool is_suppressed) { std::string SyncPrefs::GetGoogleServicesUsername() const { DCHECK(CalledOnValidThread()); - return pref_service_ - ? pref_service_->GetString(prefs::kGoogleServicesUsername) - : std::string(); + return + pref_service_ ? + pref_service_->GetString(prefs::kGoogleServicesUsername) : ""; } base::Time SyncPrefs::GetLastSyncedTime() const { @@ -266,9 +266,9 @@ bool SyncPrefs::IsManaged() const { std::string SyncPrefs::GetEncryptionBootstrapToken() const { DCHECK(CalledOnValidThread()); - return pref_service_ - ? pref_service_->GetString(prefs::kSyncEncryptionBootstrapToken) - : std::string(); + return + pref_service_ ? + pref_service_->GetString(prefs::kSyncEncryptionBootstrapToken) : ""; } void SyncPrefs::SetEncryptionBootstrapToken(const std::string& token) { @@ -278,9 +278,10 @@ void SyncPrefs::SetEncryptionBootstrapToken(const std::string& token) { std::string SyncPrefs::GetKeystoreEncryptionBootstrapToken() const { DCHECK(CalledOnValidThread()); - return pref_service_ ? pref_service_->GetString( - prefs::kSyncKeystoreEncryptionBootstrapToken) - : std::string(); + return + pref_service_ ? + pref_service_->GetString(prefs::kSyncKeystoreEncryptionBootstrapToken) : + ""; } void SyncPrefs::SetKeystoreEncryptionBootstrapToken(const std::string& token) { @@ -290,8 +291,9 @@ void SyncPrefs::SetKeystoreEncryptionBootstrapToken(const std::string& token) { std::string SyncPrefs::GetSyncSessionsGUID() const { DCHECK(CalledOnValidThread()); - return pref_service_ ? pref_service_->GetString(prefs::kSyncSessionsGUID) - : std::string(); + return + pref_service_ ? + pref_service_->GetString(prefs::kSyncSessionsGUID) : ""; } void SyncPrefs::SetSyncSessionsGUID(const std::string& guid) { diff --git a/chrome/browser/sync/test/integration/sync_extension_helper.cc b/chrome/browser/sync/test/integration/sync_extension_helper.cc index fc007af9..84cf7547 100644 --- a/chrome/browser/sync/test/integration/sync_extension_helper.cc +++ b/chrome/browser/sync/test/integration/sync_extension_helper.cc @@ -63,7 +63,7 @@ std::string SyncExtensionHelper::InstallExtension( scoped_refptr<Extension> extension = GetExtension(profile, name, type); if (!extension.get()) { NOTREACHED() << "Could not install extension " << name; - return std::string(); + return ""; } profile->GetExtensionService()->OnExtensionInstalled( extension, syncer::StringOrdinal(), false /* no requirement errors */, diff --git a/chrome/browser/sync_file_system/drive_file_sync_client.cc b/chrome/browser/sync_file_system/drive_file_sync_client.cc index 7f8903a..b6c8095 100644 --- a/chrome/browser/sync_file_system/drive_file_sync_client.cc +++ b/chrome/browser/sync_file_system/drive_file_sync_client.cc @@ -129,7 +129,7 @@ DriveFileSyncClient::DriveFileSyncClient(Profile* profile) drive_service_.reset(new google_apis::GDataWapiService( profile->GetRequestContext(), GURL(google_apis::GDataWapiUrlGenerator::kBaseUrlForProduction), - std::string() /* custom_user_agent */)); + "" /* custom_user_agent */)); drive_service_->Initialize(profile); drive_service_->AddObserver(this); net::NetworkChangeNotifier::AddConnectionTypeObserver(this); diff --git a/chrome/browser/sync_file_system/drive_file_sync_service.cc b/chrome/browser/sync_file_system/drive_file_sync_service.cc index 15691f49..c7a12a7 100644 --- a/chrome/browser/sync_file_system/drive_file_sync_service.cc +++ b/chrome/browser/sync_file_system/drive_file_sync_service.cc @@ -411,8 +411,7 @@ void DriveFileSyncService::RegisterOriginForTrackingChanges( void DriveFileSyncService::UnregisterOriginForTrackingChanges( const GURL& origin, const SyncStatusCallback& callback) { - scoped_ptr<TaskToken> token( - GetToken(FROM_HERE, TASK_TYPE_DATABASE, std::string())); + scoped_ptr<TaskToken> token(GetToken(FROM_HERE, TASK_TYPE_DATABASE, "")); if (!token) { pending_tasks_.push_back(base::Bind( &DriveFileSyncService::UnregisterOriginForTrackingChanges, @@ -443,8 +442,7 @@ void DriveFileSyncService::EnableOriginForTrackingChanges( if (!metadata_store_->IsOriginDisabled(origin)) return; - scoped_ptr<TaskToken> token( - GetToken(FROM_HERE, TASK_TYPE_DATABASE, std::string())); + scoped_ptr<TaskToken> token(GetToken(FROM_HERE, TASK_TYPE_DATABASE, "")); if (!token) { pending_tasks_.push_back(base::Bind( &DriveFileSyncService::EnableOriginForTrackingChanges, @@ -465,8 +463,7 @@ void DriveFileSyncService::DisableOriginForTrackingChanges( !metadata_store_->IsIncrementalSyncOrigin(origin)) return; - scoped_ptr<TaskToken> token( - GetToken(FROM_HERE, TASK_TYPE_DATABASE, std::string())); + scoped_ptr<TaskToken> token(GetToken(FROM_HERE, TASK_TYPE_DATABASE, "")); if (!token) { pending_tasks_.push_back(base::Bind( &DriveFileSyncService::DisableOriginForTrackingChanges, diff --git a/chrome/browser/tab_contents/spelling_menu_observer_browsertest.cc b/chrome/browser/tab_contents/spelling_menu_observer_browsertest.cc index 47d6bdb..fd5ca6f 100644 --- a/chrome/browser/tab_contents/spelling_menu_observer_browsertest.cc +++ b/chrome/browser/tab_contents/spelling_menu_observer_browsertest.cc @@ -301,7 +301,7 @@ IN_PROC_BROWSER_TEST_F(SpellingMenuObserverTest, EnableSpellingService) { new SpellingMenuObserver(menu.get())); menu->SetObserver(observer.get()); menu->GetPrefs()->SetBoolean(prefs::kSpellCheckUseSpellingService, true); - menu->GetPrefs()->SetString(prefs::kSpellCheckDictionary, std::string()); + menu->GetPrefs()->SetString(prefs::kSpellCheckDictionary, ""); content::ContextMenuParams params; params.is_editable = true; diff --git a/chrome/browser/themes/theme_syncable_service_unittest.cc b/chrome/browser/themes/theme_syncable_service_unittest.cc index 8fa7d25..8a1829f 100644 --- a/chrome/browser/themes/theme_syncable_service_unittest.cc +++ b/chrome/browser/themes/theme_syncable_service_unittest.cc @@ -104,7 +104,7 @@ class FakeThemeService : public ThemeService { if (theme_extension_) return theme_extension_->id(); else - return std::string(); + return ""; } const extensions::Extension* theme_extension() const { diff --git a/chrome/browser/translate/translate_manager_browsertest.cc b/chrome/browser/translate/translate_manager_browsertest.cc index 8f2b12d..1078295 100644 --- a/chrome/browser/translate/translate_manager_browsertest.cc +++ b/chrome/browser/translate/translate_manager_browsertest.cc @@ -538,7 +538,7 @@ TEST_F(TranslateManagerBrowserTest, TranslateUnknownLanguage) { RenderViewHostTester::TestOnMessageReceived( rvh(), ChromeViewHostMsg_PageTranslated( - 2, 0, std::string(), "en", TranslateErrors::UNKNOWN_LANGUAGE)); + 2, 0, "", "en", TranslateErrors::UNKNOWN_LANGUAGE)); infobar = GetTranslateInfoBar(); ASSERT_TRUE(infobar != NULL); EXPECT_EQ(TranslateInfoBarDelegate::TRANSLATION_ERROR, diff --git a/chrome/browser/translate/translate_manager_unittest.cc b/chrome/browser/translate/translate_manager_unittest.cc index 6b176a1..9b25c95 100644 --- a/chrome/browser/translate/translate_manager_unittest.cc +++ b/chrome/browser/translate/translate_manager_unittest.cc @@ -16,7 +16,7 @@ typedef testing::Test TranslateManagerTest; TEST_F(TranslateManagerTest, CheckTranslatableURL) { - GURL empty_url = GURL(std::string()); + GURL empty_url = GURL(""); EXPECT_FALSE(TranslateManager::IsTranslatableURL(empty_url)); std::string chrome = std::string(chrome::kChromeUIScheme) + "://flags"; diff --git a/chrome/browser/ui/app_list/app_list_service.cc b/chrome/browser/ui/app_list/app_list_service.cc index a0bf010..f02da1e 100644 --- a/chrome/browser/ui/app_list/app_list_service.cc +++ b/chrome/browser/ui/app_list/app_list_service.cc @@ -66,7 +66,7 @@ void AppListService::RegisterPrefs(PrefRegistrySimple* registry) { registry->RegisterIntegerPref(prefs::kAppListLaunchCount, 0); registry->RegisterInt64Pref(prefs::kLastAppListAppLaunchPing, 0); registry->RegisterIntegerPref(prefs::kAppListAppLaunchCount, 0); - registry->RegisterStringPref(prefs::kAppListProfile, std::string()); + registry->RegisterStringPref(prefs::kAppListProfile, ""); #if defined(OS_WIN) registry->RegisterBooleanPref(prefs::kRestartWithAppList, false); #endif diff --git a/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc b/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc index 844f210..2ee22c3 100644 --- a/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc +++ b/chrome/browser/ui/blocked_content/blocked_content_tab_helper.cc @@ -110,8 +110,10 @@ void BlockedContentTabHelper::AddPopup(content::WebContents* new_contents, if (creator.is_valid() && profile->GetHostContentSettingsMap()->GetContentSetting( - creator, creator, CONTENT_SETTINGS_TYPE_POPUPS, std::string()) == - CONTENT_SETTING_ALLOW) { + creator, + creator, + CONTENT_SETTINGS_TYPE_POPUPS, + "") == CONTENT_SETTING_ALLOW) { content::WebContentsDelegate* delegate = web_contents()->GetDelegate(); if (delegate) { delegate->AddNewContents(web_contents(), diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index a31b4b0..47f07ca 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -813,13 +813,9 @@ void Browser::OpenFile() { ui::SelectFileDialog::FileTypeInfo file_types; file_types.support_drive = true; select_file_dialog_->SelectFile(ui::SelectFileDialog::SELECT_OPEN_FILE, - string16(), - directory, - &file_types, - 0, - base::FilePath::StringType(), - parent_window, - NULL); + string16(), directory, + &file_types, 0, FILE_PATH_LITERAL(""), + parent_window, NULL); } void Browser::UpdateDownloadShelfVisibility(bool visible) { diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc index e253102..5e6b769 100644 --- a/chrome/browser/ui/browser_browsertest.cc +++ b/chrome/browser/ui/browser_browsertest.cc @@ -558,7 +558,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, NullOpenerRedirectForksProcess) { base::FilePath(kDocRoot)); ASSERT_TRUE(https_test_server.Start()); GURL http_url(test_server()->GetURL("files/title1.html")); - GURL https_url(https_test_server.GetURL(std::string())); + GURL https_url(https_test_server.GetURL("")); // Start with an http URL. ui_test_utils::NavigateToURL(browser(), http_url); @@ -647,7 +647,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, OtherRedirectsDontForkProcess) { base::FilePath(kDocRoot)); ASSERT_TRUE(https_test_server.Start()); GURL http_url(test_server()->GetURL("files/title1.html")); - GURL https_url(https_test_server.GetURL(std::string())); + GURL https_url(https_test_server.GetURL("")); // Start with an http URL. ui_test_utils::NavigateToURL(browser(), http_url); @@ -747,7 +747,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutHttp) { browser()->command_controller()->command_updater(); ASSERT_TRUE(test_server()->Start()); - GURL http_url(test_server()->GetURL(std::string())); + GURL http_url(test_server()->GetURL("")); ASSERT_TRUE(http_url.SchemeIs(chrome::kHttpScheme)); ui_test_utils::NavigateToURL(browser(), http_url); EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS)); @@ -775,7 +775,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutFtp) { net::TestServer::kLocalhost, base::FilePath(kDocRoot)); ASSERT_TRUE(test_server.Start()); - GURL ftp_url(test_server.GetURL(std::string())); + GURL ftp_url(test_server.GetURL("")); ASSERT_TRUE(ftp_url.SchemeIs(chrome::kFtpScheme)); ui_test_utils::NavigateToURL(browser(), ftp_url); EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_CREATE_SHORTCUTS)); @@ -807,7 +807,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutInvalid) { // DISABLED: http://crbug.com/72310 IN_PROC_BROWSER_TEST_F(BrowserTest, DISABLED_ConvertTabToAppShortcut) { ASSERT_TRUE(test_server()->Start()); - GURL http_url(test_server()->GetURL(std::string())); + GURL http_url(test_server()->GetURL("")); ASSERT_TRUE(http_url.SchemeIs(chrome::kHttpScheme)); ASSERT_EQ(1, browser()->tab_strip_model()->count()); diff --git a/chrome/browser/ui/browser_tab_contents.cc b/chrome/browser/ui/browser_tab_contents.cc index fdcaa16..c4fe56c 100644 --- a/chrome/browser/ui/browser_tab_contents.cc +++ b/chrome/browser/ui/browser_tab_contents.cc @@ -172,10 +172,8 @@ void BrowserTabContents::AttachTabHelpers(WebContents* web_contents) { // because the connected state may change while this tab is open. Having a // one-click signin helper attached does not cause problems if the profile // happens to be already connected. - if (OneClickSigninHelper::CanOffer(web_contents, - OneClickSigninHelper::CAN_OFFER_FOR_ALL, - std::string(), - NULL)) { + if (OneClickSigninHelper::CanOffer( + web_contents, OneClickSigninHelper::CAN_OFFER_FOR_ALL, "", NULL)) { OneClickSigninHelper::CreateForWebContents(web_contents); } #endif diff --git a/chrome/browser/ui/browser_tabrestore.cc b/chrome/browser/ui/browser_tabrestore.cc index 373de5c..0e96e0d 100644 --- a/chrome/browser/ui/browser_tabrestore.cc +++ b/chrome/browser/ui/browser_tabrestore.cc @@ -50,7 +50,7 @@ WebContents* CreateRestoredTab( // session_storage_namespace.h include since we only need that to assign // into the map. content::SessionStorageNamespaceMap session_storage_namespace_map; - session_storage_namespace_map[std::string()] = session_storage_namespace; + session_storage_namespace_map[""] = session_storage_namespace; WebContents::CreateParams create_params( browser->profile(), tab_util::GetSiteInstanceForNewTab(browser->profile(), restore_url)); diff --git a/chrome/browser/ui/certificate_dialogs.cc b/chrome/browser/ui/certificate_dialogs.cc index 939c3a13..8e69b5d 100644 --- a/chrome/browser/ui/certificate_dialogs.cc +++ b/chrome/browser/ui/certificate_dialogs.cc @@ -52,7 +52,7 @@ std::string GetBase64String(net::X509Certificate::OSCertHandle cert) { if (!base::Base64Encode( x509_certificate_model::GetDerString(cert), &base64)) { LOG(ERROR) << "base64 encoding error"; - return std::string(); + return ""; } return "-----BEGIN CERTIFICATE-----\r\n" + WrapAt64(base64) + diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.cc index 7fed38a..fe9300c 100644 --- a/chrome/browser/ui/chrome_pages.cc +++ b/chrome/browser/ui/chrome_pages.cc @@ -65,7 +65,7 @@ void ShowBookmarkManager(Browser* browser) { } void ShowBookmarkManagerForNode(Browser* browser, int64 node_id) { - OpenBookmarkManagerWithHash(browser, std::string(), node_id); + OpenBookmarkManagerWithHash(browser, "", node_id); } void ShowHistory(Browser* browser) { diff --git a/chrome/browser/ui/chrome_select_file_policy_unittest.cc b/chrome/browser/ui/chrome_select_file_policy_unittest.cc index ad735f8..d5a6c10 100644 --- a/chrome/browser/ui/chrome_select_file_policy_unittest.cc +++ b/chrome/browser/ui/chrome_select_file_policy_unittest.cc @@ -56,7 +56,7 @@ class FileSelectionUser : public ui::SelectFileDialog::Listener { file_path, NULL, 0, - base::FilePath::StringType()), + FILE_PATH_LITERAL(""), NULL, NULL); file_selection_initialisation_in_progress = false; diff --git a/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc b/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc index 3c851f4..34bb7f0 100644 --- a/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc +++ b/chrome/browser/ui/fullscreen/fullscreen_controller_state_test.cc @@ -658,7 +658,7 @@ FullscreenControllerStateTest::StateTransitionInfo std::string FullscreenControllerStateTest::GetAndClearDebugLog() { debugging_log_ << "(End of Debugging Log)\n"; std::string output_log = "\nDebugging Log:\n" + debugging_log_.str(); - debugging_log_.str(std::string()); + debugging_log_.str(""); return output_log; } diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc index a4d0a2b..3796706 100644 --- a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc +++ b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc @@ -462,12 +462,7 @@ bool CreateNewBookmarkFromNetscapeURL(GtkSelectionData* selection_data, string16 GetNameForURL(const GURL& url) { if (url.is_valid()) { - return net::GetSuggestedFilename(url, - std::string(), - std::string(), - std::string(), - std::string(), - std::string()); + return net::GetSuggestedFilename(url, "", "", "", "", std::string()); } else { return l10n_util::GetStringUTF16(IDS_APP_UNTITLED_SHORTCUT_FILE_NAME); } diff --git a/chrome/browser/ui/gtk/constrained_web_dialog_delegate_gtk.cc b/chrome/browser/ui/gtk/constrained_web_dialog_delegate_gtk.cc index fdb10b5..fe42588 100644 --- a/chrome/browser/ui/gtk/constrained_web_dialog_delegate_gtk.cc +++ b/chrome/browser/ui/gtk/constrained_web_dialog_delegate_gtk.cc @@ -127,7 +127,7 @@ ConstrainedWebDialogDelegateViewGtk::ConstrainedWebDialogDelegateViewGtk( void ConstrainedWebDialogDelegateViewGtk::OnDestroy(GtkWidget* widget) { if (!impl_->closed_via_webui()) - GetWebDialogDelegate()->OnDialogClosed(std::string()); + GetWebDialogDelegate()->OnDialogClosed(""); delete this; } diff --git a/chrome/browser/ui/gtk/first_run_bubble.cc b/chrome/browser/ui/gtk/first_run_bubble.cc index 70bf245..7207758 100644 --- a/chrome/browser/ui/gtk/first_run_bubble.cc +++ b/chrome/browser/ui/gtk/first_run_bubble.cc @@ -44,12 +44,10 @@ FirstRunBubble::FirstRunBubble(Browser* browser, : browser_(browser), bubble_(NULL) { GtkThemeService* theme_service = GtkThemeService::GetFrom(browser->profile()); - GtkWidget* title = theme_service->BuildLabel(std::string(), ui::kGdkBlack); - char* markup = g_markup_printf_escaped( - kSearchLabelMarkup, + GtkWidget* title = theme_service->BuildLabel("", ui::kGdkBlack); + char* markup = g_markup_printf_escaped(kSearchLabelMarkup, l10n_util::GetStringFUTF8(IDS_FR_BUBBLE_TITLE, - GetDefaultSearchEngineName(browser->profile())) - .c_str()); + GetDefaultSearchEngineName(browser->profile())).c_str()); gtk_label_set_markup(GTK_LABEL(title), markup); g_free(markup); diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk.cc b/chrome/browser/ui/gtk/location_bar_view_gtk.cc index 9bd0ebb..befcd30 100644 --- a/chrome/browser/ui/gtk/location_bar_view_gtk.cc +++ b/chrome/browser/ui/gtk/location_bar_view_gtk.cc @@ -410,9 +410,9 @@ void LocationBarViewGtk::Init(bool popup_window_mode) { // Tab to search (the keyword box on the left hand side). tab_to_search_full_label_ = - theme_service_->BuildLabel(std::string(), ui::kGdkBlack); + theme_service_->BuildLabel("", ui::kGdkBlack); tab_to_search_partial_label_ = - theme_service_->BuildLabel(std::string(), ui::kGdkBlack); + theme_service_->BuildLabel("", ui::kGdkBlack); GtkWidget* tab_to_search_label_hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(tab_to_search_label_hbox), tab_to_search_full_label_, FALSE, FALSE, 0); @@ -458,12 +458,12 @@ void LocationBarViewGtk::Init(bool popup_window_mode) { tab_to_search_hint_ = gtk_hbox_new(FALSE, 0); gtk_widget_set_name(tab_to_search_hint_, "chrome-tab-to-search-hint"); tab_to_search_hint_leading_label_ = - theme_service_->BuildLabel(std::string(), kHintTextColor); + theme_service_->BuildLabel("", kHintTextColor); gtk_widget_set_sensitive(tab_to_search_hint_leading_label_, FALSE); tab_to_search_hint_icon_ = gtk_image_new_from_pixbuf( rb.GetNativeImageNamed(IDR_LOCATION_BAR_KEYWORD_HINT_TAB).ToGdkPixbuf()); tab_to_search_hint_trailing_label_ = - theme_service_->BuildLabel(std::string(), kHintTextColor); + theme_service_->BuildLabel("", kHintTextColor); gtk_widget_set_sensitive(tab_to_search_hint_trailing_label_, FALSE); gtk_box_pack_start(GTK_BOX(tab_to_search_hint_), tab_to_search_hint_leading_label_, diff --git a/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc b/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc index d96e1d2..ebf2e78 100644 --- a/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc +++ b/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc @@ -249,7 +249,7 @@ std::string SSLClientCertificateSelector::FormatComboBoxText( net::X509Certificate::OSCertHandle cert, const std::string& nickname) { std::string rv(nickname); rv += " ["; - rv += x509_certificate_model::GetSerialNumberHexified(cert, std::string()); + rv += x509_certificate_model::GetSerialNumberHexified(cert, ""); rv += ']'; return rv; } @@ -266,8 +266,8 @@ std::string SSLClientCertificateSelector::FormatDetailsText( rv += "\n "; rv += l10n_util::GetStringFUTF8( IDS_CERT_SERIAL_NUMBER_FORMAT, - UTF8ToUTF16(x509_certificate_model::GetSerialNumberHexified( - cert, std::string()))); + UTF8ToUTF16( + x509_certificate_model::GetSerialNumberHexified(cert, ""))); base::Time issued, expires; if (x509_certificate_model::GetTimes(cert, &issued, &expires)) { diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/prefs/prefs_tab_helper.cc index 7056161..b629064 100644 --- a/chrome/browser/ui/prefs/prefs_tab_helper.cc +++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc @@ -152,7 +152,7 @@ ALL_FONT_SCRIPTS(WEBKIT_WEBPREFS_FONTS_STANDARD) // We haven't already set a default value for this font preference, so set // an empty string as the default. registry->RegisterStringPref( - pref_name, std::string(), PrefRegistrySyncable::UNSYNCABLE_PREF); + pref_name, "", PrefRegistrySyncable::UNSYNCABLE_PREF); } } } @@ -587,7 +587,7 @@ void PrefsTabHelper::RegisterUserPrefs(PrefRegistrySyncable* registry) { IDS_STATIC_ENCODING_LIST, PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterStringPref(prefs::kRecentlySelectedEncoding, - std::string(), + "", PrefRegistrySyncable::UNSYNCABLE_PREF); RegisterPrefsToMigrate(registry); @@ -666,7 +666,7 @@ void PrefsTabHelper::OnWebPrefChanged(const std::string& pref_name) { if (pref_value.empty()) { WebPreferences web_prefs = web_contents_->GetRenderViewHost()->GetWebkitPreferences(); - OverrideFontFamily(&web_prefs, generic_family, script, std::string()); + OverrideFontFamily(&web_prefs, generic_family, script, ""); web_contents_->GetRenderViewHost()->UpdateWebkitPreferences(web_prefs); return; } diff --git a/chrome/browser/ui/search/instant_browsertest.cc b/chrome/browser/ui/search/instant_browsertest.cc index 2e4beb2..6afe15b 100644 --- a/chrome/browser/ui/search/instant_browsertest.cc +++ b/chrome/browser/ui/search/instant_browsertest.cc @@ -607,7 +607,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, PageVisibility) { EXPECT_TRUE(CheckVisibilityIs(overlay, true)); // Deleting the omnibox text should hide the overlay. - SetOmniboxText(std::string()); + SetOmniboxText(""); EXPECT_TRUE(CheckVisibilityIs(active_tab, true)); EXPECT_TRUE(CheckVisibilityIs(overlay, false)); diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc index 1d0cff3..7600026 100644 --- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc +++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc @@ -933,8 +933,8 @@ void StartupBrowserCreatorImpl::AddStartupURLs( GURL(std::string(chrome::kChromeUISettingsURL) + chrome::kManagedUserSettingsSubPage)); if (has_reset_local_passphrase_switch) { - prefs->SetString(prefs::kManagedModeLocalPassphrase, std::string()); - prefs->SetString(prefs::kManagedModeLocalSalt, std::string()); + prefs->SetString(prefs::kManagedModeLocalPassphrase, ""); + prefs->SetString(prefs::kManagedModeLocalSalt, ""); } } diff --git a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc index 4892ab6..e879b6e 100644 --- a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc +++ b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc @@ -389,15 +389,13 @@ TEST_F(OneClickSigninHelperTest, CanOfferNoContents) { "user@gmail.com", &error_message)); EXPECT_EQ("", error_message); EXPECT_FALSE(OneClickSigninHelper::CanOffer( - NULL, - OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, - std::string(), - &error_message)); + NULL, OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, + "", &error_message)); EXPECT_EQ("", error_message); } TEST_F(OneClickSigninHelperTest, CanOffer) { - CreateSigninManager(false, std::string()); + CreateSigninManager(false, ""); EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)). WillRepeatedly(Return(true)); @@ -410,10 +408,9 @@ TEST_F(OneClickSigninHelperTest, CanOffer) { web_contents(), OneClickSigninHelper::CAN_OFFER_FOR_ALL, "user@gmail.com", NULL)); EXPECT_TRUE(OneClickSigninHelper::CanOffer( - web_contents(), - OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, - std::string(), - NULL)); + web_contents(), + OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, + "", NULL)); EnableOneClick(false); @@ -427,15 +424,14 @@ TEST_F(OneClickSigninHelperTest, CanOffer) { web_contents(), OneClickSigninHelper::CAN_OFFER_FOR_ALL, "user@gmail.com", &error_message)); EXPECT_FALSE(OneClickSigninHelper::CanOffer( - web_contents(), - OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, - std::string(), - &error_message)); + web_contents(), + OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, + "", &error_message)); EXPECT_EQ("", error_message); } TEST_F(OneClickSigninHelperTest, CanOfferFirstSetup) { - CreateSigninManager(false, std::string()); + CreateSigninManager(false, ""); EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)). WillRepeatedly(Return(true)); @@ -458,10 +454,8 @@ TEST_F(OneClickSigninHelperTest, CanOfferFirstSetup) { OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, "foo@gmail.com", NULL)); EXPECT_TRUE(OneClickSigninHelper::CanOffer( - web_contents(), - OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, - std::string(), - NULL)); + web_contents(), OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, + "", NULL)); } TEST_F(OneClickSigninHelperTest, CanOfferProfileConnected) { @@ -498,14 +492,12 @@ TEST_F(OneClickSigninHelperTest, CanOfferProfileConnected) { UTF8ToUTF16("foo@gmail.com")), error_message); EXPECT_TRUE(OneClickSigninHelper::CanOffer( - web_contents(), - OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, - std::string(), - &error_message)); + web_contents(), OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, + "", &error_message)); } TEST_F(OneClickSigninHelperTest, CanOfferUsernameNotAllowed) { - CreateSigninManager(false, std::string()); + CreateSigninManager(false, ""); EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)). WillRepeatedly(Return(false)); @@ -521,15 +513,16 @@ TEST_F(OneClickSigninHelperTest, CanOfferUsernameNotAllowed) { "foo@gmail.com", &error_message)); EXPECT_EQ(l10n_util::GetStringUTF8(IDS_SYNC_LOGIN_NAME_PROHIBITED), error_message); - EXPECT_TRUE(OneClickSigninHelper::CanOffer( - web_contents(), - OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, - std::string(), - &error_message)); + EXPECT_TRUE( + OneClickSigninHelper::CanOffer( + web_contents(), + OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, + "", + &error_message)); } TEST_F(OneClickSigninHelperTest, CanOfferWithRejectedEmail) { - CreateSigninManager(false, std::string()); + CreateSigninManager(false, ""); EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)). WillRepeatedly(Return(true)); @@ -558,7 +551,7 @@ TEST_F(OneClickSigninHelperTest, CanOfferWithRejectedEmail) { } TEST_F(OneClickSigninHelperTest, CanOfferIncognito) { - CreateSigninManager(true, std::string()); + CreateSigninManager(true, ""); std::string error_message; EXPECT_FALSE(OneClickSigninHelper::CanOffer( @@ -570,15 +563,13 @@ TEST_F(OneClickSigninHelperTest, CanOfferIncognito) { "user@gmail.com", &error_message)); EXPECT_EQ("", error_message); EXPECT_FALSE(OneClickSigninHelper::CanOffer( - web_contents(), - OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, - std::string(), - &error_message)); + web_contents(), OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, + "", &error_message)); EXPECT_EQ("", error_message); } TEST_F(OneClickSigninHelperTest, CanOfferNoSigninCookies) { - CreateSigninManager(false, std::string()); + CreateSigninManager(false, ""); AllowSigninCookies(false); EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)). @@ -594,10 +585,8 @@ TEST_F(OneClickSigninHelperTest, CanOfferNoSigninCookies) { "user@gmail.com", &error_message)); EXPECT_EQ("", error_message); EXPECT_FALSE(OneClickSigninHelper::CanOffer( - web_contents(), - OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, - std::string(), - &error_message)); + web_contents(), OneClickSigninHelper::CAN_OFFER_FOR_INTERSTITAL_ONLY, + "", &error_message)); EXPECT_EQ("", error_message); } @@ -606,7 +595,7 @@ TEST_F(OneClickSigninHelperTest, CanOfferUntrustedProcess) { ASSERT_NE(trusted.GetID(), process()->GetID()); // Make sure the RenderProcessHost used by the test is untrusted. SetTrustedSigninProcessID(trusted.GetID()); - CreateSigninManager(false, std::string()); + CreateSigninManager(false, ""); EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)). WillRepeatedly(Return(true)); @@ -618,7 +607,7 @@ TEST_F(OneClickSigninHelperTest, CanOfferUntrustedProcess) { } TEST_F(OneClickSigninHelperTest, CanOfferDisabledByPolicy) { - CreateSigninManager(false, std::string()); + CreateSigninManager(false, ""); EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)). WillRepeatedly(Return(true)); @@ -653,7 +642,7 @@ TEST_F(OneClickSigninHelperTest, CanOfferDisabledByPolicy) { // Should not crash if a helper instance is not associated with an incognito // web contents. TEST_F(OneClickSigninHelperTest, ShowInfoBarUIThreadIncognito) { - CreateSigninManager(true, std::string()); + CreateSigninManager(true, ""); OneClickSigninHelper* helper = OneClickSigninHelper::FromWebContents(web_contents()); EXPECT_EQ(NULL, helper); @@ -668,9 +657,9 @@ TEST_F(OneClickSigninHelperTest, ShowInfoBarUIThreadIncognito) { // config sync, then Chrome should redirect immidiately to sync settings page, // and upon successful setup, redirect back to webstore. TEST_F(OneClickSigninHelperTest, SigninFromWebstoreWithConfigSyncfirst) { - CreateSigninManager(false, std::string()); - EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)) - .WillRepeatedly(Return(true)); + CreateSigninManager(false, ""); + EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)). + WillRepeatedly(Return(true)); CreateProfileSyncServiceMock(); @@ -698,9 +687,9 @@ TEST_F(OneClickSigninHelperTest, SigninFromWebstoreWithConfigSyncfirst) { } TEST_F(OneClickSigninHelperTest, ShowSigninBubbleAfterSigninComplete) { - CreateSigninManager(false, std::string()); - EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)) - .WillRepeatedly(Return(true)); + CreateSigninManager(false, ""); + EXPECT_CALL(*signin_manager_, IsAllowedUsername(_)). + WillRepeatedly(Return(true)); CreateProfileSyncServiceMock(); @@ -736,34 +725,31 @@ TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThread) { scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false)); EXPECT_EQ(OneClickSigninHelper::CAN_OFFER, OneClickSigninHelper::CanOfferOnIOThreadImpl( - valid_gaia_url_, std::string(), &request_, io_data.get())); + valid_gaia_url_, "", &request_, io_data.get())); } TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadIncognito) { scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(true)); EXPECT_EQ(OneClickSigninHelper::DONT_OFFER, OneClickSigninHelper::CanOfferOnIOThreadImpl( - valid_gaia_url_, std::string(), &request_, io_data.get())); + valid_gaia_url_, "", &request_, io_data.get())); } TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadNoIOData) { EXPECT_EQ(OneClickSigninHelper::DONT_OFFER, OneClickSigninHelper::CanOfferOnIOThreadImpl( - valid_gaia_url_, std::string(), &request_, NULL)); + valid_gaia_url_, "", &request_, NULL)); } TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadBadURL) { scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false)); - EXPECT_EQ( - OneClickSigninHelper::IGNORE_REQUEST, - OneClickSigninHelper::CanOfferOnIOThreadImpl( - GURL("https://foo.com/"), std::string(), &request_, io_data.get())); EXPECT_EQ(OneClickSigninHelper::IGNORE_REQUEST, OneClickSigninHelper::CanOfferOnIOThreadImpl( - GURL("http://accounts.google.com/"), - std::string(), - &request_, - io_data.get())); + GURL("https://foo.com/"), "", &request_, io_data.get())); + EXPECT_EQ(OneClickSigninHelper::IGNORE_REQUEST, + OneClickSigninHelper::CanOfferOnIOThreadImpl( + GURL("http://accounts.google.com/"), "", + &request_, io_data.get())); } TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadReferrer) { @@ -810,7 +796,7 @@ TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadDisabled) { scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false)); EXPECT_EQ(OneClickSigninHelper::DONT_OFFER, OneClickSigninHelper::CanOfferOnIOThreadImpl( - valid_gaia_url_, std::string(), &request_, io_data.get())); + valid_gaia_url_, "", &request_, io_data.get())); } TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadSignedIn) { @@ -820,7 +806,7 @@ TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadSignedIn) { scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false)); EXPECT_EQ(OneClickSigninHelper::DONT_OFFER, OneClickSigninHelper::CanOfferOnIOThreadImpl( - valid_gaia_url_, std::string(), &request_, io_data.get())); + valid_gaia_url_, "", &request_, io_data.get())); } TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadEmailNotAllowed) { @@ -828,7 +814,7 @@ TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadEmailNotAllowed) { scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false)); EXPECT_EQ(OneClickSigninHelper::DONT_OFFER, OneClickSigninHelper::CanOfferOnIOThreadImpl( - valid_gaia_url_, std::string(), &request_, io_data.get())); + valid_gaia_url_, "", &request_, io_data.get())); } TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadEmailAlreadyUsed) { @@ -841,7 +827,7 @@ TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadEmailAlreadyUsed) { scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false)); EXPECT_EQ(OneClickSigninHelper::DONT_OFFER, OneClickSigninHelper::CanOfferOnIOThreadImpl( - valid_gaia_url_, std::string(), &request_, io_data.get())); + valid_gaia_url_, "", &request_, io_data.get())); } TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadWithRejectedEmail) { @@ -849,7 +835,7 @@ TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadWithRejectedEmail) { scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false)); EXPECT_EQ(OneClickSigninHelper::DONT_OFFER, OneClickSigninHelper::CanOfferOnIOThreadImpl( - valid_gaia_url_, std::string(), &request_, io_data.get())); + valid_gaia_url_, "", &request_, io_data.get())); } TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadNoSigninCookies) { @@ -857,14 +843,14 @@ TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadNoSigninCookies) { scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false)); EXPECT_EQ(OneClickSigninHelper::DONT_OFFER, OneClickSigninHelper::CanOfferOnIOThreadImpl( - valid_gaia_url_, std::string(), &request_, io_data.get())); + valid_gaia_url_, "", &request_, io_data.get())); } TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadDisabledByPolicy) { scoped_ptr<TestProfileIOData> io_data(CreateTestProfileIOData(false)); EXPECT_EQ(OneClickSigninHelper::CAN_OFFER, OneClickSigninHelper::CanOfferOnIOThreadImpl( - valid_gaia_url_, std::string(), &request_, io_data.get())); + valid_gaia_url_, "", &request_, io_data.get())); // Simulate a policy disabling signin by writing kSigninAllowed directly. // We should not offer to sign in the browser. @@ -872,7 +858,7 @@ TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadDisabledByPolicy) { prefs::kSigninAllowed, base::Value::CreateBooleanValue(false)); EXPECT_EQ(OneClickSigninHelper::DONT_OFFER, OneClickSigninHelper::CanOfferOnIOThreadImpl( - valid_gaia_url_, std::string(), &request_, io_data.get())); + valid_gaia_url_, "", &request_, io_data.get())); // Reset the preference. profile_->GetTestingPrefService()->SetManagedPref( @@ -884,5 +870,5 @@ TEST_F(OneClickSigninHelperIOTest, CanOfferOnIOThreadDisabledByPolicy) { prefs::kSyncManaged, base::Value::CreateBooleanValue(true)); EXPECT_EQ(OneClickSigninHelper::CAN_OFFER, OneClickSigninHelper::CanOfferOnIOThreadImpl( - valid_gaia_url_, std::string(), &request_, io_data.get())); + valid_gaia_url_, "", &request_, io_data.get())); } diff --git a/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc b/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc index 4115f18..4b003cf 100644 --- a/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc +++ b/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc @@ -43,7 +43,7 @@ Profile* TabContentsSyncedTabDelegate::profile() const { std::string TabContentsSyncedTabDelegate::GetExtensionAppId() const { const scoped_refptr<const extensions::Extension> extension_app( extensions::TabHelper::FromWebContents(web_contents_)->extension_app()); - return (extension_app.get() ? extension_app->id() : std::string()); + return (extension_app.get() ? extension_app->id() : ""); } int TabContentsSyncedTabDelegate::GetCurrentEntryIndex() const { diff --git a/chrome/browser/ui/website_settings/website_settings.cc b/chrome/browser/ui/website_settings/website_settings.cc index 8a37c39..daf7257 100644 --- a/chrome/browser/ui/website_settings/website_settings.cc +++ b/chrome/browser/ui/website_settings/website_settings.cc @@ -143,18 +143,12 @@ void WebsiteSettings::OnSitePermissionChanged(ContentSettingsType type, secondary_pattern = ContentSettingsPattern::Wildcard(); // Set permission for both microphone and camera. content_settings_->SetContentSetting( - primary_pattern, - secondary_pattern, - CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, - std::string(), - setting); + primary_pattern, secondary_pattern, + CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, "", setting); content_settings_->SetContentSetting( - primary_pattern, - secondary_pattern, - CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, - std::string(), - setting); + primary_pattern, secondary_pattern, + CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, "", setting); break; } default: @@ -173,7 +167,7 @@ void WebsiteSettings::OnSitePermissionChanged(ContentSettingsType type, // can not create media settings exceptions by hand. content_settings::SettingInfo info; scoped_ptr<Value> v(content_settings_->GetWebsiteSetting( - site_url_, site_url_, type, std::string(), &info)); + site_url_, site_url_, type, "", &info)); DCHECK(info.source == content_settings::SETTING_SOURCE_USER); ContentSettingsPattern::Relation r1 = info.primary_pattern.Compare(primary_pattern); @@ -194,7 +188,7 @@ void WebsiteSettings::OnSitePermissionChanged(ContentSettingsType type, if (setting != CONTENT_SETTING_DEFAULT) value = Value::CreateIntegerValue(setting); content_settings_->SetWebsiteSetting( - primary_pattern, secondary_pattern, type, std::string(), value); + primary_pattern, secondary_pattern, type, "", value); } show_info_bar_ = true; @@ -458,20 +452,14 @@ void WebsiteSettings::PresentSitePermissions() { content_settings::SettingInfo info; if (permission_info.type == CONTENT_SETTINGS_TYPE_MEDIASTREAM) { scoped_ptr<base::Value> mic_value(content_settings_->GetWebsiteSetting( - site_url_, - site_url_, - CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, - std::string(), - &info)); + site_url_, site_url_, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, + "", &info)); ContentSetting mic_setting = content_settings::ValueToContentSetting(mic_value.get()); scoped_ptr<base::Value> camera_value(content_settings_->GetWebsiteSetting( - site_url_, - site_url_, - CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, - std::string(), - &info)); + site_url_, site_url_, CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, + "", &info)); ContentSetting camera_setting = content_settings::ValueToContentSetting(camera_value.get()); @@ -481,7 +469,7 @@ void WebsiteSettings::PresentSitePermissions() { permission_info.setting = mic_setting; } else { scoped_ptr<Value> value(content_settings_->GetWebsiteSetting( - site_url_, site_url_, permission_info.type, std::string(), &info)); + site_url_, site_url_, permission_info.type, "", &info)); DCHECK(value.get()); if (value->GetType() == Value::TYPE_INTEGER) { permission_info.setting = diff --git a/chrome/browser/ui/website_settings/website_settings_unittest.cc b/chrome/browser/ui/website_settings/website_settings_unittest.cc index 8f486af..4fe881a 100644 --- a/chrome/browser/ui/website_settings/website_settings_unittest.cc +++ b/chrome/browser/ui/website_settings/website_settings_unittest.cc @@ -165,22 +165,22 @@ TEST_F(WebsiteSettingsTest, OnPermissionsChanged) { HostContentSettingsMap* content_settings = profile()->GetHostContentSettingsMap(); ContentSetting setting = content_settings->GetContentSetting( - url(), url(), CONTENT_SETTINGS_TYPE_POPUPS, std::string()); + url(), url(), CONTENT_SETTINGS_TYPE_POPUPS, ""); EXPECT_EQ(setting, CONTENT_SETTING_BLOCK); setting = content_settings->GetContentSetting( - url(), url(), CONTENT_SETTINGS_TYPE_PLUGINS, std::string()); + url(), url(), CONTENT_SETTINGS_TYPE_PLUGINS, ""); EXPECT_EQ(setting, CONTENT_SETTING_ALLOW); setting = content_settings->GetContentSetting( - url(), url(), CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string()); + url(), url(), CONTENT_SETTINGS_TYPE_GEOLOCATION, ""); EXPECT_EQ(setting, CONTENT_SETTING_ASK); setting = content_settings->GetContentSetting( - url(), url(), CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string()); + url(), url(), CONTENT_SETTINGS_TYPE_NOTIFICATIONS, ""); EXPECT_EQ(setting, CONTENT_SETTING_ASK); setting = content_settings->GetContentSetting( - url(), url(), CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string()); + url(), url(), CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, ""); EXPECT_EQ(setting, CONTENT_SETTING_ASK); setting = content_settings->GetContentSetting( - url(), url(), CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string()); + url(), url(), CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, ""); EXPECT_EQ(setting, CONTENT_SETTING_ASK); EXPECT_CALL(*mock_ui(), SetIdentityInfo(_)); @@ -212,22 +212,22 @@ TEST_F(WebsiteSettingsTest, OnPermissionsChanged) { // Verify that the site permissions were changed correctly. setting = content_settings->GetContentSetting( - url(), url(), CONTENT_SETTINGS_TYPE_POPUPS, std::string()); + url(), url(), CONTENT_SETTINGS_TYPE_POPUPS, ""); EXPECT_EQ(setting, CONTENT_SETTING_ALLOW); setting = content_settings->GetContentSetting( - url(), url(), CONTENT_SETTINGS_TYPE_PLUGINS, std::string()); + url(), url(), CONTENT_SETTINGS_TYPE_PLUGINS, ""); EXPECT_EQ(setting, CONTENT_SETTING_BLOCK); setting = content_settings->GetContentSetting( - url(), url(), CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string()); + url(), url(), CONTENT_SETTINGS_TYPE_GEOLOCATION, ""); EXPECT_EQ(setting, CONTENT_SETTING_ALLOW); setting = content_settings->GetContentSetting( - url(), url(), CONTENT_SETTINGS_TYPE_NOTIFICATIONS, std::string()); + url(), url(), CONTENT_SETTINGS_TYPE_NOTIFICATIONS, ""); EXPECT_EQ(setting, CONTENT_SETTING_ALLOW); setting = content_settings->GetContentSetting( - url(), url(), CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string()); + url(), url(), CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, ""); EXPECT_EQ(setting, CONTENT_SETTING_ALLOW); setting = content_settings->GetContentSetting( - url(), url(), CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string()); + url(), url(), CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, ""); EXPECT_EQ(setting, CONTENT_SETTING_ALLOW); } diff --git a/chrome/browser/ui/webui/about_ui.cc b/chrome/browser/ui/webui/about_ui.cc index b2dc2ae..861d2be 100644 --- a/chrome/browser/ui/webui/about_ui.cc +++ b/chrome/browser/ui/webui/about_ui.cc @@ -785,21 +785,15 @@ std::string AboutSandbox() { data.append("<table>"); - AboutSandboxRow(&data, - std::string(), - IDS_ABOUT_SANDBOX_SUID_SANDBOX, + AboutSandboxRow(&data, "", IDS_ABOUT_SANDBOX_SUID_SANDBOX, status & content::kSandboxLinuxSUID); AboutSandboxRow(&data, " ", IDS_ABOUT_SANDBOX_PID_NAMESPACES, status & content::kSandboxLinuxPIDNS); AboutSandboxRow(&data, " ", IDS_ABOUT_SANDBOX_NET_NAMESPACES, status & content::kSandboxLinuxNetNS); - AboutSandboxRow(&data, - std::string(), - IDS_ABOUT_SANDBOX_SECCOMP_LEGACY_SANDBOX, + AboutSandboxRow(&data, "", IDS_ABOUT_SANDBOX_SECCOMP_LEGACY_SANDBOX, status & content::kSandboxLinuxSeccompLegacy); - AboutSandboxRow(&data, - std::string(), - IDS_ABOUT_SANDBOX_SECCOMP_BPF_SANDBOX, + AboutSandboxRow(&data, "", IDS_ABOUT_SANDBOX_SECCOMP_BPF_SANDBOX, status & content::kSandboxLinuxSeccompBpf); data.append("</table>"); diff --git a/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc b/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc index 19e6404..0bfa286 100644 --- a/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc +++ b/chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc @@ -147,7 +147,7 @@ IN_PROC_BROWSER_TEST_F(DownloadsDOMHandlerTest, base::FilePath(FILE_PATH_LITERAL("/path/to/file")), base::FilePath(FILE_PATH_LITERAL("/path/to/file")), url_chain, - GURL(std::string()), + GURL(""), current, current, 128, diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc index 11ea684..bd3bc6f 100644 --- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc +++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc @@ -930,14 +930,9 @@ void ExtensionSettingsHandler::HandleLoadUnpackedExtensionMessage( load_extension_dialog_ = ui::SelectFileDialog::Create( this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); load_extension_dialog_->SelectFile( - kSelectType, - select_title, - last_unpacked_directory_, - NULL, - kFileTypeIndex, - base::FilePath::StringType(), - web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), - NULL); + kSelectType, select_title, last_unpacked_directory_, NULL, + kFileTypeIndex, FILE_PATH_LITERAL(""), + web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); } void ExtensionSettingsHandler::ShowAlert(const std::string& message) { diff --git a/chrome/browser/ui/webui/extensions/pack_extension_handler.cc b/chrome/browser/ui/webui/extensions/pack_extension_handler.cc index d201c91..a69cd4d 100644 --- a/chrome/browser/ui/webui/extensions/pack_extension_handler.cc +++ b/chrome/browser/ui/webui/extensions/pack_extension_handler.cc @@ -184,12 +184,8 @@ void PackExtensionHandler::HandleSelectFilePathMessage( load_extension_dialog_ = ui::SelectFileDialog::Create( this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); load_extension_dialog_->SelectFile( - type, - select_title, - base::FilePath(), - &info, - file_type_index, - base::FilePath::StringType(), + type, select_title, base::FilePath(), &info, file_type_index, + FILE_PATH_LITERAL(""), web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); } diff --git a/chrome/browser/ui/webui/favicon_source.cc b/chrome/browser/ui/webui/favicon_source.cc index 232b6eb..6864120 100644 --- a/chrome/browser/ui/webui/favicon_source.cc +++ b/chrome/browser/ui/webui/favicon_source.cc @@ -253,8 +253,10 @@ void FaviconSource::OnFaviconDataAvailable( void FaviconSource::SendDefaultResponse( const content::URLDataSource::GotDataCallback& callback) { - SendDefaultResponse( - IconRequest(callback, std::string(), 16, ui::SCALE_FACTOR_100P)); + SendDefaultResponse(IconRequest(callback, + "", + 16, + ui::SCALE_FACTOR_100P)); } void FaviconSource::SendDefaultResponse(const IconRequest& icon_request) { diff --git a/chrome/browser/ui/webui/feedback_ui.cc b/chrome/browser/ui/webui/feedback_ui.cc index b28e065..3cb20bf 100644 --- a/chrome/browser/ui/webui/feedback_ui.cc +++ b/chrome/browser/ui/webui/feedback_ui.cc @@ -409,23 +409,23 @@ bool FeedbackHandler::Init() { std::string query_str = *it; if (StartsWithASCII(query_str, std::string(kSessionIDParameter), true)) { ReplaceFirstSubstringAfterOffset( - &query_str, 0, kSessionIDParameter, std::string()); + &query_str, 0, kSessionIDParameter, ""); if (!base::StringToInt(query_str, &session_id)) return false; } else if (StartsWithASCII(*it, std::string(kTabIndexParameter), true)) { ReplaceFirstSubstringAfterOffset( - &query_str, 0, kTabIndexParameter, std::string()); + &query_str, 0, kTabIndexParameter, ""); if (!base::StringToInt(query_str, &index)) return false; } else if (StartsWithASCII(*it, std::string(kCustomPageUrlParameter), true)) { ReplaceFirstSubstringAfterOffset( - &query_str, 0, kCustomPageUrlParameter, std::string()); + &query_str, 0, kCustomPageUrlParameter, ""); custom_page_url = query_str; } else if (StartsWithASCII(*it, std::string(kCategoryTagParameter), true)) { ReplaceFirstSubstringAfterOffset( - &query_str, 0, kCategoryTagParameter, std::string()); + &query_str, 0, kCategoryTagParameter, ""); category_tag_ = query_str; #if defined(OS_CHROMEOS) } else if (StartsWithASCII(*it, std::string(kTimestampParameter), true)) { diff --git a/chrome/browser/ui/webui/inspect_ui.cc b/chrome/browser/ui/webui/inspect_ui.cc index b98ea9e..b0b67c3 100644 --- a/chrome/browser/ui/webui/inspect_ui.cc +++ b/chrome/browser/ui/webui/inspect_ui.cc @@ -462,7 +462,7 @@ void InspectUI::OnAdbPages( targets.Append(target_data); } - std::string json_string; + std::string json_string = ""; base::JSONWriter::Write(&targets, &json_string); callback.Run(base::RefCountedString::TakeString(&json_string)); } diff --git a/chrome/browser/ui/webui/instant_ui.cc b/chrome/browser/ui/webui/instant_ui.cc index 23a255c..f84bf9a 100644 --- a/chrome/browser/ui/webui/instant_ui.cc +++ b/chrome/browser/ui/webui/instant_ui.cc @@ -169,7 +169,6 @@ InstantUI::InstantUI(content::WebUI* web_ui) : WebUIController(web_ui) { // static void InstantUI::RegisterUserPrefs(PrefRegistrySyncable* registry) { - registry->RegisterStringPref(prefs::kInstantUIZeroSuggestUrlPrefix, - std::string(), + registry->RegisterStringPref(prefs::kInstantUIZeroSuggestUrlPrefix, "", PrefRegistrySyncable::UNSYNCABLE_PREF); } diff --git a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc index 0ac1324..cea9824 100644 --- a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc +++ b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc @@ -1409,7 +1409,7 @@ void NetInternalsMessageHandler::IOThreadImpl::OnGetSpdyStatus( next_protos_value = Value::CreateStringValue( JoinString(net::HttpStreamFactory::next_protos(), ',')); } else { - next_protos_value = Value::CreateStringValue(std::string()); + next_protos_value = Value::CreateStringValue(""); } status_dict->Set("next_protos", next_protos_value); diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc index 54c5c31..48f4f60 100644 --- a/chrome/browser/ui/webui/options/browser_options_handler.cc +++ b/chrome/browser/ui/webui/options/browser_options_handler.cc @@ -1194,11 +1194,8 @@ void BrowserOptionsHandler::HandleSelectDownloadLocation( ui::SelectFileDialog::SELECT_FOLDER, l10n_util::GetStringUTF16(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE), pref_service->GetFilePath(prefs::kDownloadDefaultDirectory), - &info, - 0, - base::FilePath::StringType(), - web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), - NULL); + &info, 0, FILE_PATH_LITERAL(""), + web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); } void BrowserOptionsHandler::FileSelected(const base::FilePath& path, int index, diff --git a/chrome/browser/ui/webui/options/certificate_manager_handler.cc b/chrome/browser/ui/webui/options/certificate_manager_handler.cc index f30eaec..c1e18da 100644 --- a/chrome/browser/ui/webui/options/certificate_manager_handler.cc +++ b/chrome/browser/ui/webui/options/certificate_manager_handler.cc @@ -326,7 +326,7 @@ void CertificateManagerHandler::GetLocalizedValues( l10n_util::GetStringUTF16(IDS_CERT_MANAGER_DELETE_CA_DESCRIPTION)); localized_strings->SetString("unknownCertsTabDeleteConfirm", l10n_util::GetStringUTF16(IDS_CERT_MANAGER_DELETE_UNKNOWN_FORMAT)); - localized_strings->SetString("unknownCertsTabDeleteImpact", std::string()); + localized_strings->SetString("unknownCertsTabDeleteImpact", ""); // Certificate Restore overlay strings. localized_strings->SetString("certificateRestorePasswordDescription", @@ -614,7 +614,7 @@ void CertificateManagerHandler::ExportPersonalPasswordSelected( chrome::UnlockCertSlotIfNecessary( selected_cert_list_[0].get(), chrome::kCryptoModulePasswordCertExport, - std::string(), // unused. + "", // unused. base::Bind(&CertificateManagerHandler::ExportPersonalSlotsUnlocked, base::Unretained(this))); } @@ -723,7 +723,7 @@ void CertificateManagerHandler::ImportPersonalFileRead( chrome::UnlockSlotsIfNecessary( modules, chrome::kCryptoModulePasswordCertImport, - std::string(), // unused. + "", // unused. base::Bind(&CertificateManagerHandler::ImportPersonalSlotUnlocked, base::Unretained(this))); } diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc index 549856b..85249bc 100644 --- a/chrome/browser/ui/webui/options/content_settings_handler.cc +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc @@ -123,7 +123,7 @@ std::string ContentSettingToString(ContentSetting setting) { NOTREACHED(); } - return std::string(); + return ""; } ContentSetting ContentSettingFromString(const std::string& name) { @@ -151,9 +151,8 @@ DictionaryValue* GetExceptionForPage( DictionaryValue* exception = new DictionaryValue(); exception->SetString(kOrigin, pattern.ToString()); exception->SetString(kEmbeddingOrigin, - secondary_pattern == ContentSettingsPattern::Wildcard() - ? std::string() - : secondary_pattern.ToString()); + secondary_pattern == ContentSettingsPattern::Wildcard() ? "" : + secondary_pattern.ToString()); exception->SetString(kSetting, ContentSettingToString(setting)); exception->SetString(kSource, provider_name); return exception; @@ -605,7 +604,7 @@ void ContentSettingsHandler::UpdateMediaSettingsView() { media_ui_settings.SetString("askText", "mediaStreamAsk"); media_ui_settings.SetString("blockText", "mediaStreamBlock"); media_ui_settings.SetBoolean("showBubble", false); - media_ui_settings.SetString("bubbleText", std::string()); + media_ui_settings.SetString("bubbleText", ""); web_ui()->CallJavascriptFunction("ContentSettings.updateMediaUI", media_ui_settings); @@ -1053,16 +1052,18 @@ void ContentSettingsHandler::RemoveMediaException( mode == "normal" ? GetContentSettingsMap() : GetOTRContentSettingsMap(); if (settings_map) { - settings_map->SetWebsiteSetting(ContentSettingsPattern::FromString(pattern), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, - std::string(), - NULL); - settings_map->SetWebsiteSetting(ContentSettingsPattern::FromString(pattern), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, - std::string(), - NULL); + settings_map->SetWebsiteSetting( + ContentSettingsPattern::FromString(pattern), + ContentSettingsPattern::Wildcard(), + CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, + "", + NULL); + settings_map->SetWebsiteSetting( + ContentSettingsPattern::FromString(pattern), + ContentSettingsPattern::Wildcard(), + CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, + "", + NULL); } } @@ -1087,11 +1088,10 @@ void ContentSettingsHandler::RemoveExceptionFromHostContentSettingsMap( if (settings_map) { settings_map->SetWebsiteSetting( ContentSettingsPattern::FromString(pattern), - secondary_pattern.empty() - ? ContentSettingsPattern::Wildcard() - : ContentSettingsPattern::FromString(secondary_pattern), + secondary_pattern.empty() ? ContentSettingsPattern::Wildcard() : + ContentSettingsPattern::FromString(secondary_pattern), type, - std::string(), + "", NULL); } } @@ -1259,7 +1259,7 @@ void ContentSettingsHandler::SetException(const ListValue* args) { settings_map->SetContentSetting(ContentSettingsPattern::FromString(pattern), ContentSettingsPattern::Wildcard(), type, - std::string(), + "", ContentSettingFromString(setting)); } } diff --git a/chrome/browser/ui/webui/options/font_settings_handler.cc b/chrome/browser/ui/webui/options/font_settings_handler.cc index 558effc..61f1524 100644 --- a/chrome/browser/ui/webui/options/font_settings_handler.cc +++ b/chrome/browser/ui/webui/options/font_settings_handler.cc @@ -188,8 +188,8 @@ void FontSettingsHandler::FontsListHasLoaded( option->Append(new base::StringValue(has_rtl_chars ? "rtl" : "ltr")); } else { // Add empty name/value to indicate a separator item. - option->Append(new base::StringValue(std::string())); - option->Append(new base::StringValue(std::string())); + option->Append(new base::StringValue("")); + option->Append(new base::StringValue("")); } encoding_list.Append(option); } diff --git a/chrome/browser/ui/webui/options/managed_user_passphrase_handler.cc b/chrome/browser/ui/webui/options/managed_user_passphrase_handler.cc index f3aac91..2090137 100644 --- a/chrome/browser/ui/webui/options/managed_user_passphrase_handler.cc +++ b/chrome/browser/ui/webui/options/managed_user_passphrase_handler.cc @@ -110,8 +110,8 @@ void ManagedUserPassphraseHandler::IsPassphraseSet( void ManagedUserPassphraseHandler::ResetPassphrase( const base::ListValue* args) { PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); - pref_service->SetString(prefs::kManagedModeLocalPassphrase, std::string()); - pref_service->SetString(prefs::kManagedModeLocalSalt, std::string()); + pref_service->SetString(prefs::kManagedModeLocalPassphrase, ""); + pref_service->SetString(prefs::kManagedModeLocalSalt, ""); } void ManagedUserPassphraseHandler::SetLocalPassphrase( diff --git a/chrome/browser/ui/webui/options/preferences_browsertest.cc b/chrome/browser/ui/webui/options/preferences_browsertest.cc index 8dbc971..5839538 100644 --- a/chrome/browser/ui/webui/options/preferences_browsertest.cc +++ b/chrome/browser/ui/webui/options/preferences_browsertest.cc @@ -343,7 +343,7 @@ void PreferencesBrowserTest::VerifySetPref(const std::string& name, std::string observed_json; ASSERT_TRUE(content::ExecuteScriptAndExtractString( render_view_host_, javascript.str(), &observed_json)); - VerifyObservedPref(observed_json, name, value, std::string(), false, !commit); + VerifyObservedPref(observed_json, name, value, "", false, !commit); VerifyAndClearExpectations(); } @@ -385,7 +385,7 @@ void PreferencesBrowserTest::VerifyCommit(const std::string& name, void PreferencesBrowserTest::VerifySetCommit(const std::string& name, const base::Value* value) { ExpectSetCommit(name, value); - VerifyCommit(name, value, std::string()); + VerifyCommit(name, value, ""); VerifyAndClearExpectations(); } @@ -476,8 +476,8 @@ IN_PROC_BROWSER_TEST_F(PreferencesBrowserTest, FetchPrefs) { // Verify notifications when default values are in effect. SetupJavaScriptTestEnvironment(pref_names_, &observed_json); - VerifyObservedPrefs( - observed_json, pref_names_, default_values_, std::string(), false, false); + VerifyObservedPrefs(observed_json, pref_names_, default_values_, + "", false, false); // Verify notifications when recommended values are in effect. SetUserPolicies(policy_names_, non_default_values_, @@ -497,12 +497,8 @@ IN_PROC_BROWSER_TEST_F(PreferencesBrowserTest, FetchPrefs) { ClearUserPolicies(); SetUserValues(pref_names_, non_default_values_); SetupJavaScriptTestEnvironment(pref_names_, &observed_json); - VerifyObservedPrefs(observed_json, - pref_names_, - non_default_values_, - std::string(), - false, - false); + VerifyObservedPrefs(observed_json, pref_names_, non_default_values_, + "", false, false); } // Verifies that setting a user-modified pref value through the JavaScript @@ -554,7 +550,7 @@ IN_PROC_BROWSER_TEST_F(PreferencesBrowserTest, DialogPrefsSetRollback) { ASSERT_NO_FATAL_FAILURE(SetupJavaScriptTestEnvironment(pref_names_, NULL)); for (size_t i = 0; i < pref_names_.size(); ++i) { VerifySetPref(pref_names_[i], types_[i], non_default_values_[i], false); - VerifyRollback(pref_names_[i], default_values_[i], std::string()); + VerifyRollback(pref_names_[i], default_values_[i], ""); } // Verify behavior when recommended values are in effect. @@ -596,7 +592,7 @@ IN_PROC_BROWSER_TEST_F(PreferencesBrowserTest, DialogPrefsClearRollback) { ASSERT_NO_FATAL_FAILURE(SetupJavaScriptTestEnvironment(pref_names_, NULL)); for (size_t i = 0; i < pref_names_.size(); ++i) { VerifyClearPref(pref_names_[i], default_values_[i], false); - VerifyRollback(pref_names_[i], non_default_values_[i], std::string()); + VerifyRollback(pref_names_[i], non_default_values_[i], ""); } } @@ -628,19 +624,15 @@ IN_PROC_BROWSER_TEST_F(PreferencesBrowserTest, NotificationsOnBackendChanges) { StartObserving(); ClearUserPolicies(); FinishObserving(&observed_json); - VerifyObservedPrefs( - observed_json, pref_names_, default_values_, std::string(), false, false); + VerifyObservedPrefs(observed_json, pref_names_, default_values_, + "", false, false); // Verify notifications when user-modified values come into effect. StartObserving(); SetUserValues(pref_names_, non_default_values_); FinishObserving(&observed_json); - VerifyObservedPrefs(observed_json, - pref_names_, - non_default_values_, - std::string(), - false, - false); + VerifyObservedPrefs(observed_json, pref_names_, non_default_values_, + "", false, false); } #if defined(OS_CHROMEOS) diff --git a/chrome/browser/ui/webui/policy_ui_browsertest.cc b/chrome/browser/ui/webui/policy_ui_browsertest.cc index 6293fef..6af1613 100644 --- a/chrome/browser/ui/webui/policy_ui_browsertest.cc +++ b/chrome/browser/ui/webui/policy_ui_browsertest.cc @@ -43,7 +43,7 @@ std::vector<std::string> PopulateExpectedPolicy( metadata->scope == policy::POLICY_SCOPE_MACHINE ? IDS_POLICY_SCOPE_DEVICE : IDS_POLICY_SCOPE_USER)); } else { - expected_policy.push_back(std::string()); + expected_policy.push_back(""); } // Populate expected level. @@ -52,7 +52,7 @@ std::vector<std::string> PopulateExpectedPolicy( metadata->level == policy::POLICY_LEVEL_RECOMMENDED ? IDS_POLICY_LEVEL_RECOMMENDED : IDS_POLICY_LEVEL_MANDATORY)); } else { - expected_policy.push_back(std::string()); + expected_policy.push_back(""); } // Populate expected policy name. @@ -178,7 +178,7 @@ IN_PROC_BROWSER_TEST_F(PolicyUITest, SendPolicyNames) { for (const policy::PolicyDefinitionList::Entry* policy = policies->begin; policy != policies->end; ++policy) { expected_policies.push_back( - PopulateExpectedPolicy(policy->name, std::string(), NULL, false)); + PopulateExpectedPolicy(policy->name, "", NULL, false)); } // Retrieve the contents of the policy table from the UI and verify that it @@ -240,8 +240,7 @@ IN_PROC_BROWSER_TEST_F(PolicyUITest, SendPolicyValues) { policy != policies->end; ++policy) { std::map<std::string, std::string>::const_iterator it = expected_values.find(policy->name); - const std::string value = - it == expected_values.end() ? std::string() : it->second; + const std::string value = it == expected_values.end() ? "" : it->second; const policy::PolicyMap::Entry* metadata = values.Get(policy->name); expected_policies.insert( metadata ? expected_policies.begin() + first_unset_position++ : diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc index 7899260..0525da3 100644 --- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc +++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc @@ -866,7 +866,7 @@ void PrintPreviewHandler::SelectFile(const base::FilePath& default_filename) { sticky_settings->save_path()->Append(default_filename), &file_type_info, 0, - base::FilePath::StringType(), + FILE_PATH_LITERAL(""), platform_util::GetTopLevel( preview_web_contents()->GetView()->GetNativeView()), NULL); diff --git a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc index 4e10802..52cbe91 100644 --- a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc +++ b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc @@ -571,7 +571,7 @@ void PrintPreviewUI::OnClosePrintPreviewDialog() { ConstrainedWebDialogDelegate* delegate = GetConstrainedDelegate(); if (!delegate) return; - delegate->GetWebDialogDelegate()->OnDialogClosed(std::string()); + delegate->GetWebDialogDelegate()->OnDialogClosed(""); delegate->OnDialogCloseFromWebUI(); } diff --git a/chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog_unittest.cc b/chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog_unittest.cc index cd6f5fe..e24b730 100644 --- a/chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog_unittest.cc +++ b/chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog_unittest.cc @@ -142,11 +142,11 @@ class ProfileSigninConfirmationDialogTest : public testing::Test { false); // Create a dialog, but don't display it. - dialog_ = new ProfileSigninConfirmationDialog(profile_.get(), - std::string(), - base::Bind(&base::DoNothing), - base::Bind(&base::DoNothing), - base::Bind(&base::DoNothing)); + dialog_ = new ProfileSigninConfirmationDialog( + profile_.get(), "", + base::Bind(&base::DoNothing), + base::Bind(&base::DoNothing), + base::Bind(&base::DoNothing)); } virtual void TearDown() OVERRIDE { @@ -204,10 +204,10 @@ TEST_F(ProfileSigninConfirmationDialogTest, PromptForNewProfile_Extensions) { &ProfileSigninConfirmationDialog::CheckShouldPromptForNewProfile, base::Unretained(dialog_)))); - scoped_refptr<extensions::Extension> extension = - CreateExtension("foo", std::string()); + scoped_refptr<extensions::Extension> extension = CreateExtension("foo", ""); extensions->extension_prefs()->AddGrantedPermissions( - extension->id(), make_scoped_refptr(new extensions::PermissionSet)); + extension->id(), + make_scoped_refptr(new extensions::PermissionSet)); extensions->AddExtension(extension); EXPECT_TRUE( GetCallbackResult( diff --git a/chrome/browser/ui/webui/sync_setup_handler_unittest.cc b/chrome/browser/ui/webui/sync_setup_handler_unittest.cc index 19f2d0e..f958519 100644 --- a/chrome/browser/ui/webui/sync_setup_handler_unittest.cc +++ b/chrome/browser/ui/webui/sync_setup_handler_unittest.cc @@ -457,13 +457,8 @@ TEST_P(SyncSetupHandlerTest, DisplayBasicLogin) { // Now make sure that the appropriate params are being passed. DictionaryValue* dictionary; ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); - CheckShowSyncSetupArgs(dictionary, - std::string(), - false, - GoogleServiceAuthError::NONE, - std::string(), - true, - std::string()); + CheckShowSyncSetupArgs( + dictionary, "", false, GoogleServiceAuthError::NONE, "", true, ""); } else { ASSERT_FALSE(handler_->is_configuring_sync()); ASSERT_TRUE(handler_->have_signin_tracker()); @@ -499,13 +494,8 @@ TEST_P(SyncSetupHandlerTest, DisplayForceLogin) { // Now make sure that the appropriate params are being passed. DictionaryValue* dictionary; ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); - CheckShowSyncSetupArgs(dictionary, - std::string(), - false, - GoogleServiceAuthError::NONE, - std::string(), - true, - std::string()); + CheckShowSyncSetupArgs( + dictionary, "", false, GoogleServiceAuthError::NONE, "", true, ""); } else { ASSERT_FALSE(handler_->is_configuring_sync()); ASSERT_TRUE(handler_->have_signin_tracker()); @@ -689,7 +679,7 @@ TEST_P(SyncSetupHandlerTest, HandleGaiaAuthFailure) { if (!SyncPromoUI::UseWebBasedSigninFlow()) { // Fake a failed signin attempt. - handler_->TryLogin(kTestUser, kTestPassword, std::string(), std::string()); + handler_->TryLogin(kTestUser, kTestPassword, "", ""); GoogleServiceAuthError error( GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); handler_->SigninFailed(error); @@ -705,13 +695,9 @@ TEST_P(SyncSetupHandlerTest, HandleGaiaAuthFailure) { // Now make sure that the appropriate params are being passed. DictionaryValue* dictionary; ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); - CheckShowSyncSetupArgs(dictionary, - std::string(), - false, - GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, - kTestUser, - true, - std::string()); + CheckShowSyncSetupArgs( + dictionary, "", false, GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, + kTestUser, true, ""); } else { ASSERT_FALSE(handler_->is_configuring_sync()); ASSERT_TRUE(handler_->have_signin_tracker()); @@ -732,7 +718,7 @@ TEST_P(SyncSetupHandlerTest, HandleCaptcha) { if (!SyncPromoUI::UseWebBasedSigninFlow()) { // Fake a failed signin attempt that requires a captcha. - handler_->TryLogin(kTestUser, kTestPassword, std::string(), std::string()); + handler_->TryLogin(kTestUser, kTestPassword, "", ""); GoogleServiceAuthError error = GoogleServiceAuthError::FromClientLoginCaptchaChallenge( "token", GURL(kTestCaptchaImageUrl), GURL(kTestCaptchaUnlockUrl)); @@ -748,13 +734,9 @@ TEST_P(SyncSetupHandlerTest, HandleCaptcha) { // Now make sure that the appropriate params are being passed. DictionaryValue* dictionary; ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); - CheckShowSyncSetupArgs(dictionary, - std::string(), - false, - GoogleServiceAuthError::CAPTCHA_REQUIRED, - kTestUser, - true, - kTestCaptchaImageUrl); + CheckShowSyncSetupArgs( + dictionary, "", false, GoogleServiceAuthError::CAPTCHA_REQUIRED, + kTestUser, true, kTestCaptchaImageUrl); } else { ASSERT_FALSE(handler_->is_configuring_sync()); ASSERT_TRUE(handler_->have_signin_tracker()); @@ -776,7 +758,7 @@ TEST_P(SyncSetupHandlerTest, UnrecoverableErrorInitializingSync) { ASSERT_EQ(1U, web_ui_.call_data().size()); // Fake a successful GAIA request (gaia credentials valid, but signin not // complete yet). - handler_->TryLogin(kTestUser, kTestPassword, std::string(), std::string()); + handler_->TryLogin(kTestUser, kTestPassword, "", ""); handler_->GaiaCredentialsValid(); ASSERT_EQ(2U, web_ui_.call_data().size()); EXPECT_EQ("SyncSetupOverlay.showSuccessAndSettingUp", @@ -798,13 +780,9 @@ TEST_P(SyncSetupHandlerTest, UnrecoverableErrorInitializingSync) { // Now make sure that the appropriate params are being passed. DictionaryValue* dictionary; ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); - CheckShowSyncSetupArgs(dictionary, - std::string(), - true, - GoogleServiceAuthError::NONE, - kTestUser, - true, - std::string()); + CheckShowSyncSetupArgs( + dictionary, "", true, GoogleServiceAuthError::NONE, + kTestUser, true, ""); } else { ASSERT_FALSE(handler_->is_configuring_sync()); ASSERT_TRUE(handler_->have_signin_tracker()); @@ -825,7 +803,7 @@ TEST_P(SyncSetupHandlerTest, GaiaErrorInitializingSync) { ASSERT_EQ(1U, web_ui_.call_data().size()); // Fake a successful GAIA request (gaia credentials valid, but signin not // complete yet). - handler_->TryLogin(kTestUser, kTestPassword, std::string(), std::string()); + handler_->TryLogin(kTestUser, kTestPassword, "", ""); handler_->GaiaCredentialsValid(); ASSERT_EQ(2U, web_ui_.call_data().size()); EXPECT_EQ("SyncSetupOverlay.showSuccessAndSettingUp", @@ -848,13 +826,9 @@ TEST_P(SyncSetupHandlerTest, GaiaErrorInitializingSync) { // Now make sure that the appropriate params are being passed. DictionaryValue* dictionary; ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); - CheckShowSyncSetupArgs(dictionary, - std::string(), - false, - GoogleServiceAuthError::SERVICE_UNAVAILABLE, - kTestUser, - true, - std::string()); + CheckShowSyncSetupArgs( + dictionary, "", false, GoogleServiceAuthError::SERVICE_UNAVAILABLE, + kTestUser, true, ""); } else { ASSERT_FALSE(handler_->is_configuring_sync()); ASSERT_TRUE(handler_->have_signin_tracker()); @@ -863,7 +837,7 @@ TEST_P(SyncSetupHandlerTest, GaiaErrorInitializingSync) { TEST_P(SyncSetupHandlerTest, TestSyncEverything) { std::string args = GetConfiguration( - NULL, SYNC_ALL_DATA, GetAllTypes(), std::string(), ENCRYPT_PASSWORDS); + NULL, SYNC_ALL_DATA, GetAllTypes(), "", ENCRYPT_PASSWORDS); ListValue list_args; list_args.Append(new StringValue(args)); EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption()) @@ -881,7 +855,7 @@ TEST_P(SyncSetupHandlerTest, TestSyncEverything) { TEST_P(SyncSetupHandlerTest, TurnOnEncryptAll) { std::string args = GetConfiguration( - NULL, SYNC_ALL_DATA, GetAllTypes(), std::string(), ENCRYPT_ALL_DATA); + NULL, SYNC_ALL_DATA, GetAllTypes(), "", ENCRYPT_ALL_DATA); ListValue list_args; list_args.Append(new StringValue(args)); EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption()) @@ -900,7 +874,7 @@ TEST_P(SyncSetupHandlerTest, TurnOnEncryptAll) { TEST_P(SyncSetupHandlerTest, TestPassphraseStillRequired) { std::string args = GetConfiguration( - NULL, SYNC_ALL_DATA, GetAllTypes(), std::string(), ENCRYPT_PASSWORDS); + NULL, SYNC_ALL_DATA, GetAllTypes(), "", ENCRYPT_PASSWORDS); ListValue list_args; list_args.Append(new StringValue(args)); EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption()) @@ -1016,11 +990,8 @@ TEST_P(SyncSetupHandlerTest, TestSyncIndividualTypes) { for (it = user_selectable_types.First(); it.Good(); it.Inc()) { syncer::ModelTypeSet type_to_set; type_to_set.Put(it.Get()); - std::string args = GetConfiguration(NULL, - CHOOSE_WHAT_TO_SYNC, - type_to_set, - std::string(), - ENCRYPT_PASSWORDS); + std::string args = GetConfiguration( + NULL, CHOOSE_WHAT_TO_SYNC, type_to_set, "", ENCRYPT_PASSWORDS); ListValue list_args; list_args.Append(new StringValue(args)); EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption()) @@ -1039,11 +1010,8 @@ TEST_P(SyncSetupHandlerTest, TestSyncIndividualTypes) { } TEST_P(SyncSetupHandlerTest, TestSyncAllManually) { - std::string args = GetConfiguration(NULL, - CHOOSE_WHAT_TO_SYNC, - GetAllTypes(), - std::string(), - ENCRYPT_PASSWORDS); + std::string args = GetConfiguration( + NULL, CHOOSE_WHAT_TO_SYNC, GetAllTypes(), "", ENCRYPT_PASSWORDS); ListValue list_args; list_args.Append(new StringValue(args)); EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption()) @@ -1106,12 +1074,12 @@ TEST_P(SyncSetupHandlerTest, ShowSyncSetupWithAuthError) { ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); // We should display a login screen with a non-editable username filled in. CheckShowSyncSetupArgs(dictionary, - std::string(), + "", false, GoogleServiceAuthError::NONE, kTestUser, false, - std::string()); + ""); } else { ASSERT_FALSE(handler_->is_configuring_sync()); ASSERT_TRUE(handler_->have_signin_tracker()); @@ -1276,9 +1244,9 @@ TEST_P(SyncSetupHandlerTest, SubmitAuthWithInvalidUsername) { DictionaryValue args; args.SetString("user", "user@not_allowed.com"); args.SetString("pass", "password"); - args.SetString("captcha", std::string()); - args.SetString("otp", std::string()); - args.SetString("accessCode", std::string()); + args.SetString("captcha", ""); + args.SetString("otp", ""); + args.SetString("accessCode", ""); std::string json; base::JSONWriter::Write(&args, &json); ListValue list_args; @@ -1299,13 +1267,8 @@ TEST_P(SyncSetupHandlerTest, SubmitAuthWithInvalidUsername) { DictionaryValue* dictionary; ASSERT_TRUE(data.arg2->GetAsDictionary(&dictionary)); std::string err = l10n_util::GetStringUTF8(IDS_SYNC_LOGIN_NAME_PROHIBITED); - CheckShowSyncSetupArgs(dictionary, - err, - false, - GoogleServiceAuthError::NONE, - std::string(), - true, - std::string()); + CheckShowSyncSetupArgs( + dictionary, err, false, GoogleServiceAuthError::NONE, "", true, ""); handler_->CloseSyncSetup(); EXPECT_EQ(NULL, LoginUIServiceFactory::GetForProfile( diff --git a/chrome/browser/ui/webui/version_ui.cc b/chrome/browser/ui/webui/version_ui.cc index 6497ae0..678492a 100644 --- a/chrome/browser/ui/webui/version_ui.cc +++ b/chrome/browser/ui/webui/version_ui.cc @@ -92,7 +92,7 @@ content::WebUIDataSource* CreateVersionUIDataSource(Profile* profile) { html_source->AddString("command_line", WideToUTF16(CommandLine::ForCurrentProcess()->GetCommandLineString())); #elif defined(OS_POSIX) - std::string command_line; + std::string command_line = ""; typedef std::vector<std::string> ArgvList; const ArgvList& argv = CommandLine::ForCurrentProcess()->argv(); for (ArgvList::const_iterator iter = argv.begin(); iter != argv.end(); iter++) diff --git a/chrome/browser/value_store/leveldb_value_store.cc b/chrome/browser/value_store/leveldb_value_store.cc index bad05dd..47ad0c0 100644 --- a/chrome/browser/value_store/leveldb_value_store.cc +++ b/chrome/browser/value_store/leveldb_value_store.cc @@ -334,7 +334,7 @@ std::string LeveldbValueStore::EnsureDbIsOpen() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); if (db_.get()) - return std::string(); + return ""; #if defined(OS_POSIX) std::string os_path(db_path_.value()); @@ -356,7 +356,7 @@ std::string LeveldbValueStore::EnsureDbIsOpen() { } db_.reset(db); - return std::string(); + return ""; } std::string LeveldbValueStore::ReadFromDb( @@ -371,7 +371,7 @@ std::string LeveldbValueStore::ReadFromDb( if (s.IsNotFound()) { // Despite there being no value, it was still a success. // Check this first because ok() is false on IsNotFound. - return std::string(); + return ""; } if (!s.ok()) @@ -384,7 +384,7 @@ std::string LeveldbValueStore::ReadFromDb( } setting->reset(value); - return std::string(); + return ""; } std::string LeveldbValueStore::AddToBatch( @@ -410,16 +410,16 @@ std::string LeveldbValueStore::AddToBatch( batch->Put(key, value_as_json); } - return std::string(); + return ""; } std::string LeveldbValueStore::WriteToDb(leveldb::WriteBatch* batch) { leveldb::Status status = db_->Write(leveldb::WriteOptions(), batch); if (status.IsNotFound()) { NOTREACHED() << "IsNotFound() but writing?!"; - return std::string(); + return ""; } - return status.ok() ? std::string() : status.ToString(); + return status.ok() ? "" : status.ToString(); } bool LeveldbValueStore::IsEmpty() { diff --git a/chrome/browser/web_applications/web_app_unittest.cc b/chrome/browser/web_applications/web_app_unittest.cc index 149f62b..0bd1c01 100644 --- a/chrome/browser/web_applications/web_app_unittest.cc +++ b/chrome/browser/web_applications/web_app_unittest.cc @@ -71,8 +71,9 @@ TEST_F(WebApplicationTest, AppDirWithId) { TEST_F(WebApplicationTest, AppDirWithUrl) { base::FilePath profile_path(FILE_PATH_LITERAL("profile")); base::FilePath result(web_app::GetWebAppDataDirectory( - profile_path, std::string(), GURL("http://example.com"))); + profile_path, "", GURL("http://example.com"))); base::FilePath expected = profile_path.AppendASCII("Web Applications") - .AppendASCII("example.com").AppendASCII("http_80"); + .AppendASCII("example.com") + .AppendASCII("http_80"); EXPECT_EQ(expected, result); } diff --git a/chrome/browser/webdata/keyword_table.cc b/chrome/browser/webdata/keyword_table.cc index 10d224e..956d60b 100644 --- a/chrome/browser/webdata/keyword_table.cc +++ b/chrome/browser/webdata/keyword_table.cc @@ -388,7 +388,7 @@ bool KeywordTable::MigrateToVersion45RemoveLogoIDAndAutogenerateColumns() { // Migrate the keywords backup table as well. if (!MigrateKeywordsTableForVersion45("keywords_backup") || !meta_table_->SetValue("Default Search Provider ID Backup Signature", - std::string())) + "")) return false; return transaction.Commit(); @@ -409,7 +409,7 @@ bool KeywordTable::MigrateToVersion47AddAlternateURLsColumn() { if (!db_->Execute("ALTER TABLE keywords_backup ADD COLUMN " "alternate_urls VARCHAR DEFAULT ''") || !meta_table_->SetValue("Default Search Provider ID Backup Signature", - std::string())) + "")) return false; return transaction.Commit(); diff --git a/chrome/browser/webdata/token_service_table_unittest.cc b/chrome/browser/webdata/token_service_table_unittest.cc index 3c60ccf..db409f8 100644 --- a/chrome/browser/webdata/token_service_table_unittest.cc +++ b/chrome/browser/webdata/token_service_table_unittest.cc @@ -89,7 +89,7 @@ TEST_F(TokenServiceTableTest, MAYBE_TokenServiceGetSet) { out_map.clear(); // try blanking it - won't remove it from the db though! - EXPECT_TRUE(table_->SetTokenForService(service, std::string())); + EXPECT_TRUE(table_->SetTokenForService(service, "")); EXPECT_TRUE(table_->GetAllTokens(&out_map)); EXPECT_EQ(out_map.find(service)->second, ""); out_map.clear(); diff --git a/chrome/common/child_process_logging_posix.cc b/chrome/common/child_process_logging_posix.cc index 496103e..1690cd5 100644 --- a/chrome/common/child_process_logging_posix.cc +++ b/chrome/common/child_process_logging_posix.cc @@ -66,7 +66,7 @@ void SetActiveURL(const GURL& url) { void SetClientId(const std::string& client_id) { std::string str(client_id); - ReplaceSubstringsAfterOffset(&str, 0, "-", std::string()); + ReplaceSubstringsAfterOffset(&str, 0, "-", ""); if (str.empty()) return; diff --git a/chrome/common/content_settings_helper.cc b/chrome/common/content_settings_helper.cc index 68e8d40..306cbe7 100644 --- a/chrome/common/content_settings_helper.cc +++ b/chrome/common/content_settings_helper.cc @@ -12,14 +12,11 @@ namespace content_settings_helper { std::string OriginToString(const GURL& origin) { - std::string port_component(origin.IntPort() != url_parse::PORT_UNSPECIFIED - ? ":" + origin.port() - : std::string()); - std::string scheme_component(!origin.SchemeIs(chrome::kHttpScheme) - ? origin.scheme() + - content::kStandardSchemeSeparator - : std::string()); - return scheme_component + origin.host() + port_component; + std::string port_component(origin.IntPort() != url_parse::PORT_UNSPECIFIED ? + ":" + origin.port() : ""); + std::string scheme_component(!origin.SchemeIs(chrome::kHttpScheme) ? + origin.scheme() + content::kStandardSchemeSeparator : ""); + return scheme_component + origin.host() + port_component; } string16 OriginToString16(const GURL& origin) { diff --git a/chrome/common/content_settings_pattern.cc b/chrome/common/content_settings_pattern.cc index ee02312..9153de6 100644 --- a/chrome/common/content_settings_pattern.cc +++ b/chrome/common/content_settings_pattern.cc @@ -26,7 +26,7 @@ std::string GetDefaultPort(const std::string& scheme) { return "80"; if (scheme == chrome::kHttpsScheme) return "443"; - return std::string(); + return ""; } // Returns true if |sub_domain| is a sub domain or equls |domain|. E.g. @@ -501,7 +501,7 @@ const std::string ContentSettingsPattern::ToString() const { if (IsValid()) return content_settings::PatternParser::ToString(parts_); else - return std::string(); + return ""; } ContentSettingsPattern::Relation ContentSettingsPattern::Compare( diff --git a/chrome/common/content_settings_pattern_parser.cc b/chrome/common/content_settings_pattern_parser.cc index 73da479..2f823cc 100644 --- a/chrome/common/content_settings_pattern_parser.cc +++ b/chrome/common/content_settings_pattern_parser.cc @@ -198,7 +198,7 @@ std::string PatternParser::ToString( parts.is_port_wildcard) return "*"; - std::string str; + std::string str = ""; if (!parts.is_scheme_wildcard) str += parts.scheme + content::kStandardSchemeSeparator; diff --git a/chrome/common/content_settings_pattern_unittest.cc b/chrome/common/content_settings_pattern_unittest.cc index c1c1e37..921f97b 100644 --- a/chrome/common/content_settings_pattern_unittest.cc +++ b/chrome/common/content_settings_pattern_unittest.cc @@ -420,8 +420,8 @@ TEST(ContentSettingsPatternTest, InvalidPatterns) { EXPECT_STREQ("", ContentSettingsPattern().ToString().c_str()); // Empty pattern string - EXPECT_FALSE(Pattern(std::string()).IsValid()); - EXPECT_STREQ("", Pattern(std::string()).ToString().c_str()); + EXPECT_FALSE(Pattern("").IsValid()); + EXPECT_STREQ("", Pattern("").ToString().c_str()); // Pattern strings with invalid scheme part. EXPECT_FALSE(Pattern("ftp://myhost.org").IsValid()); @@ -630,7 +630,8 @@ TEST(ContentSettingsPatternTest, PatternSupport_Legacy) { EXPECT_TRUE( Pattern("file:///tmp/test.html").Matches( GURL("file:///tmp/test.html"))); - EXPECT_FALSE(Pattern(std::string()).Matches(GURL("http://www.example.com/"))); + EXPECT_FALSE(Pattern("").Matches( + GURL("http://www.example.com/"))); EXPECT_FALSE(Pattern("[*.]example.com").Matches( GURL("http://example.org/"))); EXPECT_FALSE(Pattern("example.com").Matches( diff --git a/chrome/common/extensions/api/commands/commands_handler.cc b/chrome/common/extensions/api/commands/commands_handler.cc index b5ed3c4..309a204 100644 --- a/chrome/common/extensions/api/commands/commands_handler.cc +++ b/chrome/common/extensions/api/commands/commands_handler.cc @@ -137,10 +137,8 @@ void CommandsHandler::MaybeSetBrowserActionDefault(const Extension* extension, CommandsInfo* info) { if (extension->manifest()->HasKey(keys::kBrowserAction) && !info->browser_action_command.get()) { - info->browser_action_command.reset( - new Command(extension_manifest_values::kBrowserActionCommandEvent, - string16(), - std::string())); + info->browser_action_command.reset(new Command( + extension_manifest_values::kBrowserActionCommandEvent, string16(), "")); } } diff --git a/chrome/common/extensions/api/extension_action/browser_action_manifest_unittest.cc b/chrome/common/extensions/api/extension_action/browser_action_manifest_unittest.cc index ac5040c..84277176 100644 --- a/chrome/common/extensions/api/extension_action/browser_action_manifest_unittest.cc +++ b/chrome/common/extensions/api/extension_action/browser_action_manifest_unittest.cc @@ -100,13 +100,15 @@ TEST_F(BrowserActionManifestTest, TEST_F(BrowserActionManifestTest, BrowserActionManifestIcons_InvalidDefaultIcon) { scoped_ptr<DictionaryValue> manifest_value = DictionaryBuilder() - .Set("name", "Invalid default icon").Set("version", "1.0.0") + .Set("name", "Invalid default icon") + .Set("version", "1.0.0") .Set("manifest_version", 2) - .Set("browser_action", - DictionaryBuilder().Set( - "default_icon", - DictionaryBuilder().Set("19", std::string()) // Invalid value. - .Set("24", "icon24.png").Set("38", "icon38.png"))).Build(); + .Set("browser_action", DictionaryBuilder() + .Set("default_icon", DictionaryBuilder() + .Set("19", "") // Invalid value. + .Set("24", "icon24.png") + .Set("38", "icon38.png"))) + .Build(); string16 error = ErrorUtils::FormatErrorMessageUTF16( errors::kInvalidIconPath, "19"); diff --git a/chrome/common/extensions/api/extension_api.cc b/chrome/common/extensions/api/extension_api.cc index 97a2fdd..b1095a4 100644 --- a/chrome/common/extensions/api/extension_api.cc +++ b/chrome/common/extensions/api/extension_api.cc @@ -426,11 +426,10 @@ Feature::Availability ExtensionAPI::IsAvailable(const std::string& full_name, // Check APIs not using the feature system first. if (!feature) { - return IsNonFeatureAPIAvailable(api_name, context, extension, url) - ? Feature::CreateAvailability(Feature::IS_AVAILABLE, - std::string()) - : Feature::CreateAvailability(Feature::INVALID_CONTEXT, - kUnavailableMessage); + return IsNonFeatureAPIAvailable(api_name, context, extension, url) ? + Feature::CreateAvailability(Feature::IS_AVAILABLE, "") : + Feature::CreateAvailability(Feature::INVALID_CONTEXT, + kUnavailableMessage); } Feature::Availability availability = @@ -446,7 +445,7 @@ Feature::Availability ExtensionAPI::IsAvailable(const std::string& full_name, return dependency_availability; } - return Feature::CreateAvailability(Feature::IS_AVAILABLE, std::string()); + return Feature::CreateAvailability(Feature::IS_AVAILABLE, ""); } bool ExtensionAPI::IsPrivileged(const std::string& full_name) { @@ -635,7 +634,7 @@ std::string ExtensionAPI::GetAPINameFromFullName(const std::string& full_name, } *child_name = ""; - return std::string(); + return ""; } bool ExtensionAPI::IsAPIAllowed(const std::string& name, diff --git a/chrome/common/extensions/api/extension_api_unittest.cc b/chrome/common/extensions/api/extension_api_unittest.cc index f980b57..98830ea 100644 --- a/chrome/common/extensions/api/extension_api_unittest.cc +++ b/chrome/common/extensions/api/extension_api_unittest.cc @@ -97,7 +97,7 @@ TEST_F(ExtensionAPITest, IsPrivileged) { EXPECT_TRUE(extension_api->IsPrivileged("runtime.lastError")); // Default unknown names to privileged for paranoia's sake. - EXPECT_TRUE(extension_api->IsPrivileged(std::string())); + EXPECT_TRUE(extension_api->IsPrivileged("")); EXPECT_TRUE(extension_api->IsPrivileged("<unknown-namespace>")); EXPECT_TRUE(extension_api->IsPrivileged("extension.<unknown-member>")); @@ -224,8 +224,8 @@ TEST(ExtensionAPI, APIFeatures) { TEST_F(ExtensionAPITest, LazyGetSchema) { scoped_ptr<ExtensionAPI> apis(ExtensionAPI::CreateWithDefaultConfiguration()); - EXPECT_EQ(NULL, apis->GetSchema(std::string())); - EXPECT_EQ(NULL, apis->GetSchema(std::string())); + EXPECT_EQ(NULL, apis->GetSchema("")); + EXPECT_EQ(NULL, apis->GetSchema("")); EXPECT_EQ(NULL, apis->GetSchema("experimental")); EXPECT_EQ(NULL, apis->GetSchema("experimental")); EXPECT_EQ(NULL, apis->GetSchema("foo")); diff --git a/chrome/common/extensions/csp_validator_unittest.cc b/chrome/common/extensions/csp_validator_unittest.cc index 13cbfe8..e96c42d 100644 --- a/chrome/common/extensions/csp_validator_unittest.cc +++ b/chrome/common/extensions/csp_validator_unittest.cc @@ -23,10 +23,10 @@ TEST(ExtensionCSPValidator, IsLegal) { } TEST(ExtensionCSPValidator, IsSecure) { - EXPECT_FALSE( - ContentSecurityPolicyIsSecure(std::string(), Manifest::TYPE_EXTENSION)); - EXPECT_FALSE(ContentSecurityPolicyIsSecure("img-src https://google.com", - Manifest::TYPE_EXTENSION)); + EXPECT_FALSE(ContentSecurityPolicyIsSecure( + "", Manifest::TYPE_EXTENSION)); + EXPECT_FALSE(ContentSecurityPolicyIsSecure( + "img-src https://google.com", Manifest::TYPE_EXTENSION)); EXPECT_FALSE(ContentSecurityPolicyIsSecure( "default-src *", Manifest::TYPE_EXTENSION)); @@ -146,10 +146,9 @@ TEST(ExtensionCSPValidator, IsSecure) { } TEST(ExtensionCSPValidator, IsSandboxed) { - EXPECT_FALSE(ContentSecurityPolicyIsSandboxed(std::string(), - Manifest::TYPE_EXTENSION)); - EXPECT_FALSE(ContentSecurityPolicyIsSandboxed("img-src https://google.com", - Manifest::TYPE_EXTENSION)); + EXPECT_FALSE(ContentSecurityPolicyIsSandboxed("", Manifest::TYPE_EXTENSION)); + EXPECT_FALSE(ContentSecurityPolicyIsSandboxed( + "img-src https://google.com", Manifest::TYPE_EXTENSION)); // Sandbox directive is required. EXPECT_TRUE(ContentSecurityPolicyIsSandboxed( diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index 42407b8..a941208 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -437,8 +437,8 @@ bool Extension::ParsePermissions(const char* key, if (manifest_->HasKey(key)) { const ListValue* permissions = NULL; if (!manifest_->GetList(key, &permissions)) { - *error = ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidPermissions, - std::string()); + *error = ErrorUtils::FormatErrorMessageUTF16( + errors::kInvalidPermissions, ""); return false; } diff --git a/chrome/common/extensions/extension_file_util_unittest.cc b/chrome/common/extensions/extension_file_util_unittest.cc index 6d68bc1..cb9260f 100644 --- a/chrome/common/extensions/extension_file_util_unittest.cc +++ b/chrome/common/extensions/extension_file_util_unittest.cc @@ -304,7 +304,7 @@ TEST_F(ExtensionFileUtilTest, ExtensionResourceURLToFilePath) { // Setup filesystem for testing. base::FilePath root_path; ASSERT_TRUE(file_util::CreateNewTempDirectory( - base::FilePath::StringType(), &root_path)); + FILE_PATH_LITERAL(""), &root_path)); ASSERT_TRUE(file_util::AbsolutePath(&root_path)); base::FilePath api_path = root_path.Append(FILE_PATH_LITERAL("apiname")); diff --git a/chrome/common/extensions/extension_icon_set_unittest.cc b/chrome/common/extensions/extension_icon_set_unittest.cc index c7300a7..1202cda 100644 --- a/chrome/common/extensions/extension_icon_set_unittest.cc +++ b/chrome/common/extensions/extension_icon_set_unittest.cc @@ -62,7 +62,7 @@ TEST(ExtensionIconSet, Values) { EXPECT_TRUE(icons.ContainsPath("foo")); EXPECT_TRUE(icons.ContainsPath("bar")); EXPECT_FALSE(icons.ContainsPath("baz")); - EXPECT_FALSE(icons.ContainsPath(std::string())); + EXPECT_FALSE(icons.ContainsPath("")); icons.Clear(); EXPECT_FALSE(icons.ContainsPath("foo")); @@ -83,7 +83,7 @@ TEST(ExtensionIconSet, FindSize) { EXPECT_EQ(extension_misc::EXTENSION_ICON_INVALID, icons.GetIconSizeFromPath("baz")); EXPECT_EQ(extension_misc::EXTENSION_ICON_INVALID, - icons.GetIconSizeFromPath(std::string())); + icons.GetIconSizeFromPath("")); icons.Clear(); EXPECT_EQ(extension_misc::EXTENSION_ICON_INVALID, diff --git a/chrome/common/extensions/extension_l10n_util.cc b/chrome/common/extensions/extension_l10n_util.cc index d2dada0..b86ab49 100644 --- a/chrome/common/extensions/extension_l10n_util.cc +++ b/chrome/common/extensions/extension_l10n_util.cc @@ -44,7 +44,7 @@ std::string GetDefaultLocaleFromManifest(const DictionaryValue& manifest, return default_locale; *error = errors::kInvalidDefaultLocale; - return std::string(); + return ""; } diff --git a/chrome/common/extensions/extension_localization_peer_unittest.cc b/chrome/common/extensions/extension_localization_peer_unittest.cc index df74791..92085ed 100644 --- a/chrome/common/extensions/extension_localization_peer_unittest.cc +++ b/chrome/common/extensions/extension_localization_peer_unittest.cc @@ -144,8 +144,8 @@ TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestBadURLRequestStatus) { EXPECT_CALL(*original_peer_, OnCompletedRequest( net::ERR_ABORTED, false, "", base::TimeTicks())); - filter_peer->OnCompletedRequest( - net::ERR_FAILED, false, std::string(), base::TimeTicks()); + filter_peer->OnCompletedRequest(net::ERR_FAILED, false, "", + base::TimeTicks()); } TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestEmptyData) { @@ -159,8 +159,7 @@ TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestEmptyData) { EXPECT_CALL(*original_peer_, OnCompletedRequest( net::OK, false, "", base::TimeTicks())); - filter_peer->OnCompletedRequest( - net::OK, false, std::string(), base::TimeTicks()); + filter_peer->OnCompletedRequest(net::OK, false, "", base::TimeTicks()); } TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestNoCatalogs) { @@ -179,16 +178,14 @@ TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestNoCatalogs) { EXPECT_CALL(*original_peer_, OnCompletedRequest( net::OK, false, "", base::TimeTicks())).Times(2); - filter_peer->OnCompletedRequest( - net::OK, false, std::string(), base::TimeTicks()); + filter_peer->OnCompletedRequest(net::OK, false, "", base::TimeTicks()); // Test if Send gets called again (it shouldn't be) when first call returned // an empty dictionary. filter_peer = CreateExtensionLocalizationPeer("text/css", GURL(kExtensionUrl_1)); SetData(filter_peer, "some text"); - filter_peer->OnCompletedRequest( - net::OK, false, std::string(), base::TimeTicks()); + filter_peer->OnCompletedRequest(net::OK, false, "", base::TimeTicks()); } TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestWithCatalogs) { @@ -216,8 +213,7 @@ TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestWithCatalogs) { EXPECT_CALL(*original_peer_, OnCompletedRequest( net::OK, false, "", base::TimeTicks())); - filter_peer->OnCompletedRequest( - net::OK, false, std::string(), base::TimeTicks()); + filter_peer->OnCompletedRequest(net::OK, false, "", base::TimeTicks()); } TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestReplaceMessagesFails) { @@ -245,6 +241,5 @@ TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestReplaceMessagesFails) { EXPECT_CALL(*original_peer_, OnCompletedRequest( net::OK, false, "", base::TimeTicks())); - filter_peer->OnCompletedRequest( - net::OK, false, std::string(), base::TimeTicks()); + filter_peer->OnCompletedRequest(net::OK, false, "", base::TimeTicks()); } diff --git a/chrome/common/extensions/extension_set.cc b/chrome/common/extensions/extension_set.cc index 8b68fb6..84872b8 100644 --- a/chrome/common/extensions/extension_set.cc +++ b/chrome/common/extensions/extension_set.cc @@ -77,11 +77,11 @@ std::string ExtensionSet::GetExtensionOrAppIDByURL( DCHECK(!info.origin().isNull()); if (info.url().SchemeIs(extensions::kExtensionScheme)) - return info.origin().isUnique() ? std::string() : info.url().host(); + return info.origin().isUnique() ? "" : info.url().host(); const Extension* extension = GetExtensionOrAppByURL(info); if (!extension) - return std::string(); + return ""; return extension->id(); } diff --git a/chrome/common/extensions/extension_set_unittest.cc b/chrome/common/extensions/extension_set_unittest.cc index c27b0a9..1703966 100644 --- a/chrome/common/extensions/extension_set_unittest.cc +++ b/chrome/common/extensions/extension_set_unittest.cc @@ -59,8 +59,7 @@ TEST(ExtensionSetTest, ExtensionSet) { scoped_refptr<Extension> ext3(CreateTestExtension( "b", "http://dev.chromium.org/", "http://dev.chromium.org/")); - scoped_refptr<Extension> ext4( - CreateTestExtension("c", std::string(), std::string())); + scoped_refptr<Extension> ext4(CreateTestExtension("c", "", "")); ASSERT_TRUE(ext1 && ext2 && ext3 && ext4); @@ -119,10 +118,8 @@ TEST(ExtensionSetTest, ExtensionSet) { EXPECT_FALSE(extensions.GetByID(ext2->id())); // Make a union of a set with 3 more extensions (only 2 are new). - scoped_refptr<Extension> ext5( - CreateTestExtension("d", std::string(), std::string())); - scoped_refptr<Extension> ext6( - CreateTestExtension("e", std::string(), std::string())); + scoped_refptr<Extension> ext5(CreateTestExtension("d", "", "")); + scoped_refptr<Extension> ext6(CreateTestExtension("e", "", "")); ASSERT_TRUE(ext5 && ext6); scoped_ptr<ExtensionSet> to_add(new ExtensionSet()); diff --git a/chrome/common/extensions/extension_sync_type_unittest.cc b/chrome/common/extensions/extension_sync_type_unittest.cc index b25e197..3256c8d 100644 --- a/chrome/common/extensions/extension_sync_type_unittest.cc +++ b/chrome/common/extensions/extension_sync_type_unittest.cc @@ -56,7 +56,7 @@ class ExtensionSyncTypeTest : public ExtensionTest { ListValue* plugins = new ListValue(); for (int i = 0; i < num_plugins; ++i) { DictionaryValue* plugin = new DictionaryValue(); - plugin->SetString(keys::kPluginsPath, std::string()); + plugin->SetString(keys::kPluginsPath, ""); plugins->Set(i, plugin); } source.Set(keys::kPlugins, plugins); @@ -158,7 +158,7 @@ TEST_F(ExtensionSyncTypeTest, DisplayInXManifestProperties) { manifest.SetString(keys::kName, "TestComponentApp"); manifest.SetString(keys::kVersion, "0.0.0.0"); manifest.SetString(keys::kApp, "true"); - manifest.SetString(keys::kPlatformAppBackgroundPage, std::string()); + manifest.SetString(keys::kPlatformAppBackgroundPage, ""); std::string error; scoped_refptr<Extension> app; diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc index edf24c4..6a3c80d 100644 --- a/chrome/common/extensions/extension_unittest.cc +++ b/chrome/common/extensions/extension_unittest.cc @@ -233,22 +233,16 @@ TEST_F(ExtensionTest, MimeTypeSniffing) { ASSERT_TRUE(file_util::ReadFileToString(path, &data)); std::string result; - EXPECT_TRUE(net::SniffMimeType(data.c_str(), - data.size(), - GURL("http://www.example.com/foo.crx"), - std::string(), - &result)); + EXPECT_TRUE(net::SniffMimeType(data.c_str(), data.size(), + GURL("http://www.example.com/foo.crx"), "", &result)); EXPECT_EQ(std::string(Extension::kMimeType), result); data.clear(); result.clear(); path = path.DirName().AppendASCII("bad_magic.crx"); ASSERT_TRUE(file_util::ReadFileToString(path, &data)); - EXPECT_TRUE(net::SniffMimeType(data.c_str(), - data.size(), - GURL("http://www.example.com/foo.crx"), - std::string(), - &result)); + EXPECT_TRUE(net::SniffMimeType(data.c_str(), data.size(), + GURL("http://www.example.com/foo.crx"), "", &result)); EXPECT_EQ("application/octet-stream", result); } diff --git a/chrome/common/extensions/features/api_feature.cc b/chrome/common/extensions/features/api_feature.cc index f6d826e..0020632 100644 --- a/chrome/common/extensions/features/api_feature.cc +++ b/chrome/common/extensions/features/api_feature.cc @@ -26,7 +26,7 @@ std::string APIFeature::Parse(const DictionaryValue* value) { if (GetContexts()->empty()) return name() + ": API features must specify at least one context."; - return std::string(); + return ""; } } // namespace diff --git a/chrome/common/extensions/features/complex_feature.cc b/chrome/common/extensions/features/complex_feature.cc index a4515d0e4..f6f1c11 100644 --- a/chrome/common/extensions/features/complex_feature.cc +++ b/chrome/common/extensions/features/complex_feature.cc @@ -76,7 +76,7 @@ std::string ComplexFeature::GetAvailabilityMessage(AvailabilityResult result, Manifest::Type type, const GURL& url) const { if (result == IS_AVAILABLE) - return std::string(); + return ""; // TODO(justinlin): Form some kind of combined availabilities/messages from // SimpleFeatures. diff --git a/chrome/common/extensions/features/manifest_feature.cc b/chrome/common/extensions/features/manifest_feature.cc index 5196b52..cd4a53f 100644 --- a/chrome/common/extensions/features/manifest_feature.cc +++ b/chrome/common/extensions/features/manifest_feature.cc @@ -47,7 +47,7 @@ std::string ManifestFeature::Parse(const DictionaryValue* value) { if (!GetContexts()->empty()) return name() + ": Manifest features do not support contexts."; - return std::string(); + return ""; } } // namespace diff --git a/chrome/common/extensions/features/permission_feature.cc b/chrome/common/extensions/features/permission_feature.cc index 4681aa2..72b261f 100644 --- a/chrome/common/extensions/features/permission_feature.cc +++ b/chrome/common/extensions/features/permission_feature.cc @@ -49,7 +49,7 @@ std::string PermissionFeature::Parse(const DictionaryValue* value) { if (!GetContexts()->empty()) return name() + ": Permission features do not support contexts."; - return std::string(); + return ""; } } // namespace diff --git a/chrome/common/extensions/features/simple_feature.cc b/chrome/common/extensions/features/simple_feature.cc index 4b08c60..13c8573 100644 --- a/chrome/common/extensions/features/simple_feature.cc +++ b/chrome/common/extensions/features/simple_feature.cc @@ -168,7 +168,7 @@ std::string GetDisplayTypeName(Manifest::Type type) { } NOTREACHED(); - return std::string(); + return ""; } } // namespace @@ -229,7 +229,7 @@ std::string SimpleFeature::Parse(const DictionaryValue* value) { return name() + ": Allowing web_page contexts requires supplying a value " + "for matches."; } - return std::string(); + return ""; } Feature::Availability SimpleFeature::IsAvailableToManifest( @@ -313,7 +313,7 @@ std::string SimpleFeature::GetAvailabilityMessage( AvailabilityResult result, Manifest::Type type, const GURL& url) const { switch (result) { case IS_AVAILABLE: - return std::string(); + return ""; case NOT_FOUND_IN_WHITELIST: return base::StringPrintf( "'%s' is not allowed for specified extension ID.", @@ -381,7 +381,7 @@ std::string SimpleFeature::GetAvailabilityMessage( } NOTREACHED(); - return std::string(); + return ""; } Feature::Availability SimpleFeature::CreateAvailability( diff --git a/chrome/common/extensions/features/simple_feature_unittest.cc b/chrome/common/extensions/features/simple_feature_unittest.cc index 4f92a34..443b152 100644 --- a/chrome/common/extensions/features/simple_feature_unittest.cc +++ b/chrome/common/extensions/features/simple_feature_unittest.cc @@ -91,13 +91,9 @@ TEST_F(ExtensionSimpleFeatureTest, Whitelist) { EXPECT_EQ(Feature::NOT_FOUND_IN_WHITELIST, feature.IsAvailableToManifest( kIdBaz, Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, -1, Feature::UNSPECIFIED_PLATFORM).result()); - EXPECT_EQ( - Feature::NOT_FOUND_IN_WHITELIST, - feature.IsAvailableToManifest(std::string(), - Manifest::TYPE_UNKNOWN, - Feature::UNSPECIFIED_LOCATION, - -1, - Feature::UNSPECIFIED_PLATFORM).result()); + EXPECT_EQ(Feature::NOT_FOUND_IN_WHITELIST, feature.IsAvailableToManifest( + "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, -1, + Feature::UNSPECIFIED_PLATFORM).result()); feature.extension_types()->insert(Manifest::TYPE_LEGACY_PACKAGED_APP); EXPECT_EQ(Feature::NOT_FOUND_IN_WHITELIST, feature.IsAvailableToManifest( @@ -137,35 +133,19 @@ TEST_F(ExtensionSimpleFeatureTest, PackageType) { feature.extension_types()->insert(Manifest::TYPE_EXTENSION); feature.extension_types()->insert(Manifest::TYPE_LEGACY_PACKAGED_APP); - EXPECT_EQ( - Feature::IS_AVAILABLE, - feature.IsAvailableToManifest(std::string(), - Manifest::TYPE_EXTENSION, - Feature::UNSPECIFIED_LOCATION, - -1, - Feature::UNSPECIFIED_PLATFORM).result()); - EXPECT_EQ( - Feature::IS_AVAILABLE, - feature.IsAvailableToManifest(std::string(), - Manifest::TYPE_LEGACY_PACKAGED_APP, - Feature::UNSPECIFIED_LOCATION, - -1, - Feature::UNSPECIFIED_PLATFORM).result()); - - EXPECT_EQ( - Feature::INVALID_TYPE, - feature.IsAvailableToManifest(std::string(), - Manifest::TYPE_UNKNOWN, - Feature::UNSPECIFIED_LOCATION, - -1, - Feature::UNSPECIFIED_PLATFORM).result()); - EXPECT_EQ( - Feature::INVALID_TYPE, - feature.IsAvailableToManifest(std::string(), - Manifest::TYPE_THEME, - Feature::UNSPECIFIED_LOCATION, - -1, - Feature::UNSPECIFIED_PLATFORM).result()); + EXPECT_EQ(Feature::IS_AVAILABLE, feature.IsAvailableToManifest( + "", Manifest::TYPE_EXTENSION, Feature::UNSPECIFIED_LOCATION, -1, + Feature::UNSPECIFIED_PLATFORM).result()); + EXPECT_EQ(Feature::IS_AVAILABLE, feature.IsAvailableToManifest( + "", Manifest::TYPE_LEGACY_PACKAGED_APP, Feature::UNSPECIFIED_LOCATION, + -1, Feature::UNSPECIFIED_PLATFORM).result()); + + EXPECT_EQ(Feature::INVALID_TYPE, feature.IsAvailableToManifest( + "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, -1, + Feature::UNSPECIFIED_PLATFORM).result()); + EXPECT_EQ(Feature::INVALID_TYPE, feature.IsAvailableToManifest( + "", Manifest::TYPE_THEME, Feature::UNSPECIFIED_LOCATION, -1, + Feature::UNSPECIFIED_PLATFORM).result()); } TEST_F(ExtensionSimpleFeatureTest, Context) { @@ -240,107 +220,64 @@ TEST_F(ExtensionSimpleFeatureTest, Location) { // If the feature specifies "component" as its location, then only component // extensions can access it. feature.set_location(Feature::COMPONENT_LOCATION); - EXPECT_EQ( - Feature::IS_AVAILABLE, - feature.IsAvailableToManifest(std::string(), - Manifest::TYPE_UNKNOWN, - Feature::COMPONENT_LOCATION, - -1, - Feature::UNSPECIFIED_PLATFORM).result()); - EXPECT_EQ( - Feature::INVALID_LOCATION, - feature.IsAvailableToManifest(std::string(), - Manifest::TYPE_UNKNOWN, - Feature::UNSPECIFIED_LOCATION, - -1, - Feature::UNSPECIFIED_PLATFORM).result()); + EXPECT_EQ(Feature::IS_AVAILABLE, feature.IsAvailableToManifest( + "", Manifest::TYPE_UNKNOWN, Feature::COMPONENT_LOCATION, -1, + Feature::UNSPECIFIED_PLATFORM).result()); + EXPECT_EQ(Feature::INVALID_LOCATION, feature.IsAvailableToManifest( + "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, -1, + Feature::UNSPECIFIED_PLATFORM).result()); // But component extensions can access anything else, whatever their location. feature.set_location(Feature::UNSPECIFIED_LOCATION); - EXPECT_EQ( - Feature::IS_AVAILABLE, - feature.IsAvailableToManifest(std::string(), - Manifest::TYPE_UNKNOWN, - Feature::COMPONENT_LOCATION, - -1, - Feature::UNSPECIFIED_PLATFORM).result()); + EXPECT_EQ(Feature::IS_AVAILABLE, feature.IsAvailableToManifest( + "", Manifest::TYPE_UNKNOWN, Feature::COMPONENT_LOCATION, -1, + Feature::UNSPECIFIED_PLATFORM).result()); } TEST_F(ExtensionSimpleFeatureTest, Platform) { SimpleFeature feature; feature.set_platform(Feature::CHROMEOS_PLATFORM); - EXPECT_EQ(Feature::IS_AVAILABLE, - feature.IsAvailableToManifest(std::string(), - Manifest::TYPE_UNKNOWN, - Feature::UNSPECIFIED_LOCATION, - -1, - Feature::CHROMEOS_PLATFORM).result()); - EXPECT_EQ( - Feature::INVALID_PLATFORM, - feature.IsAvailableToManifest(std::string(), - Manifest::TYPE_UNKNOWN, - Feature::UNSPECIFIED_LOCATION, - -1, - Feature::UNSPECIFIED_PLATFORM).result()); + EXPECT_EQ(Feature::IS_AVAILABLE, feature.IsAvailableToManifest( + "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, -1, + Feature::CHROMEOS_PLATFORM).result()); + EXPECT_EQ(Feature::INVALID_PLATFORM, feature.IsAvailableToManifest( + "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, -1, + Feature::UNSPECIFIED_PLATFORM).result()); } TEST_F(ExtensionSimpleFeatureTest, Version) { SimpleFeature feature; feature.set_min_manifest_version(5); - EXPECT_EQ( - Feature::INVALID_MIN_MANIFEST_VERSION, - feature.IsAvailableToManifest(std::string(), - Manifest::TYPE_UNKNOWN, - Feature::UNSPECIFIED_LOCATION, - 0, - Feature::UNSPECIFIED_PLATFORM).result()); - EXPECT_EQ( - Feature::INVALID_MIN_MANIFEST_VERSION, - feature.IsAvailableToManifest(std::string(), - Manifest::TYPE_UNKNOWN, - Feature::UNSPECIFIED_LOCATION, - 4, - Feature::UNSPECIFIED_PLATFORM).result()); - - EXPECT_EQ( - Feature::IS_AVAILABLE, - feature.IsAvailableToManifest(std::string(), - Manifest::TYPE_UNKNOWN, - Feature::UNSPECIFIED_LOCATION, - 5, - Feature::UNSPECIFIED_PLATFORM).result()); - EXPECT_EQ( - Feature::IS_AVAILABLE, - feature.IsAvailableToManifest(std::string(), - Manifest::TYPE_UNKNOWN, - Feature::UNSPECIFIED_LOCATION, - 10, - Feature::UNSPECIFIED_PLATFORM).result()); + EXPECT_EQ(Feature::INVALID_MIN_MANIFEST_VERSION, + feature.IsAvailableToManifest( + "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, + 0, Feature::UNSPECIFIED_PLATFORM).result()); + EXPECT_EQ(Feature::INVALID_MIN_MANIFEST_VERSION, + feature.IsAvailableToManifest( + "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, + 4, Feature::UNSPECIFIED_PLATFORM).result()); + + EXPECT_EQ(Feature::IS_AVAILABLE, feature.IsAvailableToManifest( + "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, + 5, Feature::UNSPECIFIED_PLATFORM).result()); + EXPECT_EQ(Feature::IS_AVAILABLE, feature.IsAvailableToManifest( + "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, + 10, Feature::UNSPECIFIED_PLATFORM).result()); feature.set_max_manifest_version(8); - EXPECT_EQ( - Feature::INVALID_MAX_MANIFEST_VERSION, - feature.IsAvailableToManifest(std::string(), - Manifest::TYPE_UNKNOWN, - Feature::UNSPECIFIED_LOCATION, - 10, - Feature::UNSPECIFIED_PLATFORM).result()); - EXPECT_EQ( - Feature::IS_AVAILABLE, - feature.IsAvailableToManifest(std::string(), - Manifest::TYPE_UNKNOWN, - Feature::UNSPECIFIED_LOCATION, - 8, - Feature::UNSPECIFIED_PLATFORM).result()); - EXPECT_EQ( - Feature::IS_AVAILABLE, - feature.IsAvailableToManifest(std::string(), - Manifest::TYPE_UNKNOWN, - Feature::UNSPECIFIED_LOCATION, - 7, - Feature::UNSPECIFIED_PLATFORM).result()); + EXPECT_EQ(Feature::INVALID_MAX_MANIFEST_VERSION, + feature.IsAvailableToManifest( + "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, + 10, Feature::UNSPECIFIED_PLATFORM).result()); + EXPECT_EQ(Feature::IS_AVAILABLE, + feature.IsAvailableToManifest( + "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, + 8, Feature::UNSPECIFIED_PLATFORM).result()); + EXPECT_EQ(Feature::IS_AVAILABLE, feature.IsAvailableToManifest( + "", Manifest::TYPE_UNKNOWN, Feature::UNSPECIFIED_LOCATION, + 7, Feature::UNSPECIFIED_PLATFORM).result()); } TEST_F(ExtensionSimpleFeatureTest, ParseNull) { @@ -612,15 +549,15 @@ TEST_F(ExtensionSimpleFeatureTest, SupportedChannel) { // Default supported channel (trunk). EXPECT_EQ(Feature::IS_AVAILABLE, - IsAvailableInChannel(std::string(), VersionInfo::CHANNEL_UNKNOWN)); + IsAvailableInChannel("", VersionInfo::CHANNEL_UNKNOWN)); EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL, - IsAvailableInChannel(std::string(), VersionInfo::CHANNEL_CANARY)); + IsAvailableInChannel("", VersionInfo::CHANNEL_CANARY)); EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL, - IsAvailableInChannel(std::string(), VersionInfo::CHANNEL_DEV)); + IsAvailableInChannel("", VersionInfo::CHANNEL_DEV)); EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL, - IsAvailableInChannel(std::string(), VersionInfo::CHANNEL_BETA)); + IsAvailableInChannel("", VersionInfo::CHANNEL_BETA)); EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL, - IsAvailableInChannel(std::string(), VersionInfo::CHANNEL_STABLE)); + IsAvailableInChannel("", VersionInfo::CHANNEL_STABLE)); } } // namespace diff --git a/chrome/common/extensions/manifest_tests/extension_manifest_test.cc b/chrome/common/extensions/manifest_tests/extension_manifest_test.cc index 4e72588..b61d5f7 100644 --- a/chrome/common/extensions/manifest_tests/extension_manifest_test.cc +++ b/chrome/common/extensions/manifest_tests/extension_manifest_test.cc @@ -217,16 +217,20 @@ ExtensionManifestTest::Testcase::Testcase(std::string manifest_filename, ExtensionManifestTest::Testcase::Testcase(std::string manifest_filename) : manifest_filename_(manifest_filename), + expected_error_(""), location_(extensions::Manifest::INTERNAL), - flags_(Extension::NO_FLAGS) {} + flags_(Extension::NO_FLAGS) { +} ExtensionManifestTest::Testcase::Testcase( std::string manifest_filename, extensions::Manifest::Location location, int flags) : manifest_filename_(manifest_filename), + expected_error_(""), location_(location), - flags_(flags) {} + flags_(flags) { +} void ExtensionManifestTest::RunTestcases(const Testcase* testcases, size_t num_testcases, diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc index bb93903..1fdab49 100644 --- a/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc +++ b/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc @@ -98,7 +98,7 @@ TEST_F(PlatformAppsManifestTest, PlatformAppContentSecurityPolicy) { EXPECT_TRUE(extension->is_platform_app()); EXPECT_EQ( "default-src 'self' https://www.google.com", - CSPInfo::GetResourceContentSecurityPolicy(extension, std::string())); + CSPInfo::GetResourceContentSecurityPolicy(extension, "")); // But even whitelisted ones must specify a secure policy. LoadAndExpectError( diff --git a/chrome/common/extensions/manifest_url_handler.cc b/chrome/common/extensions/manifest_url_handler.cc index 690cc03..2e18eb1 100644 --- a/chrome/common/extensions/manifest_url_handler.cc +++ b/chrome/common/extensions/manifest_url_handler.cc @@ -125,8 +125,8 @@ bool HomepageURLHandler::Parse(Extension* extension, string16* error) { std::string homepage_url_str; if (!extension->manifest()->GetString(keys::kHomepageURL, &homepage_url_str)) { - *error = ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidHomepageURL, - std::string()); + *error = ErrorUtils::FormatErrorMessageUTF16( + errors::kInvalidHomepageURL, ""); return false; } manifest_url->url_ = GURL(homepage_url_str); @@ -156,8 +156,8 @@ bool UpdateURLHandler::Parse(Extension* extension, string16* error) { std::string tmp_update_url; if (!extension->manifest()->GetString(keys::kUpdateURL, &tmp_update_url)) { - *error = ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidUpdateURL, - std::string()); + *error = ErrorUtils::FormatErrorMessageUTF16( + errors::kInvalidUpdateURL, ""); return false; } diff --git a/chrome/common/extensions/message_bundle.cc b/chrome/common/extensions/message_bundle.cc index bb7d547..708e2e4 100644 --- a/chrome/common/extensions/message_bundle.cc +++ b/chrome/common/extensions/message_bundle.cc @@ -303,7 +303,7 @@ std::string MessageBundle::GetL10nMessage(const std::string& name, return it->second; } - return std::string(); + return ""; } /////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/common/extensions/permissions/bluetooth_device_permission_data.cc b/chrome/common/extensions/permissions/bluetooth_device_permission_data.cc index 82c5acd..3698ebf 100644 --- a/chrome/common/extensions/permissions/bluetooth_device_permission_data.cc +++ b/chrome/common/extensions/permissions/bluetooth_device_permission_data.cc @@ -18,7 +18,9 @@ const char* kDeviceAddressKey = "deviceAddress"; namespace extensions { -BluetoothDevicePermissionData::BluetoothDevicePermissionData() {} +BluetoothDevicePermissionData::BluetoothDevicePermissionData() + : device_address_("") { +} BluetoothDevicePermissionData::BluetoothDevicePermissionData( const std::string& device_address) : device_address_(device_address) { diff --git a/chrome/common/extensions/permissions/socket_permission_unittest.cc b/chrome/common/extensions/permissions/socket_permission_unittest.cc index 05e7d3d..6bb07be 100644 --- a/chrome/common/extensions/permissions/socket_permission_unittest.cc +++ b/chrome/common/extensions/permissions/socket_permission_unittest.cc @@ -48,7 +48,7 @@ TEST_F(SocketPermissionTest, General) { TEST_F(SocketPermissionTest, Parse) { SocketPermissionData data; - EXPECT_FALSE(data.ParseForTest(std::string())); + EXPECT_FALSE(data.ParseForTest("")); EXPECT_FALSE(data.ParseForTest("*")); EXPECT_FALSE(data.ParseForTest("\00\00*")); EXPECT_FALSE(data.ParseForTest("\01*")); diff --git a/chrome/common/extensions/update_manifest_unittest.cc b/chrome/common/extensions/update_manifest_unittest.cc index 2a16b9c..9af11df 100644 --- a/chrome/common/extensions/update_manifest_unittest.cc +++ b/chrome/common/extensions/update_manifest_unittest.cc @@ -120,7 +120,7 @@ TEST(ExtensionUpdateManifestTest, TestUpdateManifest) { UpdateManifest parser; // Test parsing of a number of invalid xml cases - EXPECT_FALSE(parser.Parse(std::string())); + EXPECT_FALSE(parser.Parse("")); EXPECT_FALSE(parser.errors().empty()); EXPECT_TRUE(parser.Parse(kMissingAppId)); diff --git a/chrome/common/json_schema/json_schema_validator.cc b/chrome/common/json_schema/json_schema_validator.cc index 6e5e070..a303442 100644 --- a/chrome/common/json_schema/json_schema_validator.cc +++ b/chrome/common/json_schema/json_schema_validator.cc @@ -99,7 +99,7 @@ std::string JSONSchemaValidator::GetJSONSchemaType(const Value* value) { return schema::kArray; default: NOTREACHED() << "Unexpected value type: " << value->GetType(); - return std::string(); + return ""; } } @@ -147,7 +147,7 @@ JSONSchemaValidator::~JSONSchemaValidator() {} bool JSONSchemaValidator::Validate(const Value* instance) { errors_.clear(); - Validate(instance, schema_root_, std::string()); + Validate(instance, schema_root_, ""); return errors_.empty(); } diff --git a/chrome/common/json_schema/json_schema_validator_unittest_base.cc b/chrome/common/json_schema/json_schema_validator_unittest_base.cc index 8ce82b7..ecd9846 100644 --- a/chrome/common/json_schema/json_schema_validator_unittest_base.cc +++ b/chrome/common/json_schema/json_schema_validator_unittest_base.cc @@ -130,9 +130,7 @@ void JSONSchemaValidatorTestBase::TestStringPattern() { schema.get(), NULL); ExpectNotValid(TEST_SOURCE, scoped_ptr<base::Value>(new base::StringValue("bar")).get(), - schema.get(), - NULL, - std::string(), + schema.get(), NULL, "", JSONSchemaValidator::FormatErrorMessage( JSONSchemaValidator::kStringPattern, "foo+")); } @@ -152,16 +150,10 @@ void JSONSchemaValidatorTestBase::TestEnum() { ExpectNotValid(TEST_SOURCE, scoped_ptr<base::Value>(new base::StringValue("42")).get(), - schema.get(), - NULL, - std::string(), - JSONSchemaValidator::kInvalidEnum); + schema.get(), NULL, "", JSONSchemaValidator::kInvalidEnum); ExpectNotValid(TEST_SOURCE, scoped_ptr<base::Value>(base::Value::CreateNullValue()).get(), - schema.get(), - NULL, - std::string(), - JSONSchemaValidator::kInvalidEnum); + schema.get(), NULL, "", JSONSchemaValidator::kInvalidEnum); } void JSONSchemaValidatorTestBase::TestChoices() { @@ -181,24 +173,14 @@ void JSONSchemaValidatorTestBase::TestChoices() { ExpectNotValid(TEST_SOURCE, scoped_ptr<base::Value>(new base::StringValue("foo")).get(), - schema.get(), - NULL, - std::string(), - JSONSchemaValidator::kInvalidChoice); + schema.get(), NULL, "", JSONSchemaValidator::kInvalidChoice); ExpectNotValid(TEST_SOURCE, scoped_ptr<base::Value>(new base::ListValue()).get(), - schema.get(), - NULL, - std::string(), - JSONSchemaValidator::kInvalidChoice); + schema.get(), NULL, "", JSONSchemaValidator::kInvalidChoice); instance->SetInteger("foo", 42); - ExpectNotValid(TEST_SOURCE, - instance.get(), - schema.get(), - NULL, - std::string(), - JSONSchemaValidator::kInvalidChoice); + ExpectNotValid(TEST_SOURCE, instance.get(), + schema.get(), NULL, "", JSONSchemaValidator::kInvalidChoice); } void JSONSchemaValidatorTestBase::TestExtends() { @@ -351,11 +333,7 @@ void JSONSchemaValidatorTestBase::TestArrayTuple() { ExpectValid(TEST_SOURCE, instance.get(), schema.get(), NULL); instance->Append(new base::StringValue("anything")); - ExpectNotValid(TEST_SOURCE, - instance.get(), - schema.get(), - NULL, - std::string(), + ExpectNotValid(TEST_SOURCE, instance.get(), schema.get(), NULL, "", JSONSchemaValidator::FormatErrorMessage( JSONSchemaValidator::kArrayMaxItems, "2")); @@ -425,21 +403,13 @@ void JSONSchemaValidatorTestBase::TestArrayNonTuple() { ExpectValid(TEST_SOURCE, instance.get(), schema.get(), NULL); instance->Append(new base::StringValue("x")); - ExpectNotValid(TEST_SOURCE, - instance.get(), - schema.get(), - NULL, - std::string(), + ExpectNotValid(TEST_SOURCE, instance.get(), schema.get(), NULL, "", JSONSchemaValidator::FormatErrorMessage( JSONSchemaValidator::kArrayMaxItems, "3")); instance->Remove(1, NULL); instance->Remove(1, NULL); instance->Remove(1, NULL); - ExpectNotValid(TEST_SOURCE, - instance.get(), - schema.get(), - NULL, - std::string(), + ExpectNotValid(TEST_SOURCE, instance.get(), schema.get(), NULL, "", JSONSchemaValidator::FormatErrorMessage( JSONSchemaValidator::kArrayMinItems, "2")); @@ -466,20 +436,15 @@ void JSONSchemaValidatorTestBase::TestString() { new base::StringValue("xxxxxxxxxx")).get(), schema.get(), NULL); - ExpectNotValid( - TEST_SOURCE, - scoped_ptr<base::Value>(new base::StringValue(std::string())).get(), - schema.get(), - NULL, - std::string(), - JSONSchemaValidator::FormatErrorMessage( - JSONSchemaValidator::kStringMinLength, "1")); + ExpectNotValid(TEST_SOURCE, + scoped_ptr<base::Value>(new base::StringValue("")).get(), + schema.get(), NULL, "", + JSONSchemaValidator::FormatErrorMessage( + JSONSchemaValidator::kStringMinLength, "1")); ExpectNotValid( TEST_SOURCE, scoped_ptr<base::Value>(new base::StringValue("xxxxxxxxxxx")).get(), - schema.get(), - NULL, - std::string(), + schema.get(), NULL, "", JSONSchemaValidator::FormatErrorMessage( JSONSchemaValidator::kStringMaxLength, "10")); } @@ -504,19 +469,16 @@ void JSONSchemaValidatorTestBase::TestNumber() { scoped_ptr<base::Value>(new base::FundamentalValue(88.88)).get(), schema.get(), NULL); - ExpectNotValid(TEST_SOURCE, - scoped_ptr<base::Value>(new base::FundamentalValue(0.5)).get(), - schema.get(), - NULL, - std::string(), - JSONSchemaValidator::FormatErrorMessage( - JSONSchemaValidator::kNumberMinimum, "1")); + ExpectNotValid( + TEST_SOURCE, + scoped_ptr<base::Value>(new base::FundamentalValue(0.5)).get(), + schema.get(), NULL, "", + JSONSchemaValidator::FormatErrorMessage( + JSONSchemaValidator::kNumberMinimum, "1")); ExpectNotValid( TEST_SOURCE, scoped_ptr<base::Value>(new base::FundamentalValue(100.1)).get(), - schema.get(), - NULL, - std::string(), + schema.get(), NULL, "", JSONSchemaValidator::FormatErrorMessage( JSONSchemaValidator::kNumberMaximum, "100")); } @@ -644,83 +606,73 @@ void JSONSchemaValidatorTestBase::TestTypes() { // not valid schema->SetString(schema::kType, schema::kObject); - ExpectNotValid( - TEST_SOURCE, - scoped_ptr<base::Value>(new base::ListValue()).get(), - schema.get(), - NULL, - std::string(), - JSONSchemaValidator::FormatErrorMessage( - JSONSchemaValidator::kInvalidType, schema::kObject, schema::kArray)); + ExpectNotValid(TEST_SOURCE, + scoped_ptr<base::Value>(new base::ListValue()).get(), + schema.get(), NULL, "", + JSONSchemaValidator::FormatErrorMessage( + JSONSchemaValidator::kInvalidType, + schema::kObject, + schema::kArray)); schema->SetString(schema::kType, schema::kObject); - ExpectNotValid( - TEST_SOURCE, - scoped_ptr<base::Value>(base::Value::CreateNullValue()).get(), - schema.get(), - NULL, - std::string(), - JSONSchemaValidator::FormatErrorMessage( - JSONSchemaValidator::kInvalidType, schema::kObject, schema::kNull)); + ExpectNotValid(TEST_SOURCE, + scoped_ptr<base::Value>(base::Value::CreateNullValue()).get(), + schema.get(), NULL, "", + JSONSchemaValidator::FormatErrorMessage( + JSONSchemaValidator::kInvalidType, + schema::kObject, + schema::kNull)); schema->SetString(schema::kType, schema::kArray); - ExpectNotValid( - TEST_SOURCE, - scoped_ptr<base::Value>(new base::FundamentalValue(42)).get(), - schema.get(), - NULL, - std::string(), - JSONSchemaValidator::FormatErrorMessage( - JSONSchemaValidator::kInvalidType, schema::kArray, schema::kInteger)); + ExpectNotValid(TEST_SOURCE, + scoped_ptr<base::Value>(new base::FundamentalValue(42)).get(), + schema.get(), NULL, "", + JSONSchemaValidator::FormatErrorMessage( + JSONSchemaValidator::kInvalidType, + schema::kArray, + schema::kInteger)); schema->SetString(schema::kType, schema::kString); - ExpectNotValid( - TEST_SOURCE, - scoped_ptr<base::Value>(new base::FundamentalValue(42)).get(), - schema.get(), - NULL, - std::string(), - JSONSchemaValidator::FormatErrorMessage(JSONSchemaValidator::kInvalidType, - schema::kString, - schema::kInteger)); + ExpectNotValid(TEST_SOURCE, + scoped_ptr<base::Value>(new base::FundamentalValue(42)).get(), + schema.get(), NULL, "", + JSONSchemaValidator::FormatErrorMessage( + JSONSchemaValidator::kInvalidType, + schema::kString, + schema::kInteger)); schema->SetString(schema::kType, schema::kNumber); - ExpectNotValid( - TEST_SOURCE, - scoped_ptr<base::Value>(new base::StringValue("42")).get(), - schema.get(), - NULL, - std::string(), - JSONSchemaValidator::FormatErrorMessage( - JSONSchemaValidator::kInvalidType, schema::kNumber, schema::kString)); + ExpectNotValid(TEST_SOURCE, + scoped_ptr<base::Value>(new base::StringValue("42")).get(), + schema.get(), NULL, "", + JSONSchemaValidator::FormatErrorMessage( + JSONSchemaValidator::kInvalidType, + schema::kNumber, + schema::kString)); schema->SetString(schema::kType, schema::kInteger); - ExpectNotValid( - TEST_SOURCE, - scoped_ptr<base::Value>(new base::FundamentalValue(88.8)).get(), - schema.get(), - NULL, - std::string(), - JSONSchemaValidator::kInvalidTypeIntegerNumber); + ExpectNotValid(TEST_SOURCE, + scoped_ptr<base::Value>( + new base::FundamentalValue(88.8)).get(), + schema.get(), NULL, "", + JSONSchemaValidator::kInvalidTypeIntegerNumber); schema->SetString(schema::kType, schema::kBoolean); - ExpectNotValid( - TEST_SOURCE, - scoped_ptr<base::Value>(new base::FundamentalValue(1)).get(), - schema.get(), - NULL, - std::string(), - JSONSchemaValidator::FormatErrorMessage(JSONSchemaValidator::kInvalidType, - schema::kBoolean, - schema::kInteger)); + ExpectNotValid(TEST_SOURCE, + scoped_ptr<base::Value>(new base::FundamentalValue(1)).get(), + schema.get(), NULL, "", + JSONSchemaValidator::FormatErrorMessage( + JSONSchemaValidator::kInvalidType, + schema::kBoolean, + schema::kInteger)); schema->SetString(schema::kType, schema::kNull); - ExpectNotValid( - TEST_SOURCE, - scoped_ptr<base::Value>(new base::FundamentalValue(false)).get(), - schema.get(), - NULL, - std::string(), - JSONSchemaValidator::FormatErrorMessage( - JSONSchemaValidator::kInvalidType, schema::kNull, schema::kBoolean)); + ExpectNotValid(TEST_SOURCE, + scoped_ptr<base::Value>( + new base::FundamentalValue(false)).get(), + schema.get(), NULL, "", + JSONSchemaValidator::FormatErrorMessage( + JSONSchemaValidator::kInvalidType, + schema::kNull, + schema::kBoolean)); } diff --git a/chrome/common/metrics/entropy_provider_unittest.cc b/chrome/common/metrics/entropy_provider_unittest.cc index c3547ab..9881d7e 100644 --- a/chrome/common/metrics/entropy_provider_unittest.cc +++ b/chrome/common/metrics/entropy_provider_unittest.cc @@ -200,7 +200,7 @@ TEST_F(EntropyProviderTest, UseOneTimeRandomizationSHA1) { trials[i]->UseOneTimeRandomization(); for (int j = 0; j < 100; ++j) - trials[i]->AppendGroup(std::string(), 1); + trials[i]->AppendGroup("", 1); } // The trials are most likely to give different results since they have @@ -228,7 +228,7 @@ TEST_F(EntropyProviderTest, UseOneTimeRandomizationPermuted) { trials[i]->UseOneTimeRandomization(); for (int j = 0; j < 100; ++j) - trials[i]->AppendGroup(std::string(), 1); + trials[i]->AppendGroup("", 1); } // The trials are most likely to give different results since they have diff --git a/chrome/common/net/x509_certificate_model.cc b/chrome/common/net/x509_certificate_model.cc index e1f0847..950b4f2 100644 --- a/chrome/common/net/x509_certificate_model.cc +++ b/chrome/common/net/x509_certificate_model.cc @@ -61,7 +61,7 @@ std::string ProcessRawBytesWithSeparators(const unsigned char* data, size_t kMin = 0U; if (!data_length) - return std::string(); + return ""; ret.reserve(std::max(kMin, data_length * 3 - 1)); diff --git a/chrome/common/net/x509_certificate_model_nss.cc b/chrome/common/net/x509_certificate_model_nss.cc index 51e2642..5f40ce3 100644 --- a/chrome/common/net/x509_certificate_model_nss.cc +++ b/chrome/common/net/x509_certificate_model_nss.cc @@ -100,8 +100,8 @@ using net::X509Certificate; using std::string; string GetCertNameOrNickname(X509Certificate::OSCertHandle cert_handle) { - string name = ProcessIDN( - Stringize(CERT_GetCommonName(&cert_handle->subject), std::string())); + string name = ProcessIDN(Stringize(CERT_GetCommonName(&cert_handle->subject), + "")); if (!name.empty()) return name; return GetNickname(cert_handle); @@ -132,7 +132,7 @@ string GetVersion(X509Certificate::OSCertHandle cert_handle) { SEC_ASN1DecodeInteger(&cert_handle->version, &version) == SECSuccess) { return base::UintToString(version + 1); } - return std::string(); + return ""; } net::CertType GetType(X509Certificate::OSCertHandle cert_handle) { @@ -142,7 +142,7 @@ net::CertType GetType(X509Certificate::OSCertHandle cert_handle) { string GetEmailAddress(X509Certificate::OSCertHandle cert_handle) { if (cert_handle->emailAddr) return cert_handle->emailAddr; - return std::string(); + return ""; } void GetUsageStrings(X509Certificate::OSCertHandle cert_handle, @@ -346,14 +346,14 @@ string GetCMSString(const X509Certificate::OSCertHandles& cert_chain, message.get(), cert_chain[start], PR_FALSE)); if (!signed_data.get()) { DLOG(ERROR) << "NSS_CMSSignedData_Create failed"; - return std::string(); + return ""; } // Add the rest of the chain (if any). for (size_t i = start + 1; i < end; ++i) { if (NSS_CMSSignedData_AddCertificate(signed_data.get(), cert_chain[i]) != SECSuccess) { DLOG(ERROR) << "NSS_CMSSignedData_AddCertificate failed on " << i; - return std::string(); + return ""; } } @@ -363,7 +363,7 @@ string GetCMSString(const X509Certificate::OSCertHandles& cert_chain, ignore_result(signed_data.release()); } else { DLOG(ERROR) << "NSS_CMSMessage_GetContentInfo failed"; - return std::string(); + return ""; } SECItem cert_p7 = { siBuffer, NULL, 0 }; @@ -373,12 +373,12 @@ string GetCMSString(const X509Certificate::OSCertHandles& cert_chain, NULL); if (!ecx) { DLOG(ERROR) << "NSS_CMSEncoder_Start failed"; - return std::string(); + return ""; } if (NSS_CMSEncoder_Finish(ecx) != SECSuccess) { DLOG(ERROR) << "NSS_CMSEncoder_Finish failed"; - return std::string(); + return ""; } return string(reinterpret_cast<const char*>(cert_p7.data), cert_p7.len); diff --git a/chrome/common/pref_names_util_unittest.cc b/chrome/common/pref_names_util_unittest.cc index 9f215ea..2d1356a 100644 --- a/chrome/common/pref_names_util_unittest.cc +++ b/chrome/common/pref_names_util_unittest.cc @@ -28,7 +28,7 @@ void ExpectParse(const std::string& path, } // namespace TEST(PrefNamesUtilTest, Basic) { - ExpectNoParse(std::string()); + ExpectNoParse(""); ExpectNoParse("."); ExpectNoParse("....."); ExpectNoParse("webkit.webprefs.fonts."); @@ -43,8 +43,8 @@ TEST(PrefNamesUtilTest, Basic) { // We don't particularly care about the parsed family and script for these // inputs, but just want to make sure it does something reasonable. Returning // false may also be an option. - ExpectParse("webkit.webprefs.fonts...", std::string(), "."); - ExpectParse("webkit.webprefs.fonts....", std::string(), ".."); + ExpectParse("webkit.webprefs.fonts...", "", "."); + ExpectParse("webkit.webprefs.fonts....", "", ".."); // Check that passing NULL output params is okay. EXPECT_TRUE(pref_names_util::ParseFontNamePrefPath( diff --git a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc index 567c305..4a619f5 100644 --- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc +++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc @@ -251,7 +251,7 @@ TEST_F(PasswordAutofillAgentTest, NoInitialAutocompleteForReadOnly) { // Only the username should have been autocompleted. // TODO(jcivelli): may be we should not event fill the username? - CheckTextFieldsState(kAliceUsername, true, std::string(), false); + CheckTextFieldsState(kAliceUsername, true, "", false); } // Tests that having a non-matching username precludes the autocomplete. @@ -263,7 +263,7 @@ TEST_F(PasswordAutofillAgentTest, NoInitialAutocompleteForFilledField) { SimulateOnFillPasswordForm(fill_data_); // Neither field should be autocompleted. - CheckTextFieldsState("bogus", false, std::string(), false); + CheckTextFieldsState("bogus", false, "", false); } // Tests that having a matching username does not preclude the autocomplete. @@ -288,7 +288,7 @@ TEST_F(PasswordAutofillAgentTest, PasswordClearOnEdit) { SimulateUsernameChange("alicia", true); // The password should have been cleared. - CheckTextFieldsState("alicia", false, std::string(), false); + CheckTextFieldsState("alicia", false, "", false); } // Tests that we only autocomplete on focus lost and with a full username match @@ -299,27 +299,27 @@ TEST_F(PasswordAutofillAgentTest, WaitUsername) { SimulateOnFillPasswordForm(fill_data_); // No auto-fill should have taken place. - CheckTextFieldsState(std::string(), false, std::string(), false); + CheckTextFieldsState("", false, "", false); // No autocomplete should happen when text is entered in the username. SimulateUsernameChange("a", true); - CheckTextFieldsState("a", false, std::string(), false); + CheckTextFieldsState("a", false, "", false); SimulateUsernameChange("al", true); - CheckTextFieldsState("al", false, std::string(), false); + CheckTextFieldsState("al", false, "", false); SimulateUsernameChange(kAliceUsername, true); - CheckTextFieldsState(kAliceUsername, false, std::string(), false); + CheckTextFieldsState(kAliceUsername, false, "", false); // Autocomplete should happen only when the username textfield is blurred with // a full match. username_element_.setValue("a"); autofill_agent_->textFieldDidEndEditing(username_element_); - CheckTextFieldsState("a", false, std::string(), false); + CheckTextFieldsState("a", false, "", false); username_element_.setValue("al"); autofill_agent_->textFieldDidEndEditing(username_element_); - CheckTextFieldsState("al", false, std::string(), false); + CheckTextFieldsState("al", false, "", false); username_element_.setValue("alices"); autofill_agent_->textFieldDidEndEditing(username_element_); - CheckTextFieldsState("alices", false, std::string(), false); + CheckTextFieldsState("alices", false, "", false); username_element_.setValue(ASCIIToUTF16(kAliceUsername)); autofill_agent_->textFieldDidEndEditing(username_element_); CheckTextFieldsState(kAliceUsername, true, kAlicePassword, true); @@ -351,7 +351,7 @@ TEST_F(PasswordAutofillAgentTest, InlineAutocomplete) { // Test that deleting does not trigger autocomplete. SimulateKeyDownEvent(username_element_, ui::VKEY_BACK); SimulateUsernameChange("alic", true); - CheckTextFieldsState("alic", false, std::string(), false); + CheckTextFieldsState("alic", false, "", false); CheckUsernameSelection(4, 4); // No selection. // Reset the last pressed key to something other than backspace. SimulateKeyDownEvent(username_element_, ui::VKEY_A); @@ -361,7 +361,7 @@ TEST_F(PasswordAutofillAgentTest, InlineAutocomplete) { // practice the username should no longer be 'alice' and the selected range // should be empty. SimulateUsernameChange("alf", true); - CheckTextFieldsState("alf", false, std::string(), false); + CheckTextFieldsState("alf", false, "", false); CheckUsernameSelection(3, 3); // No selection. // Ok, so now the user removes all the text and enters the letter 'b'. @@ -379,7 +379,7 @@ TEST_F(PasswordAutofillAgentTest, InlineAutocomplete) { // want case-sensitive autocompletion, so the username and the selected range // should be empty. SimulateUsernameChange("c", true); - CheckTextFieldsState("c", false, std::string(), false); + CheckTextFieldsState("c", false, "", false); CheckUsernameSelection(1, 1); } @@ -419,7 +419,7 @@ TEST_F(PasswordAutofillAgentTest, SuggestionSelect) { WebKit::WebString(), 0); // Autocomplete should not have kicked in. - CheckTextFieldsState(std::string(), false, std::string(), false); + CheckTextFieldsState("", false, "", false); } } // namespace autofill diff --git a/chrome/renderer/automation/automation_renderer_helper_browsertest.cc b/chrome/renderer/automation/automation_renderer_helper_browsertest.cc index 65bd018..659d312 100644 --- a/chrome/renderer/automation/automation_renderer_helper_browsertest.cc +++ b/chrome/renderer/automation/automation_renderer_helper_browsertest.cc @@ -84,9 +84,9 @@ TEST_F(AutomationRendererHelperTest, RTLSnapshot) { } TEST_F(AutomationRendererHelperTest, ScriptChain) { - ScriptEvaluationRequest request("({'result': 10})", std::string()); - ScriptEvaluationRequest request_plus1("({'result': arguments[0].result + 1})", - std::string()); + ScriptEvaluationRequest request("({'result': 10})", ""); + ScriptEvaluationRequest request_plus1( + "({'result': arguments[0].result + 1})", ""); std::vector<ScriptEvaluationRequest> script_chain; script_chain.push_back(request); script_chain.push_back(request_plus1); @@ -102,10 +102,10 @@ TEST_F(AutomationRendererHelperTest, ScriptChain) { } TEST_F(AutomationRendererHelperTest, ScriptChainError) { - ScriptEvaluationRequest request("({'result': 10})", std::string()); + ScriptEvaluationRequest request("({'result': 10})", ""); ScriptEvaluationRequest error_request( "({'result': arguments[0].result + 1, 'error': {'msg': 'some msg'}})", - std::string()); + ""); std::vector<ScriptEvaluationRequest> script_chain; script_chain.push_back(request); script_chain.push_back(error_request); diff --git a/chrome/renderer/chrome_content_renderer_client_unittest.cc b/chrome/renderer/chrome_content_renderer_client_unittest.cc index 1387ff0..b099eea 100644 --- a/chrome/renderer/chrome_content_renderer_client_unittest.cc +++ b/chrome/renderer/chrome_content_renderer_client_unittest.cc @@ -96,8 +96,8 @@ scoped_refptr<const extensions::Extension> CreateTestExtension( scoped_refptr<const extensions::Extension> CreateExtension( bool is_unrestricted, bool is_from_webstore) { - return CreateTestExtension( - is_unrestricted, is_from_webstore, kNotHostedApp, std::string()); + return CreateTestExtension(is_unrestricted, is_from_webstore, kNotHostedApp, + ""); } scoped_refptr<const extensions::Extension> CreateHostedApp( diff --git a/chrome/renderer/content_settings_observer_browsertest.cc b/chrome/renderer/content_settings_observer_browsertest.cc index 8397c94..f4777d2 100644 --- a/chrome/renderer/content_settings_observer_browsertest.cc +++ b/chrome/renderer/content_settings_observer_browsertest.cc @@ -110,11 +110,12 @@ TEST_F(ChromeRenderViewTest, JSBlockSentAfterPageLoad) { ContentSettingsForOneType& script_setting_rules = content_setting_rules.script_rules; script_setting_rules.push_back( - ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_BLOCK, - std::string(), - false)); + ContentSettingPatternSource( + ContentSettingsPattern::Wildcard(), + ContentSettingsPattern::Wildcard(), + CONTENT_SETTING_BLOCK, + "", + false)); ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_); observer->SetContentSettingRules(&content_setting_rules); @@ -192,7 +193,7 @@ TEST_F(ChromeRenderViewTest, ImagesBlockedByDefault) { ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), CONTENT_SETTING_BLOCK, - std::string(), + "", false)); ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_); @@ -210,7 +211,7 @@ TEST_F(ChromeRenderViewTest, ImagesBlockedByDefault) { ContentSettingsPattern::Wildcard(), ContentSettingsPattern::FromString(mock_observer.image_origin_), CONTENT_SETTING_ALLOW, - std::string(), + "", false)); EXPECT_CALL( @@ -235,7 +236,7 @@ TEST_F(ChromeRenderViewTest, ImagesAllowedByDefault) { ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(), CONTENT_SETTING_ALLOW, - std::string(), + "", false)); ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_); @@ -254,7 +255,7 @@ TEST_F(ChromeRenderViewTest, ImagesAllowedByDefault) { ContentSettingsPattern::Wildcard(), ContentSettingsPattern::FromString(mock_observer.image_origin_), CONTENT_SETTING_BLOCK, - std::string(), + "", false)); EXPECT_CALL(mock_observer, OnContentBlocked(CONTENT_SETTINGS_TYPE_IMAGES, std::string())); @@ -269,11 +270,12 @@ TEST_F(ChromeRenderViewTest, ContentSettingsBlockScripts) { ContentSettingsForOneType& script_setting_rules = content_setting_rules.script_rules; script_setting_rules.push_back( - ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_BLOCK, - std::string(), - false)); + ContentSettingPatternSource( + ContentSettingsPattern::Wildcard(), + ContentSettingsPattern::Wildcard(), + CONTENT_SETTING_BLOCK, + "", + false)); ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_); observer->SetContentSettingRules(&content_setting_rules); @@ -304,11 +306,12 @@ TEST_F(ChromeRenderViewTest, ContentSettingsAllowScripts) { ContentSettingsForOneType& script_setting_rules = content_setting_rules.script_rules; script_setting_rules.push_back( - ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_ALLOW, - std::string(), - false)); + ContentSettingPatternSource( + ContentSettingsPattern::Wildcard(), + ContentSettingsPattern::Wildcard(), + CONTENT_SETTING_ALLOW, + "", + false)); ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_); observer->SetContentSettingRules(&content_setting_rules); @@ -340,20 +343,18 @@ TEST_F(ChromeRenderViewTest, ContentSettingsInterstitialPages) { ContentSettingsForOneType& script_setting_rules = content_setting_rules.script_rules; script_setting_rules.push_back( - ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_BLOCK, - std::string(), - false)); + ContentSettingPatternSource( + ContentSettingsPattern::Wildcard(), + ContentSettingsPattern::Wildcard(), + CONTENT_SETTING_BLOCK, "", false)); // Block images. ContentSettingsForOneType& image_setting_rules = content_setting_rules.image_rules; image_setting_rules.push_back( - ContentSettingPatternSource(ContentSettingsPattern::Wildcard(), - ContentSettingsPattern::Wildcard(), - CONTENT_SETTING_BLOCK, - std::string(), - false)); + ContentSettingPatternSource( + ContentSettingsPattern::Wildcard(), + ContentSettingsPattern::Wildcard(), + CONTENT_SETTING_BLOCK, "", false)); ContentSettingsObserver* observer = ContentSettingsObserver::Get(view_); observer->SetContentSettingRules(&content_setting_rules); diff --git a/chrome/renderer/extensions/chrome_v8_context.cc b/chrome/renderer/extensions/chrome_v8_context.cc index 5feff00..b4ae80e 100644 --- a/chrome/renderer/extensions/chrome_v8_context.cc +++ b/chrome/renderer/extensions/chrome_v8_context.cc @@ -63,7 +63,7 @@ void ChromeV8Context::Invalidate() { } std::string ChromeV8Context::GetExtensionID() { - return extension_ ? extension_->id() : std::string(); + return extension_ ? extension_->id() : ""; } // static @@ -187,7 +187,7 @@ std::string ChromeV8Context::GetContextTypeDescription() { case Feature::WEB_PAGE_CONTEXT: return "WEB_PAGE"; } NOTREACHED(); - return std::string(); + return ""; } ChromeV8Context* ChromeV8Context::GetContext() { diff --git a/chrome/renderer/extensions/extension_helper.cc b/chrome/renderer/extensions/extension_helper.cc index ac456a8..a488cb7 100644 --- a/chrome/renderer/extensions/extension_helper.cc +++ b/chrome/renderer/extensions/extension_helper.cc @@ -313,12 +313,8 @@ void ExtensionHelper::OnExecuteCode( WebFrame* main_frame = webview->mainFrame(); if (!main_frame) { ListValue val; - Send(new ExtensionHostMsg_ExecuteCodeFinished(routing_id(), - params.request_id, - "No main frame", - -1, - GURL(std::string()), - val)); + Send(new ExtensionHostMsg_ExecuteCodeFinished( + routing_id(), params.request_id, "No main frame", -1, GURL(""), val)); return; } diff --git a/chrome/renderer/extensions/resource_request_policy.cc b/chrome/renderer/extensions/resource_request_policy.cc index 83ccb3f..116b218 100644 --- a/chrome/renderer/extensions/resource_request_policy.cc +++ b/chrome/renderer/extensions/resource_request_policy.cc @@ -51,8 +51,7 @@ bool ResourceRequestPolicy::CanRequestResource( // some extensions want to be able to do things like create their own // launchers. std::string resource_root_relative_path = - resource_url.path().empty() ? std::string() - : resource_url.path().substr(1); + resource_url.path().empty() ? "" : resource_url.path().substr(1); if (extension->is_hosted_app() && !IconsInfo::GetIcons(extension) .ContainsPath(resource_root_relative_path)) { diff --git a/chrome/renderer/extensions/user_script_scheduler.cc b/chrome/renderer/extensions/user_script_scheduler.cc index f194a23..3cb01ba 100644 --- a/chrome/renderer/extensions/user_script_scheduler.cc +++ b/chrome/renderer/extensions/user_script_scheduler.cc @@ -147,13 +147,13 @@ void UserScriptScheduler::ExecuteCodeImpl( // Since extension info is sent separately from user script info, they can // be out of sync. We just ignore this situation. if (!extension) { - render_view->Send( - new ExtensionHostMsg_ExecuteCodeFinished(render_view->GetRoutingID(), - params.request_id, - std::string(), // no error - -1, - GURL(std::string()), - execution_results)); + render_view->Send(new ExtensionHostMsg_ExecuteCodeFinished( + render_view->GetRoutingID(), + params.request_id, + "", // no error + -1, + GURL(""), + execution_results)); return; } diff --git a/chrome/renderer/extensions/user_script_slave.cc b/chrome/renderer/extensions/user_script_slave.cc index 3e64b7d..f715207 100644 --- a/chrome/renderer/extensions/user_script_slave.cc +++ b/chrome/renderer/extensions/user_script_slave.cc @@ -92,7 +92,7 @@ std::string UserScriptSlave::GetExtensionIdForIsolatedWorld( if (iter->second == isolated_world_id) return iter->first; } - return std::string(); + return ""; } // static diff --git a/chrome/renderer/plugins/plugin_uma_unittest.cc b/chrome/renderer/plugins/plugin_uma_unittest.cc index 3b1950c..99e6271 100644 --- a/chrome/renderer/plugins/plugin_uma_unittest.cc +++ b/chrome/renderer/plugins/plugin_uma_unittest.cc @@ -118,8 +118,9 @@ TEST_F(PluginUMATest, WidevineCdm) { } TEST_F(PluginUMATest, BySrcExtension) { - ExpectPluginType( - PluginUMAReporter::QUICKTIME, std::string(), GURL("file://file.mov")); + ExpectPluginType(PluginUMAReporter::QUICKTIME, + "", + GURL("file://file.mov")); // When plugin's mime type is given, we don't check extension. ExpectPluginType(PluginUMAReporter::UNSUPPORTED_MIMETYPE, @@ -127,36 +128,40 @@ TEST_F(PluginUMATest, BySrcExtension) { GURL("http://file.mov")); ExpectPluginType(PluginUMAReporter::WINDOWS_MEDIA_PLAYER, - std::string(), + "", GURL("file://file.asx")); - ExpectPluginType( - PluginUMAReporter::REALPLAYER, std::string(), GURL("file://file.rm")); + ExpectPluginType(PluginUMAReporter::REALPLAYER, + "", + GURL("file://file.rm")); ExpectPluginType(PluginUMAReporter::QUICKTIME, - std::string(), + "", GURL("http://aaa/file.mov?x=aaaa&y=b#c")); ExpectPluginType(PluginUMAReporter::QUICKTIME, - std::string(), + "", GURL("http://file.mov?x=aaaa&y=b#c")); ExpectPluginType(PluginUMAReporter::SHOCKWAVE_FLASH, - std::string(), + "", GURL("http://file.swf?x=aaaa&y=b#c")); ExpectPluginType(PluginUMAReporter::SHOCKWAVE_FLASH, - std::string(), + "", GURL("http://file.spl?x=aaaa&y=b#c")); ExpectPluginType(PluginUMAReporter::UNSUPPORTED_EXTENSION, - std::string(), + "", GURL("http://file.unknown_extension")); - ExpectPluginType( - PluginUMAReporter::UNSUPPORTED_EXTENSION, std::string(), GURL("http://")); - ExpectPluginType( - PluginUMAReporter::UNSUPPORTED_EXTENSION, std::string(), GURL("mov")); + ExpectPluginType(PluginUMAReporter::UNSUPPORTED_EXTENSION, + "", + GURL("http://")); + ExpectPluginType(PluginUMAReporter::UNSUPPORTED_EXTENSION, + "", + GURL("mov")); } TEST_F(PluginUMATest, CaseSensitivity) { ExpectPluginType(PluginUMAReporter::QUICKTIME, "video/QUICKTIME", GURL("http://file.aaa")); - ExpectPluginType( - PluginUMAReporter::QUICKTIME, std::string(), GURL("http://file.MoV")); + ExpectPluginType(PluginUMAReporter::QUICKTIME, + "", + GURL("http://file.MoV")); } diff --git a/chrome/renderer/safe_browsing/malware_dom_details_browsertest.cc b/chrome/renderer/safe_browsing/malware_dom_details_browsertest.cc index 8a120cb..034655f 100644 --- a/chrome/renderer/safe_browsing/malware_dom_details_browsertest.cc +++ b/chrome/renderer/safe_browsing/malware_dom_details_browsertest.cc @@ -97,7 +97,7 @@ TEST_F(MalwareDOMDetailsTest, Everything) { } { // >50 subframes, to verify kMaxNodes. - std::string html; + std::string html = ""; for (int i = 0; i < 55; ++i) { // The iframe contents is just a number. GURL iframe_url(base::StringPrintf("%s%d", urlprefix, i)); @@ -113,7 +113,7 @@ TEST_F(MalwareDOMDetailsTest, Everything) { } { // A page with >50 scripts, to verify kMaxNodes. - std::string html; + std::string html = ""; for (int i = 0; i < 55; ++i) { // The iframe contents is just a number. GURL script_url(base::StringPrintf("%s%d", urlprefix, i)); diff --git a/chrome/service/cloud_print/cloud_print_proxy.cc b/chrome/service/cloud_print/cloud_print_proxy.cc index 12eee70..a65da81 100644 --- a/chrome/service/cloud_print/cloud_print_proxy.cc +++ b/chrome/service/cloud_print/cloud_print_proxy.cc @@ -85,10 +85,10 @@ void CloudPrintProxy::EnableForUser(const std::string& lsid) { DCHECK(backend_.get()); // Read persisted robot credentials because we may decide to reuse it if the // passed in LSID belongs the same user. - std::string robot_refresh_token = service_prefs_->GetString( - prefs::kCloudPrintRobotRefreshToken, std::string()); + std::string robot_refresh_token = + service_prefs_->GetString(prefs::kCloudPrintRobotRefreshToken, ""); std::string robot_email = - service_prefs_->GetString(prefs::kCloudPrintRobotEmail, std::string()); + service_prefs_->GetString(prefs::kCloudPrintRobotEmail, ""); user_email_ = service_prefs_->GetString(prefs::kCloudPrintEmail, user_email_); // If we have been passed in an LSID, we want to use this to authenticate. @@ -104,7 +104,7 @@ void CloudPrintProxy::EnableForUser(const std::string& lsid) { } else { // Finally see if we have persisted user credentials (legacy case). std::string cloud_print_token = - service_prefs_->GetString(prefs::kCloudPrintAuthToken, std::string()); + service_prefs_->GetString(prefs::kCloudPrintAuthToken, ""); DCHECK(!cloud_print_token.empty()); backend_->InitializeWithToken(cloud_print_token); } @@ -124,7 +124,7 @@ void CloudPrintProxy::EnableForUserWithRobot( ShutdownBackend(); std::string proxy_id( - service_prefs_->GetString(prefs::kCloudPrintProxyId, std::string())); + service_prefs_->GetString(prefs::kCloudPrintProxyId, "")); service_prefs_->RemovePref(prefs::kCloudPrintRoot); if (!proxy_id.empty()) { // Keep only proxy id; @@ -204,8 +204,7 @@ void CloudPrintProxy::GetProxyInfo(CloudPrintProxyInfo* info) { // If the Cloud Print service is not enabled, we may need to read the old // value of proxy_id from prefs. if (info->proxy_id.empty()) - info->proxy_id = - service_prefs_->GetString(prefs::kCloudPrintProxyId, std::string()); + info->proxy_id = service_prefs_->GetString(prefs::kCloudPrintProxyId, ""); } void CloudPrintProxy::CheckCloudPrintProxyPolicy() { diff --git a/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc b/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc index a86d24c..343eaa8 100644 --- a/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc +++ b/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc @@ -217,9 +217,9 @@ void CloudPrintURLFetcherTest::CreateFetcher(const GURL& url, int max_retries) { // Registers an entry for test url. It only allows 3 requests to be sent // in 200 milliseconds. - scoped_refptr<net::URLRequestThrottlerEntry> - entry(new net::URLRequestThrottlerEntry( - fetcher_->throttler_manager(), std::string(), 200, 3, 1, 2.0, 0.0, 256)); + scoped_refptr<net::URLRequestThrottlerEntry> entry( + new net::URLRequestThrottlerEntry( + fetcher_->throttler_manager(), "", 200, 3, 1, 2.0, 0.0, 256)); fetcher_->throttler_manager()->OverrideEntryForTests(url, entry); max_retries_ = max_retries; diff --git a/chrome/service/cloud_print/connector_settings.cc b/chrome/service/cloud_print/connector_settings.cc index 1e9b761..2b43b15 100644 --- a/chrome/service/cloud_print/connector_settings.cc +++ b/chrome/service/cloud_print/connector_settings.cc @@ -32,7 +32,7 @@ ConnectorSettings::~ConnectorSettings() { void ConnectorSettings::InitFrom(ServiceProcessPrefs* prefs) { CopyFrom(ConnectorSettings()); - proxy_id_ = prefs->GetString(prefs::kCloudPrintProxyId, std::string()); + proxy_id_ = prefs->GetString(prefs::kCloudPrintProxyId, ""); if (proxy_id_.empty()) { proxy_id_ = PrintSystem::GenerateProxyId(); prefs->SetString(prefs::kCloudPrintProxyId, proxy_id_); @@ -51,8 +51,7 @@ void ConnectorSettings::InitFrom(ServiceProcessPrefs* prefs) { } // Check if there is an override for the cloud print server URL. - server_url_ = - GURL(prefs->GetString(prefs::kCloudPrintServiceURL, std::string())); + server_url_ = GURL(prefs->GetString(prefs::kCloudPrintServiceURL, "")); DCHECK(server_url_.is_empty() || server_url_.is_valid()); if (server_url_.is_empty() || !server_url_.is_valid()) { server_url_ = GURL(kDefaultCloudPrintServerUrl); diff --git a/chrome/service/cloud_print/printer_job_handler_unittest.cc b/chrome/service/cloud_print/printer_job_handler_unittest.cc index 0576bb0..9e19519 100644 --- a/chrome/service/cloud_print/printer_job_handler_unittest.cc +++ b/chrome/service/cloud_print/printer_job_handler_unittest.cc @@ -194,7 +194,7 @@ const char kExamplePrinterDescription[] = "Example Description"; // These are functions used to construct the various sample strings. std::string JobListResponse(int num_jobs) { - std::string job_objects; + std::string job_objects = ""; for (int i = 0; i < num_jobs; i++) { job_objects = job_objects + StringPrintf(kExampleJobObject, i+1, i+1, i+1, i+1); @@ -683,7 +683,7 @@ TEST_F(PrinterJobHandlerTest, TicketDownloadFailureTest) { JobListResponse(2), true); factory_.SetFakeResponse(JobListURI(kJobFetchReasonQueryMore), JobListResponse(0), true); - factory_.SetFakeResponse(TicketURI(1), std::string(), false); + factory_.SetFakeResponse(TicketURI(1), "", false); EXPECT_CALL(url_callback_, OnRequestCreate(GURL(TicketURI(1)), _)) .Times(AtLeast(1)); @@ -734,7 +734,7 @@ TEST_F(PrinterJobHandlerTest, DISABLED_ManyFailureTest) { SetUpJobSuccessTest(1); - factory_.SetFakeResponse(TicketURI(1), std::string(), false); + factory_.SetFakeResponse(TicketURI(1), "", false); loop_.PostDelayedTask(FROM_HERE, base::Bind(&net::FakeURLFetcherFactory::SetFakeResponse, @@ -759,7 +759,7 @@ TEST_F(PrinterJobHandlerTest, DISABLED_CompleteFailureTest) { factory_.SetFakeResponse(JobListURI(kJobFetchReasonRetry), JobListResponse(1), true); factory_.SetFakeResponse(ErrorURI(1), StatusResponse(1, "ERROR"), true); - factory_.SetFakeResponse(TicketURI(1), std::string(), false); + factory_.SetFakeResponse(TicketURI(1), "", false); EXPECT_CALL(url_callback_, OnRequestCreate(GURL(JobListURI(kJobFetchReasonStartup)), _)) diff --git a/chrome/service/cloud_print/printer_job_queue_handler_unittest.cc b/chrome/service/cloud_print/printer_job_queue_handler_unittest.cc index b29f5a4..05532b9 100644 --- a/chrome/service/cloud_print/printer_job_queue_handler_unittest.cc +++ b/chrome/service/cloud_print/printer_job_queue_handler_unittest.cc @@ -81,7 +81,7 @@ TEST_F(PrinterJobQueueHandlerTest, BasicJobReadTest) { std::set<std::string> expected_tags; expected_tags.insert("^own"); - expected_tags.insert(std::string()); + expected_tags.insert(""); std::set<std::string> actual_tags; actual_tags.insert(jobs[0].tags_.begin(), jobs[0].tags_.end()); diff --git a/chrome/service/service_process.cc b/chrome/service/service_process.cc index 32d5cc2..2cae376 100644 --- a/chrome/service/service_process.cc +++ b/chrome/service/service_process.cc @@ -175,8 +175,7 @@ bool ServiceProcess::Initialize(MessageLoopForUI* message_loop, } else { // If no command-line value was specified, read the last used locale from // the prefs. - locale = - service_prefs_->GetString(prefs::kApplicationLocale, std::string()); + locale = service_prefs_->GetString(prefs::kApplicationLocale, ""); // If no locale was specified anywhere, use the default one. if (locale.empty()) locale = kDefaultServiceProcessLocale; diff --git a/chrome/service/service_process_prefs_unittest.cc b/chrome/service/service_process_prefs_unittest.cc index 3d7ae1f..5d68ab3 100644 --- a/chrome/service/service_process_prefs_unittest.cc +++ b/chrome/service/service_process_prefs_unittest.cc @@ -39,8 +39,9 @@ TEST_F(ServiceProcessPrefsTest, RetrievePrefs) { prefs_->WritePrefs(); message_loop_.RunUntilIdle(); prefs_->SetBoolean("testb", false); // overwrite - prefs_->SetString("tests", std::string()); // overwrite + prefs_->SetString("tests", ""); // overwrite prefs_->ReadPrefs(); EXPECT_EQ(prefs_->GetBoolean("testb", false), true); - EXPECT_EQ(prefs_->GetString("tests", std::string()), "testvalue"); + EXPECT_EQ(prefs_->GetString("tests", ""), "testvalue"); } + diff --git a/chrome/test/base/ui_test_utils.cc b/chrome/test/base/ui_test_utils.cc index fbf366d..f3b91f6 100644 --- a/chrome/test/base/ui_test_utils.cc +++ b/chrome/test/base/ui_test_utils.cc @@ -187,7 +187,7 @@ bool GetCurrentTabTitle(const Browser* browser, string16* title) { NavigationEntry* last_entry = web_contents->GetController().GetActiveEntry(); if (!last_entry) return false; - title->assign(last_entry->GetTitleForDisplay(std::string())); + title->assign(last_entry->GetTitleForDisplay("")); return true; } diff --git a/chrome/test/chromedriver/capabilities_unittest.cc b/chrome/test/chromedriver/capabilities_unittest.cc index 9bf6c32..f6ac5ec 100644 --- a/chrome/test/chromedriver/capabilities_unittest.cc +++ b/chrome/test/chromedriver/capabilities_unittest.cc @@ -21,7 +21,7 @@ TEST(ParseCapabilities, WithAndroidPackage) { TEST(ParseCapabilities, EmptyAndroidPackage) { Capabilities capabilities; base::DictionaryValue caps; - caps.SetString("chromeOptions.android_package", std::string()); + caps.SetString("chromeOptions.android_package", ""); Status status = capabilities.Parse(caps); ASSERT_FALSE(status.IsOk()); } diff --git a/chrome/test/chromedriver/chrome/automation_extension.cc b/chrome/test/chromedriver/chrome/automation_extension.cc index 63ad223..0a91cf5 100644 --- a/chrome/test/chromedriver/chrome/automation_extension.cc +++ b/chrome/test/chromedriver/chrome/automation_extension.cc @@ -52,11 +52,8 @@ Status AutomationExtension::GetWindowInfo(int* x, int* height) { base::ListValue args; scoped_ptr<base::Value> result; - Status status = web_view_->CallAsyncFunction(std::string(), - "getWindowInfo", - args, - base::TimeDelta::FromSeconds(10), - &result); + Status status = web_view_->CallAsyncFunction( + "", "getWindowInfo", args, base::TimeDelta::FromSeconds(10), &result); if (status.IsError()) return status; @@ -81,9 +78,6 @@ Status AutomationExtension::UpdateWindow( base::ListValue args; args.Append(update_info.DeepCopy()); scoped_ptr<base::Value> result; - return web_view_->CallAsyncFunction(std::string(), - "updateWindow", - args, - base::TimeDelta::FromSeconds(10), - &result); + return web_view_->CallAsyncFunction( + "", "updateWindow", args, base::TimeDelta::FromSeconds(10), &result); } diff --git a/chrome/test/chromedriver/chrome/chrome_desktop_impl.cc b/chrome/test/chromedriver/chrome/chrome_desktop_impl.cc index 49dfad2..bee5bd2 100644 --- a/chrome/test/chromedriver/chrome/chrome_desktop_impl.cc +++ b/chrome/test/chromedriver/chrome/chrome_desktop_impl.cc @@ -67,7 +67,7 @@ Status ChromeDesktopImpl::GetAutomationExtension( return status; // Wait for the extension background page to load. - status = web_view->WaitForPendingNavigations(std::string()); + status = web_view->WaitForPendingNavigations(""); if (status.IsError()) return status; diff --git a/chrome/test/chromedriver/chrome/devtools_http_client.cc b/chrome/test/chromedriver/chrome/devtools_http_client.cc index 3cfcdae..c0fc841 100644 --- a/chrome/test/chromedriver/chrome/devtools_http_client.cc +++ b/chrome/test/chromedriver/chrome/devtools_http_client.cc @@ -169,8 +169,7 @@ Status DevToolsHttpClient::CloseFrontends(const std::string& for_client_id) { scoped_ptr<base::Value> result; status = web_view->EvaluateScript( - std::string(), - "document.querySelector('*[id^=\"close-button-\"').click();", + "", "document.querySelector('*[id^=\"close-button-\"').click();", &result); // Ignore disconnected error, because it may be closed already. if (status.IsError() && status.code() != kDisconnected) diff --git a/chrome/test/chromedriver/chrome/devtools_http_client_unittest.cc b/chrome/test/chromedriver/chrome/devtools_http_client_unittest.cc index c92abb8..eff9b3f 100644 --- a/chrome/test/chromedriver/chrome/devtools_http_client_unittest.cc +++ b/chrome/test/chromedriver/chrome/devtools_http_client_unittest.cc @@ -64,7 +64,8 @@ TEST(ParseWebViewsInfo, WithoutDebuggerUrl) { ASSERT_TRUE(status.IsOk()); ASSERT_EQ(1u, views_info.GetSize()); ExpectEqual( - WebViewInfo("1", std::string(), "http://page1", WebViewInfo::kPage), + WebViewInfo( + "1", "", "http://page1", WebViewInfo::kPage), views_info.Get(0)); } diff --git a/chrome/test/chromedriver/chrome/javascript_dialog_manager_unittest.cc b/chrome/test/chromedriver/chrome/javascript_dialog_manager_unittest.cc index 1333090..fcc3dce 100644 --- a/chrome/test/chromedriver/chrome/javascript_dialog_manager_unittest.cc +++ b/chrome/test/chromedriver/chrome/javascript_dialog_manager_unittest.cc @@ -19,7 +19,7 @@ TEST(JavaScriptDialogManager, NoDialog) { ASSERT_EQ(kNoAlertOpen, manager.GetDialogMessage(&message).code()); ASSERT_FALSE(manager.IsDialogOpen()); ASSERT_STREQ("HI", message.c_str()); - ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, std::string()).code()); + ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, "").code()); } namespace { @@ -73,7 +73,7 @@ TEST(JavaScriptDialogManager, ReconnectClearsStateAndSendsEnable) { ASSERT_EQ("Page.enable", client.method_); ASSERT_FALSE(manager.IsDialogOpen()); ASSERT_EQ(kNoAlertOpen, manager.GetDialogMessage(&message).code()); - ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, std::string()).code()); + ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, "").code()); } namespace { @@ -125,10 +125,10 @@ TEST(JavaScriptDialogManager, OneDialog) { ASSERT_EQ("hi", message); client.set_closing_count(1); - ASSERT_EQ(kOk, manager.HandleDialog(false, std::string()).code()); + ASSERT_EQ(kOk, manager.HandleDialog(false, "").code()); ASSERT_FALSE(manager.IsDialogOpen()); ASSERT_EQ(kNoAlertOpen, manager.GetDialogMessage(&message).code()); - ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, std::string()).code()); + ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, "").code()); } TEST(JavaScriptDialogManager, TwoDialogs) { @@ -145,16 +145,16 @@ TEST(JavaScriptDialogManager, TwoDialogs) { ASSERT_TRUE(manager.IsDialogOpen()); ASSERT_EQ("1", message); - ASSERT_EQ(kOk, manager.HandleDialog(false, std::string()).code()); + ASSERT_EQ(kOk, manager.HandleDialog(false, "").code()); ASSERT_TRUE(manager.IsDialogOpen()); ASSERT_EQ(kOk, manager.GetDialogMessage(&message).code()); ASSERT_EQ("2", message); client.set_closing_count(2); - ASSERT_EQ(kOk, manager.HandleDialog(false, std::string()).code()); + ASSERT_EQ(kOk, manager.HandleDialog(false, "").code()); ASSERT_FALSE(manager.IsDialogOpen()); ASSERT_EQ(kNoAlertOpen, manager.GetDialogMessage(&message).code()); - ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, std::string()).code()); + ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, "").code()); } TEST(JavaScriptDialogManager, OneDialogManualClose) { @@ -174,5 +174,5 @@ TEST(JavaScriptDialogManager, OneDialogManualClose) { manager.OnEvent("Page.javascriptDialogClosing", params); ASSERT_FALSE(manager.IsDialogOpen()); ASSERT_EQ(kNoAlertOpen, manager.GetDialogMessage(&message).code()); - ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, std::string()).code()); + ASSERT_EQ(kNoAlertOpen, manager.HandleDialog(false, "").code()); } diff --git a/chrome/test/chromedriver/chrome/navigation_tracker_unittest.cc b/chrome/test/chromedriver/chrome/navigation_tracker_unittest.cc index 19a78ef3..79cc0f6 100644 --- a/chrome/test/chromedriver/chrome/navigation_tracker_unittest.cc +++ b/chrome/test/chromedriver/chrome/navigation_tracker_unittest.cc @@ -173,7 +173,7 @@ class DeterminingLoadStateDevToolsClient : public StubDevToolsClient { TEST(NavigationTracker, UnknownStateForcesStart) { base::DictionaryValue params; - DeterminingLoadStateDevToolsClient client(true, std::string(), ¶ms); + DeterminingLoadStateDevToolsClient client(true, "", ¶ms); NavigationTracker tracker(&client); ASSERT_NO_FATAL_FAILURE(AssertPendingState(&tracker, "f", true)); } diff --git a/chrome/test/chromedriver/chrome/stub_chrome.cc b/chrome/test/chromedriver/chrome/stub_chrome.cc index d990d4e..39888a8 100644 --- a/chrome/test/chromedriver/chrome/stub_chrome.cc +++ b/chrome/test/chromedriver/chrome/stub_chrome.cc @@ -11,7 +11,7 @@ StubChrome::StubChrome() {} StubChrome::~StubChrome() {} std::string StubChrome::GetVersion() { - return std::string(); + return ""; } int StubChrome::GetBuildNo() { @@ -49,7 +49,7 @@ Status StubChrome::GetAutomationExtension(AutomationExtension** extension) { } std::string StubChrome::GetOperatingSystemName() { - return std::string(); + return ""; } Status StubChrome::Quit() { diff --git a/chrome/test/chromedriver/chrome/web_view_impl_unittest.cc b/chrome/test/chromedriver/chrome/web_view_impl_unittest.cc index ecdc85b..37e3284 100644 --- a/chrome/test/chromedriver/chrome/web_view_impl_unittest.cc +++ b/chrome/test/chromedriver/chrome/web_view_impl_unittest.cc @@ -60,8 +60,8 @@ void AssertEvalFails(const base::DictionaryValue& command_result) { scoped_ptr<base::DictionaryValue> result; FakeDevToolsClient client; client.set_result(command_result); - Status status = internal::EvaluateScript( - &client, 0, std::string(), internal::ReturnByValue, &result); + Status status = internal::EvaluateScript(&client, 0, "", + internal::ReturnByValue, &result); ASSERT_EQ(kUnknownError, status.code()); ASSERT_FALSE(result); } @@ -72,8 +72,8 @@ TEST(EvaluateScript, CommandError) { scoped_ptr<base::DictionaryValue> result; FakeDevToolsClient client; client.set_status(Status(kUnknownError)); - Status status = internal::EvaluateScript( - &client, 0, std::string(), internal::ReturnByValue, &result); + Status status = internal::EvaluateScript(&client, 0, "", + internal::ReturnByValue, &result); ASSERT_EQ(kUnknownError, status.code()); ASSERT_FALSE(result); } @@ -104,7 +104,7 @@ TEST(EvaluateScript, Ok) { FakeDevToolsClient client; client.set_result(dict); ASSERT_TRUE(internal::EvaluateScript( - &client, 0, std::string(), internal::ReturnByValue, &result).IsOk()); + &client, 0, "", internal::ReturnByValue, &result).IsOk()); ASSERT_TRUE(result); ASSERT_TRUE(result->HasKey("key")); } @@ -117,7 +117,7 @@ TEST(EvaluateScriptAndGetValue, MissingType) { dict.SetInteger("result.value", 1); client.set_result(dict); ASSERT_TRUE(internal::EvaluateScriptAndGetValue( - &client, 0, std::string(), &result).IsError()); + &client, 0, "", &result).IsError()); } TEST(EvaluateScriptAndGetValue, Undefined) { @@ -127,8 +127,8 @@ TEST(EvaluateScriptAndGetValue, Undefined) { dict.SetBoolean("wasThrown", false); dict.SetString("result.type", "undefined"); client.set_result(dict); - Status status = - internal::EvaluateScriptAndGetValue(&client, 0, std::string(), &result); + Status status = internal::EvaluateScriptAndGetValue( + &client, 0, "", &result); ASSERT_EQ(kOk, status.code()); ASSERT_TRUE(result && result->IsType(base::Value::TYPE_NULL)); } @@ -141,8 +141,8 @@ TEST(EvaluateScriptAndGetValue, Ok) { dict.SetString("result.type", "integer"); dict.SetInteger("result.value", 1); client.set_result(dict); - Status status = - internal::EvaluateScriptAndGetValue(&client, 0, std::string(), &result); + Status status = internal::EvaluateScriptAndGetValue( + &client, 0, "", &result); ASSERT_EQ(kOk, status.code()); int value; ASSERT_TRUE(result && result->GetAsInteger(&value)); @@ -158,7 +158,7 @@ TEST(EvaluateScriptAndGetObject, NoObject) { bool got_object; std::string object_id; ASSERT_TRUE(internal::EvaluateScriptAndGetObject( - &client, 0, std::string(), &got_object, &object_id).IsOk()); + &client, 0, "", &got_object, &object_id).IsOk()); ASSERT_FALSE(got_object); ASSERT_TRUE(object_id.empty()); } @@ -172,7 +172,7 @@ TEST(EvaluateScriptAndGetObject, Ok) { bool got_object; std::string object_id; ASSERT_TRUE(internal::EvaluateScriptAndGetObject( - &client, 0, std::string(), &got_object, &object_id).IsOk()); + &client, 0, "", &got_object, &object_id).IsOk()); ASSERT_TRUE(got_object); ASSERT_STREQ("id", object_id.c_str()); } diff --git a/chrome/test/chromedriver/chromedriver.cc b/chrome/test/chromedriver/chromedriver.cc index 8f7ddce0..40e48fc 100644 --- a/chrome/test/chromedriver/chromedriver.cc +++ b/chrome/test/chromedriver/chromedriver.cc @@ -36,7 +36,7 @@ void SetError(const std::string& error_msg, std::string* response) { base::DictionaryValue value; value.SetString("message", error_msg); - SetResponse(kUnknownError, &value, std::string(), response); + SetResponse(kUnknownError, &value, "", response); } } // namespace @@ -120,6 +120,6 @@ void Shutdown() { scoped_ptr<base::Value> value; std::string session_id; g_command_executor->ExecuteCommand( - "quitAll", params, std::string(), &status_code, &value, &session_id); + "quitAll", params, "", &status_code, &value, &session_id); delete g_command_executor; } diff --git a/chrome/test/chromedriver/chromedriver_unittest.cc b/chrome/test/chromedriver/chromedriver_unittest.cc index 9e585e3..91e1e06 100644 --- a/chrome/test/chromedriver/chromedriver_unittest.cc +++ b/chrome/test/chromedriver/chromedriver_unittest.cc @@ -164,7 +164,7 @@ TEST(ChromeDriver, ExecuteCommand) { base::DictionaryValue params; scoped_ptr<base::Value> value(base::Value::CreateNullValue()); mock->Expect(scoped_ptr<ExpectedCommand>(new ExpectedCommand( - "quitAll", params, std::string(), kOk, value.Pass(), std::string()))); + "quitAll", params, "", kOk, value.Pass(), ""))); } Shutdown(); } diff --git a/chrome/test/chromedriver/command_executor_impl_unittest.cc b/chrome/test/chromedriver/command_executor_impl_unittest.cc index dafa6e4..f538d06 100644 --- a/chrome/test/chromedriver/command_executor_impl_unittest.cc +++ b/chrome/test/chromedriver/command_executor_impl_unittest.cc @@ -118,11 +118,8 @@ TEST(CommandExecutorImplTest, CommandThatReturnsError) { StatusCode status_code; scoped_ptr<base::Value> value; std::string out_session_id; - executor.ExecuteCommand("simpleCommand", - params, - std::string(), - &status_code, - &value, + executor.ExecuteCommand("simpleCommand", params, "", + &status_code, &value, &out_session_id); ASSERT_EQ(kUnknownError, status_code); ASSERT_TRUE(value); diff --git a/chrome/test/chromedriver/commands_unittest.cc b/chrome/test/chromedriver/commands_unittest.cc index dcfc06f..dabe0e2 100644 --- a/chrome/test/chromedriver/commands_unittest.cc +++ b/chrome/test/chromedriver/commands_unittest.cc @@ -28,8 +28,7 @@ TEST(CommandsTest, GetStatus) { base::DictionaryValue params; scoped_ptr<base::Value> value; std::string session_id; - ASSERT_EQ( - kOk, ExecuteGetStatus(params, std::string(), &value, &session_id).code()); + ASSERT_EQ(kOk, ExecuteGetStatus(params, "", &value, &session_id).code()); base::DictionaryValue* dict; ASSERT_TRUE(value->GetAsDictionary(&dict)); base::Value* unused; @@ -73,7 +72,7 @@ TEST(CommandsTest, QuitAll) { scoped_ptr<base::Value> value; std::string session_id; Status status = - ExecuteQuitAll(cmd, &map, params, std::string(), &value, &session_id); + ExecuteQuitAll(cmd, &map, params, "", &value, &session_id); ASSERT_EQ(kOk, status.code()); ASSERT_FALSE(value.get()); ASSERT_EQ(2, count); @@ -244,7 +243,7 @@ TEST(CommandsTest, SuccessfulFindElement) { FindElementWebView web_view(true, kElementExistsQueryTwice); Session session("id"); session.implicit_wait = 1000; - session.SwitchToSubFrame("frame_id1", std::string()); + session.SwitchToSubFrame("frame_id1", ""); base::DictionaryValue params; params.SetString("using", "id"); params.SetString("value", "a"); @@ -273,7 +272,7 @@ TEST(CommandsTest, SuccessfulFindElements) { FindElementWebView web_view(false, kElementExistsQueryTwice); Session session("id"); session.implicit_wait = 1000; - session.SwitchToSubFrame("frame_id2", std::string()); + session.SwitchToSubFrame("frame_id2", ""); base::DictionaryValue params; params.SetString("using", "name"); params.SetString("value", "b"); @@ -307,7 +306,7 @@ TEST(CommandsTest, SuccessfulFindChildElement) { FindElementWebView web_view(true, kElementExistsQueryTwice); Session session("id"); session.implicit_wait = 1000; - session.SwitchToSubFrame("frame_id3", std::string()); + session.SwitchToSubFrame("frame_id3", ""); base::DictionaryValue params; params.SetString("using", "tag name"); params.SetString("value", "div"); @@ -345,7 +344,7 @@ TEST(CommandsTest, SuccessfulFindChildElements) { FindElementWebView web_view(false, kElementExistsQueryTwice); Session session("id"); session.implicit_wait = 1000; - session.SwitchToSubFrame("frame_id4", std::string()); + session.SwitchToSubFrame("frame_id4", ""); base::DictionaryValue params; params.SetString("using", "class name"); params.SetString("value", "c"); diff --git a/chrome/test/chromedriver/key_converter.cc b/chrome/test/chromedriver/key_converter.cc index 49b95f3..64c6099 100644 --- a/chrome/test/chromedriver/key_converter.cc +++ b/chrome/test/chromedriver/key_converter.cc @@ -158,13 +158,11 @@ bool KeyCodeFromShorthandKey(char16 key_utf16, } // namespace KeyEvent CreateKeyDownEvent(ui::KeyboardCode key_code, int modifiers) { - return KeyEvent( - kRawKeyDownEventType, modifiers, std::string(), std::string(), key_code); + return KeyEvent(kRawKeyDownEventType, modifiers, "", "", key_code); } KeyEvent CreateKeyUpEvent(ui::KeyboardCode key_code, int modifiers) { - return KeyEvent( - kKeyUpEventType, modifiers, std::string(), std::string(), key_code); + return KeyEvent(kKeyUpEventType, modifiers, "", "", key_code); } KeyEvent CreateCharEvent(const std::string& unmodified_text, diff --git a/chrome/test/chromedriver/keycode_text_conversion_x.cc b/chrome/test/chromedriver/keycode_text_conversion_x.cc index 7cf3b32..5b89935 100644 --- a/chrome/test/chromedriver/keycode_text_conversion_x.cc +++ b/chrome/test/chromedriver/keycode_text_conversion_x.cc @@ -180,7 +180,7 @@ bool GetXModifierMask(Display* display, int modifier, int* x_modifier) { std::string ConvertKeyCodeToText(ui::KeyboardCode key_code, int modifiers) { int x_key_code = KeyboardCodeToXKeyCode(key_code); if (x_key_code == -1) - return std::string(); + return ""; XEvent event; memset(&event, 0, sizeof(XEvent)); @@ -211,7 +211,7 @@ std::string ConvertKeyCodeToText(ui::KeyboardCode key_code, int modifiers) { uint16 character = ui::GetCharacterFromXEvent(&event); if (!character) - return std::string(); + return ""; return UTF16ToUTF8(string16(1, character)); } diff --git a/chrome/test/chromedriver/server/http_handler_unittest.cc b/chrome/test/chromedriver/server/http_handler_unittest.cc index a4d81a4..d516902 100644 --- a/chrome/test/chromedriver/server/http_handler_unittest.cc +++ b/chrome/test/chromedriver/server/http_handler_unittest.cc @@ -56,7 +56,7 @@ TEST(HttpHandlerTest, HandleUnknownCommand) { scoped_ptr<CommandExecutor>(new DummyExecutor()), scoped_ptr<HttpHandler::CommandMap>(new HttpHandler::CommandMap()), "/"); - HttpRequest request(kGet, "/path", std::string()); + HttpRequest request(kGet, "/path", ""); HttpResponse response; handler.Handle(request, &response); ASSERT_EQ(HttpResponse::kNotFound, response.status()); @@ -68,7 +68,7 @@ TEST(HttpHandlerTest, HandleNewSession) { HttpHandler handler( scoped_ptr<CommandExecutor>(new DummyExecutor()), map.Pass(), "/base/"); - HttpRequest request(kPost, "/base/session", std::string()); + HttpRequest request(kPost, "/base/session", ""); HttpResponse response; handler.Handle(request, &response); ASSERT_EQ(HttpResponse::kSeeOther, response.status()); @@ -96,7 +96,7 @@ TEST(HttpHandlerTest, HandleUnimplementedCommand) { HttpHandler handler( scoped_ptr<CommandExecutor>(new DummyExecutor(kUnknownCommand)), map.Pass(), "/"); - HttpRequest request(kPost, "/path", std::string()); + HttpRequest request(kPost, "/path", ""); HttpResponse response; handler.Handle(request, &response); ASSERT_EQ(HttpResponse::kNotImplemented, response.status()); @@ -108,7 +108,7 @@ TEST(HttpHandlerTest, HandleCommand) { HttpHandler handler( scoped_ptr<CommandExecutor>(new DummyExecutor()), map.Pass(), "/"); - HttpRequest request(kPost, "/path", std::string()); + HttpRequest request(kPost, "/path", ""); HttpResponse response; handler.Handle(request, &response); ASSERT_EQ(HttpResponse::kOk, response.status()); @@ -140,9 +140,9 @@ TEST(MatchesCommandTest, DiffPathLength) { ASSERT_FALSE(internal::MatchesCommand( kPost, "path", command, &session_id, ¶ms)); ASSERT_FALSE(internal::MatchesCommand( - kPost, std::string(), command, &session_id, ¶ms)); - ASSERT_FALSE( - internal::MatchesCommand(kPost, "/", command, &session_id, ¶ms)); + kPost, "", command, &session_id, ¶ms)); + ASSERT_FALSE(internal::MatchesCommand( + kPost, "/", command, &session_id, ¶ms)); ASSERT_FALSE(internal::MatchesCommand( kPost, "path/path/path", command, &session_id, ¶ms)); } diff --git a/chrome/test/chromedriver/session.cc b/chrome/test/chromedriver/session.cc index ae10238..d6f6673 100644 --- a/chrome/test/chromedriver/session.cc +++ b/chrome/test/chromedriver/session.cc @@ -67,7 +67,7 @@ void Session::SwitchToSubFrame(const std::string& frame_id, std::string Session::GetCurrentFrameId() const { if (frames.empty()) - return std::string(); + return ""; return frames.back().frame_id; } diff --git a/chrome/test/chromedriver/session_commands.cc b/chrome/test/chromedriver/session_commands.cc index 4be22c4..8fdea23 100644 --- a/chrome/test/chromedriver/session_commands.cc +++ b/chrome/test/chromedriver/session_commands.cc @@ -201,8 +201,7 @@ Status ExecuteSwitchToWindow( status = web_view->ConnectIfNecessary(); if (status.IsError()) return status; - status = web_view->CallFunction( - std::string(), kGetWindowNameScript, args, &result); + status = web_view->CallFunction("", kGetWindowNameScript, args, &result); if (status.IsError()) return status; std::string window_name; diff --git a/chrome/test/chromedriver/window_commands.cc b/chrome/test/chromedriver/window_commands.cc index e7b7cd1..557d572 100644 --- a/chrome/test/chromedriver/window_commands.cc +++ b/chrome/test/chromedriver/window_commands.cc @@ -347,8 +347,7 @@ Status ExecuteGoBack( WebView* web_view, const base::DictionaryValue& params, scoped_ptr<base::Value>* value) { - return web_view->EvaluateScript( - std::string(), "window.history.back();", value); + return web_view->EvaluateScript("", "window.history.back();", value); } Status ExecuteGoForward( @@ -356,8 +355,7 @@ Status ExecuteGoForward( WebView* web_view, const base::DictionaryValue& params, scoped_ptr<base::Value>* value) { - return web_view->EvaluateScript( - std::string(), "window.history.forward();", value); + return web_view->EvaluateScript("", "window.history.forward();", value); } Status ExecuteRefresh( diff --git a/chrome/test/gpu/gpu_pixel_browsertest.cc b/chrome/test/gpu/gpu_pixel_browsertest.cc index 82972a0..71d9478 100644 --- a/chrome/test/gpu/gpu_pixel_browsertest.cc +++ b/chrome/test/gpu/gpu_pixel_browsertest.cc @@ -145,7 +145,7 @@ class GpuPixelBrowserTest : public InProcessBrowserTest { const char* test_status_prefixes[] = {"DISABLED_", "FLAKY_", "FAILS_"}; for (size_t i = 0; i < arraysize(test_status_prefixes); ++i) { ReplaceFirstSubstringAfterOffset( - &test_name_, 0, test_status_prefixes[i], std::string()); + &test_name_, 0, test_status_prefixes[i], ""); } ui::DisableTestCompositor(); diff --git a/chrome/test/perf/dom_checker_uitest.cc b/chrome/test/perf/dom_checker_uitest.cc index f22cce4..f966250 100644 --- a/chrome/test/perf/dom_checker_uitest.cc +++ b/chrome/test/perf/dom_checker_uitest.cc @@ -143,24 +143,20 @@ class DomCheckerTest : public UITest { } bool WaitUntilTestCompletes(TabProxy* tab) { - return WaitUntilJavaScriptCondition( - tab, - std::wstring(), + return WaitUntilJavaScriptCondition(tab, L"", L"window.domAutomationController.send(automation.IsDone());", TestTimeouts::large_test_timeout()); } bool GetTestCount(TabProxy* tab, int* test_count) { - return tab->ExecuteAndExtractInt( - std::wstring(), + return tab->ExecuteAndExtractInt(L"", L"window.domAutomationController.send(automation.GetTestCount());", test_count); } bool GetTestsFailed(TabProxy* tab, ResultsSet* tests_failed) { std::wstring json_wide; - bool succeeded = tab->ExecuteAndExtractString( - std::wstring(), + bool succeeded = tab->ExecuteAndExtractString(L"", L"window.domAutomationController.send(" L" JSON.stringify(automation.GetFailures()));", &json_wide); diff --git a/chrome/test/perf/feature_startup_test.cc b/chrome/test/perf/feature_startup_test.cc index 0caaa44..c11a386 100644 --- a/chrome/test/perf/feature_startup_test.cc +++ b/chrome/test/perf/feature_startup_test.cc @@ -38,8 +38,7 @@ class NewTabUIStartupTest : public UIPerfTest { std::string times; for (int i = 0; i < kNumCycles; ++i) base::StringAppendF(×, "%.2f,", timings[i].InMillisecondsF()); - perf_test::PrintResultList( - "new_tab", std::string(), label, times, "ms", important); + perf_test::PrintResultList("new_tab", "", label, times, "ms", important); } void InitProfile(UITestBase::ProfileType profile_type) { diff --git a/chrome/test/perf/frame_rate/frame_rate_tests.cc b/chrome/test/perf/frame_rate/frame_rate_tests.cc index 7b36b27..7be2b36 100644 --- a/chrome/test/perf/frame_rate/frame_rate_tests.cc +++ b/chrome/test/perf/frame_rate/frame_rate_tests.cc @@ -196,10 +196,8 @@ class FrameRateTest // race condition caused by an html redirect. If that is the case, verify // that flag kHasRedirect is enabled for the current test. ASSERT_TRUE(WaitUntilJavaScriptCondition( - tab, - std::wstring(), - L"window.domAutomationController.send(__initialized);", - TestTimeouts::large_test_timeout())); + tab, L"", L"window.domAutomationController.send(__initialized);", + TestTimeouts::large_test_timeout())); if (HasFlag(kForceGpuComposited)) { ASSERT_TRUE(tab->NavigateToURLAsync( @@ -211,9 +209,7 @@ class FrameRateTest // Block until the tests completes. ASSERT_TRUE(WaitUntilJavaScriptCondition( - tab, - std::wstring(), - L"window.domAutomationController.send(!__running_all);", + tab, L"", L"window.domAutomationController.send(!__running_all);", TestTimeouts::large_test_timeout())); // TODO(jbates): remove this check when ref builds are updated. @@ -229,7 +225,7 @@ class FrameRateTest // Read out the results. std::wstring json; ASSERT_TRUE(tab->ExecuteAndExtractString( - std::wstring(), + L"", L"window.domAutomationController.send(" L"JSON.stringify(__calc_results_total()));", &json)); @@ -251,12 +247,8 @@ class FrameRateTest results["sigmas"].c_str()); std::string mean_and_error = results["mean"] + "," + results["sigma"]; - perf_test::PrintResultMeanAndError(name, - std::string(), - trace_name, - mean_and_error, - "milliseconds-per-frame", - true); + perf_test::PrintResultMeanAndError(name, "", trace_name, mean_and_error, + "milliseconds-per-frame", true); // Navigate back to NTP so that we can quit without timing out during the // wait-for-idle stage in test framework. diff --git a/chrome/test/perf/indexeddb_uitest.cc b/chrome/test/perf/indexeddb_uitest.cc index 48db062..787f2bf1 100644 --- a/chrome/test/perf/indexeddb_uitest.cc +++ b/chrome/test/perf/indexeddb_uitest.cc @@ -63,8 +63,7 @@ class IndexedDBTest : public UIPerfTest { bool GetResults(TabProxy* tab, ResultsMap* results) { std::wstring json_wide; - bool succeeded = tab->ExecuteAndExtractString( - std::wstring(), + bool succeeded = tab->ExecuteAndExtractString(L"", L"window.domAutomationController.send(" L" JSON.stringify(automation.getResults()));", &json_wide); @@ -85,8 +84,8 @@ class IndexedDBTest : public UIPerfTest { ResultsMap::const_iterator it = results.begin(); for (; it != results.end(); ++it) - perf_test::PrintResultList( - it->first, std::string(), trace_name, it->second, "ms", false); + perf_test::PrintResultList(it->first, "", trace_name, it->second, "ms", + false); } DISALLOW_COPY_AND_ASSIGN(IndexedDBTest); diff --git a/chrome/test/perf/page_cycler_test.cc b/chrome/test/perf/page_cycler_test.cc index 9d13000..4354faf 100644 --- a/chrome/test/perf/page_cycler_test.cc +++ b/chrome/test/perf/page_cycler_test.cc @@ -215,11 +215,10 @@ class PageCyclerTest : public UIPerfTest { // Get the timing cookie value from the DOM automation. std::wstring wcookie; - ASSERT_TRUE(tab->ExecuteAndExtractString( - std::wstring(), - L"window.domAutomationController.send(" - L"JSON.stringify(__get_timings()));", - &wcookie)); + ASSERT_TRUE(tab->ExecuteAndExtractString(L"", + L"window.domAutomationController.send(" + L"JSON.stringify(__get_timings()));", + &wcookie)); cookie = base::SysWideToNativeMB(wcookie); // JSON.stringify() encapsulates the returned string in quotes, strip them. @@ -261,8 +260,8 @@ class PageCyclerTest : public UIPerfTest { printf("Pages: [%s]\n", base::SysWideToNativeMB(pages).c_str()); - perf_test::PrintResultList( - graph, std::string(), trace_name, timings, "ms", true /* important */); + perf_test::PrintResultList(graph, "", trace_name, timings, "ms", + true /* important */); } void RunTest(const char* graph, const char* name, bool use_http) { @@ -276,7 +275,7 @@ class PageCyclerTest : public UIPerfTest { ASSERT_TRUE(tab.get()); std::wstring whistogram; ASSERT_TRUE(tab->ExecuteAndExtractString( - std::wstring(), + L"", L"window.domAutomationController.send(" L"window.domAutomationController.getHistogram ? " L"window.domAutomationController.getHistogram(\"" + diff --git a/chrome/test/perf/perf_test.cc b/chrome/test/perf/perf_test.cc index ec1d214..68c92e1 100644 --- a/chrome/test/perf/perf_test.cc +++ b/chrome/test/perf/perf_test.cc @@ -54,14 +54,8 @@ void PrintResult(const std::string& measurement, size_t value, const std::string& units, bool important) { - PrintResultsImpl(measurement, - modifier, - trace, - base::UintToString(value), - std::string(), - std::string(), - units, - important); + PrintResultsImpl(measurement, modifier, trace, base::UintToString(value), + "", "", units, important); } void AppendResult(std::string& output, @@ -71,14 +65,9 @@ void AppendResult(std::string& output, size_t value, const std::string& units, bool important) { - output += ResultsToString(measurement, - modifier, - trace, + output += ResultsToString(measurement, modifier, trace, base::UintToString(value), - std::string(), - std::string(), - units, - important); + "", "", units, important); } void PrintResult(const std::string& measurement, @@ -87,13 +76,7 @@ void PrintResult(const std::string& measurement, const std::string& value, const std::string& units, bool important) { - PrintResultsImpl(measurement, - modifier, - trace, - value, - std::string(), - std::string(), - units, + PrintResultsImpl(measurement, modifier, trace, value, "", "", units, important); } @@ -104,13 +87,7 @@ void AppendResult(std::string& output, const std::string& value, const std::string& units, bool important) { - output += ResultsToString(measurement, - modifier, - trace, - value, - std::string(), - std::string(), - units, + output += ResultsToString(measurement, modifier, trace, value, "", "", units, important); } @@ -256,120 +233,40 @@ std::string IOPerfInfoToString(const std::string& test_name, } std::string t_name(test_name); - AppendResult(output, - "read_op_b", - std::string(), - "r_op_b" + t_name, - read_op_b, - "ops", + AppendResult(output, "read_op_b", "", "r_op_b" + t_name, read_op_b, "ops", false); - AppendResult(output, - "write_op_b", - std::string(), - "w_op_b" + t_name, - write_op_b, - "ops", + AppendResult(output, "write_op_b", "", "w_op_b" + t_name, write_op_b, "ops", false); - AppendResult(output, - "other_op_b", - std::string(), - "o_op_b" + t_name, - other_op_b, - "ops", + AppendResult(output, "other_op_b", "", "o_op_b" + t_name, other_op_b, "ops", false); - AppendResult(output, - "total_op_b", - std::string(), - "IO_op_b" + t_name, - total_op_b, - "ops", + AppendResult(output, "total_op_b", "", "IO_op_b" + t_name, total_op_b, "ops", false); - AppendResult(output, - "read_byte_b", - std::string(), - "r_b" + t_name, - read_byte_b, - "kb", + AppendResult(output, "read_byte_b", "", "r_b" + t_name, read_byte_b, "kb", false); - AppendResult(output, - "write_byte_b", - std::string(), - "w_b" + t_name, - write_byte_b, - "kb", + AppendResult(output, "write_byte_b", "", "w_b" + t_name, write_byte_b, "kb", false); - AppendResult(output, - "other_byte_b", - std::string(), - "o_b" + t_name, - other_byte_b, - "kb", + AppendResult(output, "other_byte_b", "", "o_b" + t_name, other_byte_b, "kb", false); - AppendResult(output, - "total_byte_b", - std::string(), - "IO_b" + t_name, - total_byte_b, - "kb", + AppendResult(output, "total_byte_b", "", "IO_b" + t_name, total_byte_b, "kb", false); - AppendResult(output, - "read_op_r", - std::string(), - "r_op_r" + t_name, - read_op_r, - "ops", + AppendResult(output, "read_op_r", "", "r_op_r" + t_name, read_op_r, "ops", false); - AppendResult(output, - "write_op_r", - std::string(), - "w_op_r" + t_name, - write_op_r, - "ops", + AppendResult(output, "write_op_r", "", "w_op_r" + t_name, write_op_r, "ops", false); - AppendResult(output, - "other_op_r", - std::string(), - "o_op_r" + t_name, - other_op_r, - "ops", + AppendResult(output, "other_op_r", "", "o_op_r" + t_name, other_op_r, "ops", false); - AppendResult(output, - "total_op_r", - std::string(), - "IO_op_r" + t_name, - total_op_r, - "ops", + AppendResult(output, "total_op_r", "", "IO_op_r" + t_name, total_op_r, "ops", false); - AppendResult(output, - "read_byte_r", - std::string(), - "r_r" + t_name, - read_byte_r, - "kb", + AppendResult(output, "read_byte_r", "", "r_r" + t_name, read_byte_r, "kb", false); - AppendResult(output, - "write_byte_r", - std::string(), - "w_r" + t_name, - write_byte_r, - "kb", + AppendResult(output, "write_byte_r", "", "w_r" + t_name, write_byte_r, "kb", false); - AppendResult(output, - "other_byte_r", - std::string(), - "o_r" + t_name, - other_byte_r, - "kb", + AppendResult(output, "other_byte_r", "", "o_r" + t_name, other_byte_r, "kb", false); - AppendResult(output, - "total_byte_r", - std::string(), - "IO_r" + t_name, - total_byte_r, - "kb", + AppendResult(output, "total_byte_r", "", "IO_r" + t_name, total_byte_r, "kb", false); return output; @@ -495,57 +392,29 @@ std::string MemoryUsageInfoToString(const std::string& test_name, total_working_set_size, "bytes", false /* not important */); #elif defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_ANDROID) - AppendResult(output, - "vm_size_final_b", - std::string(), - "vm_size_f_b" + trace_name, - browser_virtual_size, - "bytes", + AppendResult(output, "vm_size_final_b", "", "vm_size_f_b" + trace_name, + browser_virtual_size, "bytes", false /* not important */); - AppendResult(output, - "vm_rss_final_b", - std::string(), - "vm_rss_f_b" + trace_name, - browser_working_set_size, - "bytes", + AppendResult(output, "vm_rss_final_b", "", "vm_rss_f_b" + trace_name, + browser_working_set_size, "bytes", false /* not important */); - AppendResult(output, - "vm_size_final_r", - std::string(), - "vm_size_f_r" + trace_name, - renderer_virtual_size, - "bytes", + AppendResult(output, "vm_size_final_r", "", "vm_size_f_r" + trace_name, + renderer_virtual_size, "bytes", false /* not important */); - AppendResult(output, - "vm_rss_final_r", - std::string(), - "vm_rss_f_r" + trace_name, - renderer_working_set_size, - "bytes", + AppendResult(output, "vm_rss_final_r", "", "vm_rss_f_r" + trace_name, + renderer_working_set_size, "bytes", false /* not important */); - AppendResult(output, - "vm_size_final_t", - std::string(), - "vm_size_f_t" + trace_name, - total_virtual_size, - "bytes", + AppendResult(output, "vm_size_final_t", "", "vm_size_f_t" + trace_name, + total_virtual_size, "bytes", false /* not important */); - AppendResult(output, - "vm_rss_final_t", - std::string(), - "vm_rss_f_t" + trace_name, - total_working_set_size, - "bytes", + AppendResult(output, "vm_rss_final_t", "", "vm_rss_f_t" + trace_name, + total_working_set_size, "bytes", false /* not important */); #else NOTIMPLEMENTED(); #endif - AppendResult(output, - "processes", - std::string(), - "proc_" + trace_name, - chrome_processes.size(), - "count", + AppendResult(output, "processes", "", "proc_" + trace_name, + chrome_processes.size(), "count", false /* not important */); return output; @@ -570,12 +439,7 @@ std::string SystemCommitChargeToString(const std::string& test_name, bool important) { std::string trace_name(test_name); std::string output; - AppendResult(output, - "commit_charge", - std::string(), - "cc" + trace_name, - charge, - "kb", + AppendResult(output, "commit_charge", "", "cc" + trace_name, charge, "kb", important); return output; } diff --git a/chrome/test/perf/rendering/latency_tests.cc b/chrome/test/perf/rendering/latency_tests.cc index fdd00d7..70939fd 100644 --- a/chrome/test/perf/rendering/latency_tests.cc +++ b/chrome/test/perf/rendering/latency_tests.cc @@ -153,7 +153,7 @@ class LatencyTest return "software"; default: NOTREACHED() << "invalid mode"; - return std::string(); + return ""; } } @@ -586,12 +586,8 @@ double LatencyTest::CalculateLatency() { std::string trace_name = GetTraceName(test_flags_); std::string mean_and_error = base::StringPrintf("%f,%f", mean_latency, mean_error); - perf_test::PrintResultMeanAndError(GetModeString(), - std::string(), - trace_name, - mean_and_error, - "frames", - true); + perf_test::PrintResultMeanAndError(GetModeString(), "", trace_name, + mean_and_error, "frames", true); return mean_latency; } diff --git a/chrome/test/perf/rendering/throughput_tests.cc b/chrome/test/perf/rendering/throughput_tests.cc index 08a1483..79d6bbb 100644 --- a/chrome/test/perf/rendering/throughput_tests.cc +++ b/chrome/test/perf/rendering/throughput_tests.cc @@ -383,12 +383,8 @@ class ThroughputTest : public BrowserPerfTest { ran_on_gpu ? "gpu" : "software"; std::string mean_and_error = base::StringPrintf("%f,%f", mean_ms, std_dev_ms); - perf_test::PrintResultMeanAndError(test_name, - std::string(), - trace_name, - mean_and_error, - "frame_time", - true); + perf_test::PrintResultMeanAndError(test_name, "", trace_name, + mean_and_error, "frame_time", true); if (flags & kAllowExternalDNS) ResetAllowExternalDNS(); diff --git a/chrome/test/perf/shutdown_test.cc b/chrome/test/perf/shutdown_test.cc index d97c58b..7cbc7b6 100644 --- a/chrome/test/perf/shutdown_test.cc +++ b/chrome/test/perf/shutdown_test.cc @@ -114,8 +114,7 @@ class ShutdownTest : public UIPerfTest { std::string times; for (int i = 0; i < numCycles; ++i) base::StringAppendF(×, "%.2f,", timings[i].InMillisecondsF()); - perf_test::PrintResultList( - graph, std::string(), trace, times, "ms", important); + perf_test::PrintResultList(graph, "", trace, times, "ms", important); } }; diff --git a/chrome/test/perf/startup_test.cc b/chrome/test/perf/startup_test.cc index 0a07ce8..1d8243f 100644 --- a/chrome/test/perf/startup_test.cc +++ b/chrome/test/perf/startup_test.cc @@ -295,8 +295,7 @@ class StartupTest : public UIPerfTest { "%.2f,", timings[i].end_to_end.InMillisecondsF()); } - perf_test::PrintResultList( - graph, std::string(), trace, times, "ms", important); + perf_test::PrintResultList(graph, "", trace, times, "ms", important); if (num_tabs > 0) { std::string name_base = trace; @@ -306,15 +305,15 @@ class StartupTest : public UIPerfTest { name = name_base + "-start"; for (int i = 0; i < numCycles; ++i) base::StringAppendF(×, "%.2f,", timings[i].first_start_ms); - perf_test::PrintResultList( - graph, std::string(), name.c_str(), times, "ms", important); + perf_test::PrintResultList(graph, "", name.c_str(), times, "ms", + important); times.clear(); name = name_base + "-first"; for (int i = 0; i < numCycles; ++i) base::StringAppendF(×, "%.2f,", timings[i].first_stop_ms); - perf_test::PrintResultList( - graph, std::string(), name.c_str(), times, "ms", important); + perf_test::PrintResultList(graph, "", name.c_str(), times, "ms", + important); if (nth_timed_tab > 0) { // Display only the time necessary to load the first n tabs. @@ -322,8 +321,8 @@ class StartupTest : public UIPerfTest { name = name_base + "-" + base::IntToString(nth_timed_tab); for (int i = 0; i < numCycles; ++i) base::StringAppendF(×, "%.2f,", timings[i].nth_tab_stop_ms); - perf_test::PrintResultList( - graph, std::string(), name.c_str(), times, "ms", important); + perf_test::PrintResultList(graph, "", name.c_str(), times, "ms", + important); } if (num_tabs > 1) { @@ -332,8 +331,8 @@ class StartupTest : public UIPerfTest { name = name_base + "-all"; for (int i = 0; i < numCycles; ++i) base::StringAppendF(×, "%.2f,", timings[i].last_stop_ms); - perf_test::PrintResultList( - graph, std::string(), name.c_str(), times, "ms", important); + perf_test::PrintResultList(graph, "", name.c_str(), times, "ms", + important); } } } diff --git a/chrome/test/perf/tab_switching_test.cc b/chrome/test/perf/tab_switching_test.cc index a56c792..45a0891 100644 --- a/chrome/test/perf/tab_switching_test.cc +++ b/chrome/test/perf/tab_switching_test.cc @@ -69,8 +69,7 @@ class TabSwitchingUITest : public UIPerfTest { std::string times; for (int i = 0; i < kNumCycles; ++i) base::StringAppendF(×, "%.2f,", timings[i].InMillisecondsF()); - perf_test::PrintResultList( - "times", std::string(), label, times, "ms", important); + perf_test::PrintResultList("times", "", label, times, "ms", important); } void RunTabSwitchingUITest(const char* label, bool important) { diff --git a/chrome/test/perf/url_fetch_test.cc b/chrome/test/perf/url_fetch_test.cc index 2cffb68..6c8712f 100644 --- a/chrome/test/perf/url_fetch_test.cc +++ b/chrome/test/perf/url_fetch_test.cc @@ -77,8 +77,8 @@ class UrlFetchTest : public UIPerfTest { "window.domAutomationController.send(%s);", var_to_fetch); std::wstring value; - bool success = tab->ExecuteAndExtractString( - std::wstring(), ASCIIToWide(script), &value); + bool success = tab->ExecuteAndExtractString(L"", ASCIIToWide(script), + &value); ASSERT_TRUE(success); result->javascript_variable = WideToUTF8(value); } diff --git a/chrome/test/ppapi/ppapi_test.cc b/chrome/test/ppapi/ppapi_test.cc index 4cc99f4..bec32a6 100644 --- a/chrome/test/ppapi/ppapi_test.cc +++ b/chrome/test/ppapi/ppapi_test.cc @@ -156,7 +156,7 @@ GURL PPAPITestBase::GetTestFileUrl(const std::string& test_case) { GURL test_url = net::FilePathToFileURL(test_path); GURL::Replacements replacements; - std::string query = BuildQuery(std::string(), test_case); + std::string query = BuildQuery("", test_case); replacements.SetQuery(query.c_str(), url_parse::Component(0, query.size())); return test_url.ReplaceComponents(replacements); } @@ -182,7 +182,7 @@ void PPAPITestBase::RunTestViaHTTP(const std::string& test_case) { net::TestServer::kLocalhost, document_root); ASSERT_TRUE(http_server.Start()); - RunTestURL(GetTestURL(http_server, test_case, std::string())); + RunTestURL(GetTestURL(http_server, test_case, "")); } void PPAPITestBase::RunTestWithSSLServer(const std::string& test_case) { diff --git a/chrome/test/reliability/automated_ui_tests.cc b/chrome/test/reliability/automated_ui_tests.cc index 4654082..fd50b23 100644 --- a/chrome/test/reliability/automated_ui_tests.cc +++ b/chrome/test/reliability/automated_ui_tests.cc @@ -505,7 +505,7 @@ bool AutomatedUITest::ChangeEncoding() { std::string cur_locale = g_browser_process->GetApplicationLocale(); const std::vector<CharacterEncoding::EncodingInfo>* encodings = CharacterEncoding::GetCurrentDisplayEncodings( - cur_locale, "ISO-8859-1,windows-1252", std::string()); + cur_locale, "ISO-8859-1,windows-1252", ""); DCHECK(encodings); DCHECK(!encodings->empty()); unsigned len = static_cast<unsigned>(encodings->size()); diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index 40bdf16..cf839fb 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -516,7 +516,7 @@ bool UITestBase::BeginTracing(const std::string& categories) { std::string UITestBase::EndTracing() { std::string json_trace_output; if (!automation()->EndTracing(&json_trace_output)) - return std::string(); + return ""; return json_trace_output; } diff --git a/chrome/test/webdriver/commands/command.cc b/chrome/test/webdriver/commands/command.cc index dfde908..1471e0a 100644 --- a/chrome/test/webdriver/commands/command.cc +++ b/chrome/test/webdriver/commands/command.cc @@ -32,7 +32,7 @@ bool Command::Init(Response* const response) { void Command::Finish(Response* const response) {} std::string Command::GetPathVariable(const size_t i) const { - return i < path_segments_.size() ? path_segments_.at(i) : std::string(); + return i < path_segments_.size() ? path_segments_.at(i) : ""; } bool Command::HasParameter(const std::string& key) const { diff --git a/chrome/test/webdriver/commands/set_timeout_commands_unittest.cc b/chrome/test/webdriver/commands/set_timeout_commands_unittest.cc index 767fbb1..2db4f4c 100644 --- a/chrome/test/webdriver/commands/set_timeout_commands_unittest.cc +++ b/chrome/test/webdriver/commands/set_timeout_commands_unittest.cc @@ -55,7 +55,7 @@ TEST(ImplicitWaitCommandTest, SettingImplicitWaits) { ASSERT_EQ(0, test_session.implicit_wait()) << "Sanity check failed"; std::vector<std::string> path_segments; - path_segments.push_back(std::string()); + path_segments.push_back(""); path_segments.push_back("session"); path_segments.push_back(test_session.id()); path_segments.push_back("timeouts"); diff --git a/chrome/test/webdriver/frame_path.cc b/chrome/test/webdriver/frame_path.cc index fd45a8d..bce634d9 100644 --- a/chrome/test/webdriver/frame_path.cc +++ b/chrome/test/webdriver/frame_path.cc @@ -8,7 +8,7 @@ namespace webdriver { -FramePath::FramePath() {} +FramePath::FramePath() : path_("") {} FramePath::FramePath(const FramePath& other) : path_(other.path_) {} diff --git a/chrome/test/webdriver/keycode_text_conversion_gtk.cc b/chrome/test/webdriver/keycode_text_conversion_gtk.cc index 302d708..05b17db 100644 --- a/chrome/test/webdriver/keycode_text_conversion_gtk.cc +++ b/chrome/test/webdriver/keycode_text_conversion_gtk.cc @@ -23,7 +23,7 @@ std::string ConvertKeyCodeToText(ui::KeyboardCode key_code, int modifiers) { gdk_key_code = gdk_keyval_to_upper(gdk_key_code); guint32 unicode_char = gdk_keyval_to_unicode(gdk_key_code); if (!unicode_char) - return std::string(); + return ""; gchar buffer[6]; gint length = g_unichar_to_utf8(unicode_char, buffer); return std::string(buffer, length); diff --git a/chrome/test/webdriver/webdriver_dispatch_unittest.cc b/chrome/test/webdriver/webdriver_dispatch_unittest.cc index 8e75edb..855711d 100644 --- a/chrome/test/webdriver/webdriver_dispatch_unittest.cc +++ b/chrome/test/webdriver/webdriver_dispatch_unittest.cc @@ -158,7 +158,7 @@ class ParseRequestInfoTest : public testing::Test { virtual ~ParseRequestInfoTest() {} virtual void TearDown() { - SessionManager::GetInstance()->set_url_base(std::string()); + SessionManager::GetInstance()->set_url_base(""); } private: @@ -178,7 +178,7 @@ TEST_F(ParseRequestInfoTest, ParseRequestWithEmptyUrlBase) { base::DictionaryValue* parameters; Response response; - SessionManager::GetInstance()->set_url_base(std::string()); + SessionManager::GetInstance()->set_url_base(""); EXPECT_TRUE(internal::ParseRequestInfo( &request_info, NULL, // NULL is ok because GET not POST is used diff --git a/chrome/test/webdriver/webdriver_key_converter.cc b/chrome/test/webdriver/webdriver_key_converter.cc index b83d3cb..e19e9dc 100644 --- a/chrome/test/webdriver/webdriver_key_converter.cc +++ b/chrome/test/webdriver/webdriver_key_converter.cc @@ -162,19 +162,11 @@ bool KeyCodeFromShorthandKey(char16 key_utf16, namespace webdriver { WebKeyEvent CreateKeyDownEvent(ui::KeyboardCode key_code, int modifiers) { - return WebKeyEvent(automation::kRawKeyDownType, - key_code, - std::string(), - std::string(), - modifiers); + return WebKeyEvent(automation::kRawKeyDownType, key_code, "", "", modifiers); } WebKeyEvent CreateKeyUpEvent(ui::KeyboardCode key_code, int modifiers) { - return WebKeyEvent(automation::kKeyUpType, - key_code, - std::string(), - std::string(), - modifiers); + return WebKeyEvent(automation::kKeyUpType, key_code, "", "", modifiers); } WebKeyEvent CreateCharEvent(const std::string& unmodified_text, diff --git a/chrome/test/webdriver/webdriver_session.cc b/chrome/test/webdriver/webdriver_session.cc index 6ed89d9..953120a 100644 --- a/chrome/test/webdriver/webdriver_session.cc +++ b/chrome/test/webdriver/webdriver_session.cc @@ -942,11 +942,9 @@ Error* Session::GetElementRegionInView( // Find the frame element for the current frame path. FrameId frame_id(current_target_.view_id, frame_path.Parent()); ElementId frame_element; - error = FindElement(frame_id, - ElementId(std::string()), - LocatorType::kXpath, - frame_path.BaseName().value(), - &frame_element); + error = FindElement( + frame_id, ElementId(""), + LocatorType::kXpath, frame_path.BaseName().value(), &frame_element); if (error) { std::string context = base::StringPrintf( "Could not find frame element (%s) in frame (%s)", diff --git a/chrome/test/webdriver/webdriver_session_manager.cc b/chrome/test/webdriver/webdriver_session_manager.cc index aa5aeca..8dc42e2 100644 --- a/chrome/test/webdriver/webdriver_session_manager.cc +++ b/chrome/test/webdriver/webdriver_session_manager.cc @@ -49,7 +49,7 @@ std::string SessionManager::url_base() const { return url_base_; } -SessionManager::SessionManager() {} +SessionManager::SessionManager() : port_(""), url_base_("") {} SessionManager::~SessionManager() {} diff --git a/chrome/tools/ipclist/ipcfuzz.cc b/chrome/tools/ipclist/ipcfuzz.cc index 1d288c5..0eafb14 100644 --- a/chrome/tools/ipclist/ipcfuzz.cc +++ b/chrome/tools/ipclist/ipcfuzz.cc @@ -180,17 +180,17 @@ class DefaultFuzzer : public IPC::Fuzzer { } virtual void FuzzString(std::string* value) OVERRIDE { - FuzzStringType<std::string>(value, frequency_, "BORKED", std::string()); + FuzzStringType<std::string>(value, frequency_, "BORKED", ""); } virtual void FuzzWString(std::wstring* value) OVERRIDE { - FuzzStringType<std::wstring>(value, frequency_, L"BORKED", std::wstring()); + FuzzStringType<std::wstring>(value, frequency_, L"BORKED", L""); } virtual void FuzzString16(string16* value) OVERRIDE { FuzzStringType<string16>(value, frequency_, WideToUTF16(L"BORKED"), - WideToUTF16(std::wstring())); + WideToUTF16(L"")); } virtual void FuzzData(char* data, int length) OVERRIDE { diff --git a/chrome/utility/profile_import_handler.cc b/chrome/utility/profile_import_handler.cc index 413feea..473581c 100644 --- a/chrome/utility/profile_import_handler.cc +++ b/chrome/utility/profile_import_handler.cc @@ -68,7 +68,7 @@ void ProfileImportHandler::OnImportItemFinished(uint16 item) { items_to_import_ ^= item; // Remove finished item from mask. // If we've finished with all items, notify the browser process. if (items_to_import_ == 0) { - Send(new ProfileImportProcessHostMsg_Import_Finished(true, std::string())); + Send(new ProfileImportProcessHostMsg_Import_Finished(true, "")); ImporterCleanup(); } } |