diff options
author | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-09 05:45:17 +0000 |
---|---|---|
committer | dcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-09 05:45:17 +0000 |
commit | e59558b78e8c6a1b0bd916a724724b638c3c91b6 (patch) | |
tree | 712268a7e9e1cd552f309d89641b2bed5ad06322 /content | |
parent | 31fcd34da3797bc49160620ef8c94a38652c0587 (diff) | |
download | chromium_src-e59558b78e8c6a1b0bd916a724724b638c3c91b6.zip chromium_src-e59558b78e8c6a1b0bd916a724724b638c3c91b6.tar.gz chromium_src-e59558b78e8c6a1b0bd916a724724b638c3c91b6.tar.bz2 |
Rewrite std::string("") to std::string(), Linux edition.
This patch was generated by running the empty_string clang tool
across the Chromium Linux compilation database. Implicitly or
explicitly constructing std::string() with a "" argument is
inefficient as the caller needs to emit extra instructions to
pass an argument, and the constructor needlessly copies a byte
into internal storage. Rewriting these instances to simply call
the default constructor appears to save ~14-18 kilobytes on an
optimized release build.
BUG=none
Review URL: https://codereview.chromium.org/13145003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193020 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
57 files changed, 256 insertions, 242 deletions
diff --git a/content/browser/accessibility/accessibility_tree_formatter.cc b/content/browser/accessibility/accessibility_tree_formatter.cc index cbe0629..b1bc110 100644 --- a/content/browser/accessibility/accessibility_tree_formatter.cc +++ b/content/browser/accessibility/accessibility_tree_formatter.cc @@ -80,28 +80,28 @@ void AccessibilityTreeFormatter::Initialize() {} // static const base::FilePath::StringType AccessibilityTreeFormatter::GetActualFileSuffix() { - return FILE_PATH_LITERAL(""); + return FILE_PATH_LITERAL(std::string()); } // static const base::FilePath::StringType AccessibilityTreeFormatter::GetExpectedFileSuffix() { - return FILE_PATH_LITERAL(""); + return FILE_PATH_LITERAL(std::string()); } // static const std::string AccessibilityTreeFormatter::GetAllowEmptyString() { - return ""; + return std::string(); } // static const std::string AccessibilityTreeFormatter::GetAllowString() { - return ""; + return std::string(); } // static const std::string AccessibilityTreeFormatter::GetDenyString() { - return ""; + return std::string(); } #endif diff --git a/content/browser/accessibility/cross_platform_accessibility_browsertest.cc b/content/browser/accessibility/cross_platform_accessibility_browsertest.cc index 9fe99c4..ff5789a 100644 --- a/content/browser/accessibility/cross_platform_accessibility_browsertest.cc +++ b/content/browser/accessibility/cross_platform_accessibility_browsertest.cc @@ -107,7 +107,7 @@ std::string CrossPlatformAccessibilityBrowserTest::GetAttr( if (iter != node.string_attributes.end()) return UTF16ToUTF8(iter->second); else - return ""; + return std::string(); } // Convenience method to get the value of a particular AccessibilityNodeData diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc index 14dbc9a..3248afd 100644 --- a/content/browser/browser_plugin/browser_plugin_guest.cc +++ b/content/browser/browser_plugin/browser_plugin_guest.cc @@ -92,7 +92,7 @@ static std::string RetrieveDownloadURLFromRequestId( ResourceDispatcherHostImpl::Get()->GetURLRequest(global_id); if (url_request) return url_request->url().possibly_invalid_spec(); - return ""; + return std::string(); } } diff --git a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc index 23977a5..94568493 100644 --- a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc +++ b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc @@ -388,7 +388,8 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, TestShortHangTimeoutGuestFactory::GetInstance()); const char kEmbedderURL[] = "files/browser_plugin_embedder_guest_unresponsive.html"; - StartBrowserPluginTest(kEmbedderURL, kHTMLForGuestBusyLoop, true, ""); + StartBrowserPluginTest( + kEmbedderURL, kHTMLForGuestBusyLoop, true, std::string()); // Wait until the busy loop starts. { const string16 expected_title = ASCIIToUTF16("start"); @@ -453,7 +454,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, NavigateAfterResize) { IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AdvanceFocus) { const char kEmbedderURL[] = "files/browser_plugin_focus.html"; const char* kGuestURL = "files/browser_plugin_focus_child.html"; - StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, ""); + StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, std::string()); SimulateMouseClick(test_embedder()->web_contents(), 0, WebKit::WebMouseEvent::ButtonLeft); @@ -484,7 +485,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderChangedAfterSwap) { // 1. Load an embedder page with one guest in it. const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; - StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string()); // 2. Navigate to a URL in https, so we trigger a RenderViewHost swap. GURL test_https_url(https_server.GetURL( @@ -510,7 +511,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderChangedAfterSwap) { // web_contents. IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderSameAfterNav) { const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; - StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string()); WebContentsImpl* embedder_web_contents = test_embedder()->web_contents(); // Navigate to another page in same host and port, so RenderViewHost swap @@ -535,7 +536,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderSameAfterNav) { // This test verifies that hiding the embedder also hides the guest. IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, BrowserPluginVisibilityChanged) { const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; - StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string()); // Hide the Browser Plugin. RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( @@ -549,7 +550,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, BrowserPluginVisibilityChanged) { IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderVisibilityChanged) { const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; - StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string()); // Hide the embedder. test_embedder()->web_contents()->WasHidden(); @@ -561,7 +562,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, EmbedderVisibilityChanged) { // This test verifies that calling the reload method reloads the guest. IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ReloadGuest) { const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; - StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string()); test_guest()->ResetUpdateRectCount(); @@ -575,7 +576,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ReloadGuest) { // to the guest's WebContents. IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, StopGuest) { const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; - StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string()); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); @@ -587,7 +588,8 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, StopGuest) { // plugin correctly updates the touch-event handling state in the embedder. IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AcceptTouchEvents) { const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; - StartBrowserPluginTest(kEmbedderURL, kHTMLForGuestTouchHandler, true, ""); + StartBrowserPluginTest( + kEmbedderURL, kHTMLForGuestTouchHandler, true, std::string()); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); @@ -615,7 +617,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AcceptTouchEvents) { IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, Renavigate) { const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; StartBrowserPluginTest( - kEmbedderURL, GetHTMLForGuestWithTitle("P1"), true, ""); + kEmbedderURL, GetHTMLForGuestWithTitle("P1"), true, std::string()); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); @@ -710,7 +712,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, Renavigate) { // and that the guest is reset. IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ReloadEmbedder) { const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; - StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string()); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); @@ -761,7 +763,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ReloadEmbedder) { IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, TerminateGuest) { const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; - StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string()); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); @@ -776,7 +778,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, TerminateGuest) { IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, BackAfterTerminateGuest) { const char* kEmbedderURL = "files/browser_plugin_embedder.html"; StartBrowserPluginTest( - kEmbedderURL, GetHTMLForGuestWithTitle("P1"), true, ""); + kEmbedderURL, GetHTMLForGuestWithTitle("P1"), true, std::string()); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); @@ -818,7 +820,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, BackAfterTerminateGuest) { IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStart) { const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; - StartBrowserPluginTest(kEmbedderURL, "about:blank", true, ""); + StartBrowserPluginTest(kEmbedderURL, "about:blank", true, std::string()); const string16 expected_title = ASCIIToUTF16(kHTMLForGuest); content::TitleWatcher title_watcher(test_embedder()->web_contents(), @@ -835,7 +837,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStart) { IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadAbort) { const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; - StartBrowserPluginTest(kEmbedderURL, "about:blank", true, ""); + StartBrowserPluginTest(kEmbedderURL, "about:blank", true, std::string()); { // Navigate the guest to "close-socket". @@ -882,7 +884,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadAbort) { IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadRedirect) { const char kEmbedderURL[] = "files/browser_plugin_embedder.html"; - StartBrowserPluginTest(kEmbedderURL, "about:blank", true, ""); + StartBrowserPluginTest(kEmbedderURL, "about:blank", true, std::string()); const string16 expected_title = ASCIIToUTF16("redirected"); content::TitleWatcher title_watcher(test_embedder()->web_contents(), @@ -922,7 +924,8 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadRedirect) { // correctly. IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, MAYBE_AcceptDragEvents) { const char kEmbedderURL[] = "files/browser_plugin_dragging.html"; - StartBrowserPluginTest(kEmbedderURL, kHTMLForGuestAcceptDrag, true, ""); + StartBrowserPluginTest( + kEmbedderURL, kHTMLForGuestAcceptDrag, true, std::string()); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); @@ -978,7 +981,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, PostMessage) { const char* kTesting = "testing123"; const char* kEmbedderURL = "files/browser_plugin_embedder.html"; const char* kGuestURL = "files/browser_plugin_post_message_guest.html"; - StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, ""); + StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, std::string()); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); { @@ -1006,7 +1009,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_PostMessageToIFrame) { const char* kTesting = "testing123"; const char* kEmbedderURL = "files/browser_plugin_embedder.html"; const char* kGuestURL = "files/browser_plugin_post_message_guest.html"; - StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, ""); + StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, std::string()); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); { @@ -1052,7 +1055,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_PostMessageToIFrame) { IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStop) { const char* kEmbedderURL = "files/browser_plugin_embedder.html"; - StartBrowserPluginTest(kEmbedderURL, "about:blank", true, ""); + StartBrowserPluginTest(kEmbedderURL, "about:blank", true, std::string()); const string16 expected_title = ASCIIToUTF16("loadStop"); content::TitleWatcher title_watcher( @@ -1069,7 +1072,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadStop) { IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadCommit) { const char* kEmbedderURL = "files/browser_plugin_embedder.html"; - StartBrowserPluginTest(kEmbedderURL, "about:blank", true, ""); + StartBrowserPluginTest(kEmbedderURL, "about:blank", true, std::string()); const string16 expected_title = ASCIIToUTF16( base::StringPrintf("loadCommit:%s", kHTMLForGuest)); @@ -1105,7 +1108,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, HiddenBeforeNavigation) { // the new guest will inherit the visibility state of the old guest. IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, VisibilityPreservation) { const char* kEmbedderURL = "files/browser_plugin_embedder.html"; - StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string()); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); // Hide the BrowserPlugin. @@ -1145,7 +1148,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, FocusBeforeNavigation) { // crbug.com/170249 IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_FocusPreservation) { const char* kEmbedderURL = "files/browser_plugin_embedder.html"; - StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string()); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>( @@ -1184,7 +1187,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, DISABLED_FocusPreservation) { IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, FocusTracksEmbedder) { const char* kEmbedderURL = "files/browser_plugin_embedder.html"; - StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, std::string()); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>( @@ -1229,7 +1232,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AutoSizeBeforeNavigation) { IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, AutoSizeAfterNavigation) { const char* kEmbedderURL = "files/browser_plugin_embedder.html"; StartBrowserPluginTest( - kEmbedderURL, kHTMLForGuestWithSize, true, ""); + kEmbedderURL, kHTMLForGuestWithSize, true, std::string()); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); @@ -1283,7 +1286,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, GetRenderViewHostAtPositionTest) { IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ChangeWindowName) { const char kEmbedderURL[] = "files/browser_plugin_naming_embedder.html"; const char* kGuestURL = "files/browser_plugin_naming_guest.html"; - StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, ""); + StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, std::string()); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); diff --git a/content/browser/database_browsertest.cc b/content/browser/database_browsertest.cc index 48f7304..29030ad 100644 --- a/content/browser/database_browsertest.cc +++ b/content/browser/database_browsertest.cc @@ -102,7 +102,7 @@ IN_PROC_BROWSER_TEST_F(DatabaseTest, DeleteRecord) { CreateTable(shell()); InsertRecord(shell(), "text"); DeleteRecord(shell(), 0); - CompareRecords(shell(), ""); + CompareRecords(shell(), std::string()); InsertRecord(shell(), "0"); InsertRecord(shell(), "1"); @@ -151,12 +151,12 @@ IN_PROC_BROWSER_TEST_F(DatabaseTest, DatabaseOperations) { for (int i = 0; i < 10; ++i) DeleteRecord(shell(), 0); - CompareRecords(shell(), ""); + CompareRecords(shell(), std::string()); RunScriptAndCheckResult( shell(), "deleteRecord(1)", "could not find row with index: 1"); - CompareRecords(shell(), ""); + CompareRecords(shell(), std::string()); } // Create records in the database and verify they persist after reload. @@ -186,7 +186,7 @@ IN_PROC_BROWSER_TEST_F(DatabaseTest, OffTheRecordCannotReadRegularDatabase) { ASSERT_FALSE(HasTable(otr)); CreateTable(otr); - CompareRecords(otr, ""); + CompareRecords(otr, std::string()); } // Attempt to read a database created in an off the record browser from a @@ -200,7 +200,7 @@ IN_PROC_BROWSER_TEST_F(DatabaseTest, RegularCannotReadOffTheRecordDatabase) { Navigate(shell()); ASSERT_FALSE(HasTable(shell())); CreateTable(shell()); - CompareRecords(shell(), ""); + CompareRecords(shell(), std::string()); } // Verify DB changes within first window are present in the second window. diff --git a/content/browser/devtools/devtools_http_handler_impl.cc b/content/browser/devtools/devtools_http_handler_impl.cc index 414785e..4869c2b 100644 --- a/content/browser/devtools/devtools_http_handler_impl.cc +++ b/content/browser/devtools/devtools_http_handler_impl.cc @@ -459,7 +459,7 @@ void DevToolsHttpHandlerImpl::OnJsonRequestUI( content::GetContentClient()->GetProduct()); version.SetString("User-Agent", webkit_glue::GetUserAgent(GURL(chrome::kAboutBlankURL))); - SendJson(connection_id, net::HTTP_OK, &version, ""); + SendJson(connection_id, net::HTTP_OK, &version, std::string()); return; } @@ -506,7 +506,7 @@ void DevToolsHttpHandlerImpl::OnJsonRequestUI( } std::string host = info.headers["Host"]; scoped_ptr<base::DictionaryValue> dictionary(SerializePageInfo(rvh, host)); - SendJson(connection_id, net::HTTP_OK, dictionary.get(), ""); + SendJson(connection_id, net::HTTP_OK, dictionary.get(), std::string()); return; } @@ -552,7 +552,7 @@ void DevToolsHttpHandlerImpl::CollectWorkerInfo(ListValue* target_list, void DevToolsHttpHandlerImpl::SendTargetList(int connection_id, ListValue* target_list) { - SendJson(connection_id, net::HTTP_OK, target_list, ""); + SendJson(connection_id, net::HTTP_OK, target_list, std::string()); delete target_list; Release(); // Balanced OnJsonRequestUI. } diff --git a/content/browser/devtools/devtools_http_handler_unittest.cc b/content/browser/devtools/devtools_http_handler_unittest.cc index 839ef60..c926015 100644 --- a/content/browser/devtools/devtools_http_handler_unittest.cc +++ b/content/browser/devtools/devtools_http_handler_unittest.cc @@ -56,20 +56,20 @@ class DummyListenSocketFactory : public net::StreamListenSocketFactory { class DummyDelegate : public DevToolsHttpHandlerDelegate { public: - virtual std::string GetDiscoveryPageHTML() OVERRIDE { return ""; } + virtual std::string GetDiscoveryPageHTML() OVERRIDE { return std::string(); } virtual bool BundlesFrontendResources() OVERRIDE { return true; } virtual base::FilePath GetDebugFrontendDir() OVERRIDE { return base::FilePath(); } virtual std::string GetPageThumbnailData(const GURL& url) OVERRIDE { - return ""; + return std::string(); } virtual RenderViewHost* CreateNewTarget() OVERRIDE { return NULL; } virtual TargetType GetTargetType(RenderViewHost*) OVERRIDE { return kTargetTypeTab; } virtual std::string GetViewDescription(content::RenderViewHost*) OVERRIDE { - return ""; + return std::string(); } }; @@ -98,9 +98,9 @@ TEST_F(DevToolsHttpHandlerTest, TestStartStop) { base::RunLoop run_loop, run_loop_2; content::DevToolsHttpHandler* devtools_http_handler_ = content::DevToolsHttpHandler::Start( - new DummyListenSocketFactory( - run_loop.QuitClosure(), run_loop_2.QuitClosure()), - "", + new DummyListenSocketFactory(run_loop.QuitClosure(), + run_loop_2.QuitClosure()), + std::string(), new DummyDelegate()); // Our dummy socket factory will post a quit message once the server will // become ready. diff --git a/content/browser/devtools/renderer_overrides_handler.cc b/content/browser/devtools/renderer_overrides_handler.cc index 94395d1..f7db2e8 100644 --- a/content/browser/devtools/renderer_overrides_handler.cc +++ b/content/browser/devtools/renderer_overrides_handler.cc @@ -145,8 +145,8 @@ RendererOverridesHandler::PageNavigate( if (host) { WebContents* web_contents = host->GetDelegate()->GetAsWebContents(); if (web_contents) { - web_contents->GetController().LoadURL( - gurl, Referrer(), PAGE_TRANSITION_TYPED, ""); + web_contents->GetController() + .LoadURL(gurl, Referrer(), PAGE_TRANSITION_TYPED, std::string()); return command->SuccessResponse(new base::DictionaryValue()); } } diff --git a/content/browser/download/base_file.cc b/content/browser/download/base_file.cc index b5ded45..0b1db97 100644 --- a/content/browser/download/base_file.cc +++ b/content/browser/download/base_file.cc @@ -232,11 +232,11 @@ bool BaseFile::GetHash(std::string* hash) { std::string BaseFile::GetHashState() { if (!calculate_hash_) - return ""; + return std::string(); Pickle hash_state; if (!secure_hash_->Serialize(&hash_state)) - return ""; + return std::string(); return std::string(reinterpret_cast<const char*>(hash_state.data()), hash_state.size()); diff --git a/content/browser/download/base_file_unittest.cc b/content/browser/download/base_file_unittest.cc index 799076d..0e6239f 100644 --- a/content/browser/download/base_file_unittest.cc +++ b/content/browser/download/base_file_unittest.cc @@ -54,7 +54,7 @@ class BaseFileTest : public testing::Test { GURL(), 0, false, - "", + std::string(), scoped_ptr<net::FileStream>(), net::BoundNetLog())); } @@ -105,7 +105,7 @@ class BaseFileTest : public testing::Test { GURL(), 0, true, - "", + std::string(), scoped_ptr<net::FileStream>(), net::BoundNetLog())); } @@ -145,7 +145,7 @@ class BaseFileTest : public testing::Test { GURL(), 0, false, - "", + std::string(), scoped_ptr<net::FileStream>(), net::BoundNetLog()); @@ -171,7 +171,7 @@ class BaseFileTest : public testing::Test { GURL(), 0, false, - "", + std::string(), scoped_ptr<net::FileStream>(), net::BoundNetLog()); EXPECT_EQ(DOWNLOAD_INTERRUPT_REASON_NONE, @@ -503,7 +503,7 @@ TEST_F(BaseFileTest, MultipleWritesWithError) { GURL(), 0, false, - "", + std::string(), mock_file_stream_scoped_ptr.Pass(), net::BoundNetLog())); ASSERT_TRUE(InitializeFile()); @@ -550,7 +550,7 @@ TEST_F(BaseFileTest, AppendToBaseFile) { GURL(), kTestDataLength4, false, - "", + std::string(), scoped_ptr<net::FileStream>(), net::BoundNetLog())); @@ -584,7 +584,7 @@ TEST_F(BaseFileTest, ReadonlyBaseFile) { GURL(), 0, false, - "", + std::string(), scoped_ptr<net::FileStream>(), net::BoundNetLog())); @@ -609,7 +609,7 @@ TEST_F(BaseFileTest, IsEmptyHash) { EXPECT_TRUE(BaseFile::IsEmptyHash(empty)); std::string not_empty(BaseFile::kSha256HashLen, '\x01'); EXPECT_FALSE(BaseFile::IsEmptyHash(not_empty)); - EXPECT_FALSE(BaseFile::IsEmptyHash("")); + EXPECT_FALSE(BaseFile::IsEmptyHash(std::string())); } // Test that calculating speed after no writes. diff --git a/content/browser/download/download_file_impl.cc b/content/browser/download/download_file_impl.cc index ab95900..a16fbe8 100644 --- a/content/browser/download/download_file_impl.cc +++ b/content/browser/download/download_file_impl.cc @@ -108,8 +108,8 @@ void DownloadFileImpl::RenameAndUniquify( base::FilePath new_path(full_path); - int uniquifier = - file_util::GetUniquePathNumber(new_path, FILE_PATH_LITERAL("")); + int uniquifier = file_util::GetUniquePathNumber( + new_path, FILE_PATH_LITERAL(std::string())); if (uniquifier > 0) { new_path = new_path.InsertBeforeExtensionASCII( base::StringPrintf(" (%d)", uniquifier)); diff --git a/content/browser/download/download_item_impl_unittest.cc b/content/browser/download/download_item_impl_unittest.cc index 83b0cf0..caee4ae 100644 --- a/content/browser/download/download_item_impl_unittest.cc +++ b/content/browser/download/download_item_impl_unittest.cc @@ -344,7 +344,7 @@ TEST_F(DownloadItemTest, NotificationAfterUpdate) { DownloadItemImpl* item = CreateDownloadItem(); MockObserver observer(item); - item->UpdateProgress(kDownloadChunkSize, kDownloadSpeed, ""); + item->UpdateProgress(kDownloadChunkSize, kDownloadSpeed, std::string()); ASSERT_TRUE(observer.CheckUpdated()); EXPECT_EQ(kDownloadSpeed, item->CurrentSpeed()); } @@ -545,7 +545,7 @@ TEST_F(DownloadItemTest, NotificationAfterOnContentCheckCompleted) { DownloadItemImpl* safe_item = CreateDownloadItem(); MockObserver safe_observer(safe_item); - safe_item->OnAllDataSaved(""); + safe_item->OnAllDataSaved(std::string()); EXPECT_TRUE(safe_observer.CheckUpdated()); safe_item->OnContentCheckCompleted(DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS); EXPECT_TRUE(safe_observer.CheckUpdated()); @@ -555,7 +555,7 @@ TEST_F(DownloadItemTest, NotificationAfterOnContentCheckCompleted) { CreateDownloadItem(); MockObserver unsafeurl_observer(unsafeurl_item); - unsafeurl_item->OnAllDataSaved(""); + unsafeurl_item->OnAllDataSaved(std::string()); EXPECT_TRUE(unsafeurl_observer.CheckUpdated()); unsafeurl_item->OnContentCheckCompleted(DOWNLOAD_DANGER_TYPE_DANGEROUS_URL); EXPECT_TRUE(unsafeurl_observer.CheckUpdated()); @@ -567,7 +567,7 @@ TEST_F(DownloadItemTest, NotificationAfterOnContentCheckCompleted) { CreateDownloadItem(); MockObserver unsafefile_observer(unsafefile_item); - unsafefile_item->OnAllDataSaved(""); + unsafefile_item->OnAllDataSaved(std::string()); EXPECT_TRUE(unsafefile_observer.CheckUpdated()); unsafefile_item->OnContentCheckCompleted(DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE); EXPECT_TRUE(unsafefile_observer.CheckUpdated()); @@ -697,7 +697,7 @@ TEST_F(DownloadItemTest, CallbackAfterRename) { .WillOnce(ScheduleRenameCallback(DOWNLOAD_INTERRUPT_REASON_NONE, final_path)); EXPECT_CALL(*download_file, Detach()); - item->DestinationObserverAsWeakPtr()->DestinationCompleted(""); + item->DestinationObserverAsWeakPtr()->DestinationCompleted(std::string()); RunAllPendingInMessageLoops(); ::testing::Mock::VerifyAndClearExpectations(download_file); mock_delegate()->VerifyAndClearExpectations(); @@ -862,7 +862,7 @@ TEST_F(DownloadItemTest, EnabledActionsForNormalDownload) { EXPECT_CALL(*mock_delegate(), ShouldCompleteDownload(item, _)) .WillOnce(Return(true)); EXPECT_CALL(*download_file, Detach()); - item->DestinationObserverAsWeakPtr()->DestinationCompleted(""); + item->DestinationObserverAsWeakPtr()->DestinationCompleted(std::string()); RunAllPendingInMessageLoops(); ASSERT_TRUE(item->IsComplete()); @@ -889,7 +889,7 @@ TEST_F(DownloadItemTest, EnabledActionsForTemporaryDownload) { .WillOnce(ScheduleRenameCallback(DOWNLOAD_INTERRUPT_REASON_NONE, base::FilePath(kDummyPath))); EXPECT_CALL(*download_file, Detach()); - item->DestinationObserverAsWeakPtr()->DestinationCompleted(""); + item->DestinationObserverAsWeakPtr()->DestinationCompleted(std::string()); RunAllPendingInMessageLoops(); ASSERT_TRUE(item->IsComplete()); @@ -937,7 +937,7 @@ TEST_F(DownloadItemTest, CompleteDelegate_ReturnTrue) { // Drive the delegate interaction. EXPECT_CALL(*mock_delegate(), ShouldCompleteDownload(item, _)) .WillOnce(Return(true)); - item->DestinationObserverAsWeakPtr()->DestinationCompleted(""); + item->DestinationObserverAsWeakPtr()->DestinationCompleted(std::string()); EXPECT_EQ(DownloadItem::IN_PROGRESS, item->GetState()); EXPECT_FALSE(item->IsDangerous()); @@ -966,7 +966,7 @@ TEST_F(DownloadItemTest, CompleteDelegate_BlockOnce) { .WillOnce(DoAll(SaveArg<1>(&delegate_callback), Return(false))) .WillOnce(Return(true)); - item->DestinationObserverAsWeakPtr()->DestinationCompleted(""); + item->DestinationObserverAsWeakPtr()->DestinationCompleted(std::string()); ASSERT_FALSE(delegate_callback.is_null()); copy_delegate_callback = delegate_callback; delegate_callback.Reset(); @@ -1001,7 +1001,7 @@ TEST_F(DownloadItemTest, CompleteDelegate_SetDanger) { .WillOnce(DoAll(SaveArg<1>(&delegate_callback), Return(false))) .WillOnce(Return(true)); - item->DestinationObserverAsWeakPtr()->DestinationCompleted(""); + item->DestinationObserverAsWeakPtr()->DestinationCompleted(std::string()); ASSERT_FALSE(delegate_callback.is_null()); copy_delegate_callback = delegate_callback; delegate_callback.Reset(); @@ -1047,7 +1047,7 @@ TEST_F(DownloadItemTest, CompleteDelegate_BlockTwice) { .WillOnce(DoAll(SaveArg<1>(&delegate_callback), Return(false))) .WillOnce(Return(true)); - item->DestinationObserverAsWeakPtr()->DestinationCompleted(""); + item->DestinationObserverAsWeakPtr()->DestinationCompleted(std::string()); ASSERT_FALSE(delegate_callback.is_null()); copy_delegate_callback = delegate_callback; delegate_callback.Reset(); diff --git a/content/browser/download/download_manager_impl_unittest.cc b/content/browser/download/download_manager_impl_unittest.cc index 4a33159..e08402e 100644 --- a/content/browser/download/download_manager_impl_unittest.cc +++ b/content/browser/download/download_manager_impl_unittest.cc @@ -169,7 +169,9 @@ class MockDownloadItemImpl : public DownloadItemImpl { MOCK_CONST_METHOD0(GetUserVerifiedFilePath, base::FilePath()); MOCK_METHOD0(NotifyRemoved, void()); // May be called when vlog is on. - virtual std::string DebugString(bool verbose) const OVERRIDE { return ""; } + virtual std::string DebugString(bool verbose) const OVERRIDE { + return std::string(); + } }; class MockDownloadManagerDelegate : public DownloadManagerDelegate { diff --git a/content/browser/download/download_stats.cc b/content/browser/download/download_stats.cc index cad6cbe..e13200e 100644 --- a/content/browser/download/download_stats.cc +++ b/content/browser/download/download_stats.cc @@ -305,8 +305,8 @@ void RecordDownloadContentDisposition( const std::string& content_disposition_string) { if (content_disposition_string.empty()) return; - net::HttpContentDisposition content_disposition( - content_disposition_string, ""); + net::HttpContentDisposition content_disposition(content_disposition_string, + std::string()); int result = content_disposition.parse_result_flags(); bool is_valid = !content_disposition.filename().empty(); diff --git a/content/browser/download/save_file.cc b/content/browser/download/save_file.cc index 3e7f7bd..80caf13 100644 --- a/content/browser/download/save_file.cc +++ b/content/browser/download/save_file.cc @@ -20,7 +20,7 @@ SaveFile::SaveFile(const SaveFileCreateInfo* info, bool calculate_hash) GURL(), 0, calculate_hash, - "", + std::string(), scoped_ptr<net::FileStream>(), net::BoundNetLog()), info_(info) { diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc index cbff60a..f97d2d6 100644 --- a/content/browser/download/save_package.cc +++ b/content/browser/download/save_package.cc @@ -365,7 +365,7 @@ void SavePackage::OnMHTMLGenerated(const base::FilePath& path, int64 size) { // with SavePackage flow. if (download_->IsInProgress()) { download_->SetTotalBytes(size); - download_->UpdateProgress(size, 0, ""); + download_->UpdateProgress(size, 0, std::string()); // Must call OnAllDataSaved here in order for // GDataDownloadObserver::ShouldUpload() to return true. // ShouldCompleteDownload() may depend on the gdata uploader to finish. @@ -449,7 +449,11 @@ bool SavePackage::GenerateFileName(const std::string& disposition, base::FilePath::StringType* generated_name) { // TODO(jungshik): Figure out the referrer charset when having one // makes sense and pass it to GenerateFileName. - base::FilePath file_path = net::GenerateFileName(url, disposition, "", "", "", + base::FilePath file_path = net::GenerateFileName(url, + disposition, + std::string(), + std::string(), + std::string(), kDefaultSaveName); DCHECK(!file_path.empty()); @@ -788,7 +792,8 @@ void SavePackage::Finish() { // with SavePackage flow. if (download_->IsInProgress()) { if (save_type_ != SAVE_PAGE_TYPE_AS_MHTML) { - download_->UpdateProgress(all_save_items_count_, CurrentSpeed(), ""); + download_->UpdateProgress( + all_save_items_count_, CurrentSpeed(), std::string()); download_->OnAllDataSaved(DownloadItem::kEmptyFileHash); } download_->MarkAsComplete(); @@ -818,7 +823,7 @@ void SavePackage::SaveFinished(int32 save_id, int64 size, bool is_success) { // TODO(rdsmith/benjhayden): Integrate canceling on DownloadItem // with SavePackage flow. if (download_ && download_->IsInProgress()) - download_->UpdateProgress(completed_count(), CurrentSpeed(), ""); + download_->UpdateProgress(completed_count(), CurrentSpeed(), std::string()); if (save_item->save_source() == SaveFileCreateInfo::SAVE_FILE_FROM_DOM && save_item->url() == page_url_ && !save_item->received_bytes()) { @@ -863,7 +868,7 @@ void SavePackage::SaveFailed(const GURL& save_url) { // TODO(rdsmith/benjhayden): Integrate canceling on DownloadItem // with SavePackage flow. if (download_ && download_->IsInProgress()) - download_->UpdateProgress(completed_count(), CurrentSpeed(), ""); + download_->UpdateProgress(completed_count(), CurrentSpeed(), std::string()); if ((save_type_ == SAVE_PAGE_TYPE_AS_ONLY_HTML) || (save_type_ == SAVE_PAGE_TYPE_AS_MHTML) || diff --git a/content/browser/download/save_package_unittest.cc b/content/browser/download/save_package_unittest.cc index b5a07ae..e40af08 100644 --- a/content/browser/download/save_package_unittest.cc +++ b/content/browser/download/save_package_unittest.cc @@ -221,20 +221,21 @@ TEST_F(SavePackageTest, MAYBE_TestLongSavePackageFilename) { base::FilePath::StringType filename; // Test that the filename is successfully shortened to fit. - ASSERT_TRUE(GetGeneratedFilename(true, "", url, false, &filename)); + ASSERT_TRUE(GetGeneratedFilename(true, std::string(), url, false, &filename)); EXPECT_TRUE(filename.length() < long_file.length()); EXPECT_FALSE(HasOrdinalNumber(filename)); // Test that the filename is successfully shortened to fit, and gets an // an ordinal appended. - ASSERT_TRUE(GetGeneratedFilename(true, "", url, false, &filename)); + ASSERT_TRUE(GetGeneratedFilename(true, std::string(), url, false, &filename)); EXPECT_TRUE(filename.length() < long_file.length()); EXPECT_TRUE(HasOrdinalNumber(filename)); // Test that the filename is successfully shortened to fit, and gets a // different ordinal appended. base::FilePath::StringType filename2; - ASSERT_TRUE(GetGeneratedFilename(true, "", url, false, &filename2)); + ASSERT_TRUE( + GetGeneratedFilename(true, std::string(), url, false, &filename2)); EXPECT_TRUE(filename2.length() < long_file.length()); EXPECT_TRUE(HasOrdinalNumber(filename2)); EXPECT_NE(filename, filename2); diff --git a/content/browser/geolocation/network_location_provider_unittest.cc b/content/browser/geolocation/network_location_provider_unittest.cc index fb01795..3b91466 100644 --- a/content/browser/geolocation/network_location_provider_unittest.cc +++ b/content/browser/geolocation/network_location_provider_unittest.cc @@ -344,7 +344,7 @@ TEST_F(GeolocationNetworkProviderTest, StartProvider) { EXPECT_TRUE(provider->StartProvider(false)); net::TestURLFetcher* fetcher = get_url_fetcher_and_advance_id(); ASSERT_TRUE(fetcher != NULL); - CheckRequestIsValid(*fetcher, 0, 0, 0, ""); + CheckRequestIsValid(*fetcher, 0, 0, 0, std::string()); } TEST_F(GeolocationNetworkProviderTest, StartProviderDefaultUrl) { @@ -353,10 +353,9 @@ TEST_F(GeolocationNetworkProviderTest, StartProviderDefaultUrl) { EXPECT_TRUE(provider->StartProvider(false)); net::TestURLFetcher* fetcher = get_url_fetcher_and_advance_id(); ASSERT_TRUE(fetcher != NULL); - CheckRequestIsValid(*fetcher, 0, 0, 0, ""); + CheckRequestIsValid(*fetcher, 0, 0, 0, std::string()); } - TEST_F(GeolocationNetworkProviderTest, StartProviderLongRequest) { scoped_ptr<LocationProviderBase> provider(CreateProvider(true)); EXPECT_TRUE(provider->StartProvider(false)); @@ -369,7 +368,7 @@ TEST_F(GeolocationNetworkProviderTest, StartProviderLongRequest) { // in length by not including access points with the lowest signal strength // in the request. EXPECT_LT(fetcher->GetOriginalURL().spec().size(), size_t(2048)); - CheckRequestIsValid(*fetcher, 0, 16, 4, ""); + CheckRequestIsValid(*fetcher, 0, 16, 4, std::string()); } TEST_F(GeolocationNetworkProviderTest, MultiRegistrations) { @@ -418,7 +417,7 @@ TEST_F(GeolocationNetworkProviderTest, MultipleWifiScansComplete) { fetcher = get_url_fetcher_and_advance_id(); ASSERT_TRUE(fetcher != NULL); // The request should have the wifi data. - CheckRequestIsValid(*fetcher, 0, kFirstScanAps, 0, ""); + CheckRequestIsValid(*fetcher, 0, kFirstScanAps, 0, std::string()); // Send a reply with good position fix. const char* kReferenceNetworkResponse = @@ -472,7 +471,7 @@ TEST_F(GeolocationNetworkProviderTest, MultipleWifiScansComplete) { fetcher->set_url(test_server_url_); fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::FAILED, -1)); fetcher->set_response_code(200); // should be ignored - fetcher->SetResponseString(""); + fetcher->SetResponseString(std::string()); fetcher->delegate()->OnURLFetchComplete(fetcher); // Error means we now no longer have a fix. diff --git a/content/browser/geolocation/wifi_data_provider_linux.cc b/content/browser/geolocation/wifi_data_provider_linux.cc index 709063a..c8d68ac 100644 --- a/content/browser/geolocation/wifi_data_provider_linux.cc +++ b/content/browser/geolocation/wifi_data_provider_linux.cc @@ -270,7 +270,7 @@ bool NetworkManagerWlanApi::GetAccessPointsForAdapter( continue; } - ReplaceSubstringsAfterOffset(&mac, 0U, ":", ""); + ReplaceSubstringsAfterOffset(&mac, 0U, ":", std::string()); std::vector<uint8> mac_bytes; if (!base::HexStringToBytes(mac, &mac_bytes) || mac_bytes.size() != 6) { LOG(WARNING) << "Can't parse mac address (found " << mac_bytes.size() diff --git a/content/browser/gpu/gpu_control_list.cc b/content/browser/gpu/gpu_control_list.cc index 3592505..0fba7c8 100644 --- a/content/browser/gpu/gpu_control_list.cc +++ b/content/browser/gpu/gpu_control_list.cc @@ -217,8 +217,8 @@ GpuControlList::OsInfo::OsInfo(const std::string& os, const std::string& version_string2) { type_ = StringToOsType(os); if (type_ != kOsUnknown) { - version_info_.reset( - new VersionInfo(version_op, "", version_string, version_string2)); + version_info_.reset(new VersionInfo( + version_op, std::string(), version_string, version_string2)); } } @@ -265,8 +265,8 @@ GpuControlList::MachineModelInfo::MachineModelInfo( const std::string& version_string, const std::string& version_string2) { name_info_.reset(new StringInfo(name_op, name_value)); - version_info_.reset( - new VersionInfo(version_op, "", version_string, version_string2)); + version_info_.reset(new VersionInfo( + version_op, std::string(), version_string, version_string2)); } GpuControlList::MachineModelInfo::~MachineModelInfo() {} @@ -864,7 +864,7 @@ bool GpuControlList::GpuControlListEntry::SetDriverDateInfo( const std::string& date_string, const std::string& date_string2) { driver_date_info_.reset( - new VersionInfo(date_op, "", date_string, date_string2)); + new VersionInfo(date_op, std::string(), date_string, date_string2)); return driver_date_info_->IsValid(); } @@ -1348,8 +1348,8 @@ GpuControlList::IsEntrySupportedByCurrentBrowserVersion( browser_version_value->GetString("number", &version_string); browser_version_value->GetString("number2", &version_string2); scoped_ptr<VersionInfo> browser_version_info; - browser_version_info.reset( - new VersionInfo(version_op, "", version_string, version_string2)); + browser_version_info.reset(new VersionInfo( + version_op, std::string(), version_string, version_string2)); if (!browser_version_info->IsValid()) return kMalformed; if (browser_version_info->Contains(browser_version_)) diff --git a/content/browser/gpu/gpu_control_list_machine_model_info_unittest.cc b/content/browser/gpu/gpu_control_list_machine_model_info_unittest.cc index b8c3b1f..8d00a33 100644 --- a/content/browser/gpu/gpu_control_list_machine_model_info_unittest.cc +++ b/content/browser/gpu/gpu_control_list_machine_model_info_unittest.cc @@ -47,8 +47,7 @@ TEST_F(MachineModelInfoTest, ValidModelInfo) { } TEST_F(MachineModelInfoTest, ModelComparison) { - MachineModelInfo info("=", "model_a", - ">", "3.4", ""); + MachineModelInfo info("=", "model_a", ">", "3.4", std::string()); EXPECT_TRUE(info.Contains("model_a", "4")); EXPECT_FALSE(info.Contains("model_b", "4")); EXPECT_FALSE(info.Contains("model_a", "3.2")); diff --git a/content/browser/gpu/gpu_control_list_number_info_unittest.cc b/content/browser/gpu/gpu_control_list_number_info_unittest.cc index f4e0ba6..0cb72a7 100644 --- a/content/browser/gpu/gpu_control_list_number_info_unittest.cc +++ b/content/browser/gpu/gpu_control_list_number_info_unittest.cc @@ -46,7 +46,7 @@ TEST_F(NumberInfoTest, ValidFloatInfo) { "-2.14", }; for (size_t i = 0; i < arraysize(value); ++i) { - FloatInfo info("=", value[i], ""); + FloatInfo info("=", value[i], std::string()); EXPECT_TRUE(info.IsValid()); } } @@ -60,11 +60,11 @@ TEST_F(NumberInfoTest, InvalidFloatInfo) { ">=", }; for (size_t i = 0; i < arraysize(op); ++i) { - FloatInfo info(op[i], "", ""); + FloatInfo info(op[i], std::string(), std::string()); EXPECT_FALSE(info.IsValid()); } { - FloatInfo info("between", "3.14", ""); + FloatInfo info("between", "3.14", std::string()); EXPECT_FALSE(info.IsValid()); } const std::string value[] = { @@ -75,33 +75,33 @@ TEST_F(NumberInfoTest, InvalidFloatInfo) { "- 2.14", }; for (size_t i = 0; i < arraysize(value); ++i) { - FloatInfo info("=", value[i], ""); + FloatInfo info("=", value[i], std::string()); EXPECT_FALSE(info.IsValid()); } } TEST_F(NumberInfoTest, FloatComparison) { { - FloatInfo info("=", "3.14", ""); + FloatInfo info("=", "3.14", std::string()); EXPECT_TRUE(info.Contains(3.14f)); EXPECT_TRUE(info.Contains(3.1400f)); EXPECT_FALSE(info.Contains(3.1f)); EXPECT_FALSE(info.Contains(3)); } { - FloatInfo info(">", "3.14", ""); + FloatInfo info(">", "3.14", std::string()); EXPECT_FALSE(info.Contains(3.14f)); EXPECT_TRUE(info.Contains(3.141f)); EXPECT_FALSE(info.Contains(3.1f)); } { - FloatInfo info("<=", "3.14", ""); + FloatInfo info("<=", "3.14", std::string()); EXPECT_TRUE(info.Contains(3.14f)); EXPECT_FALSE(info.Contains(3.141f)); EXPECT_TRUE(info.Contains(3.1f)); } { - FloatInfo info("any", "", ""); + FloatInfo info("any", std::string(), std::string()); EXPECT_TRUE(info.Contains(3.14f)); } { @@ -140,7 +140,7 @@ TEST_F(NumberInfoTest, ValidIntInfo) { "-12", }; for (size_t i = 0; i < arraysize(value); ++i) { - IntInfo info("=", value[i], ""); + IntInfo info("=", value[i], std::string()); EXPECT_TRUE(info.IsValid()); } } @@ -154,11 +154,11 @@ TEST_F(NumberInfoTest, InvalidIntInfo) { ">=", }; for (size_t i = 0; i < arraysize(op); ++i) { - IntInfo info(op[i], "", ""); + IntInfo info(op[i], std::string(), std::string()); EXPECT_FALSE(info.IsValid()); } { - IntInfo info("between", "3", ""); + IntInfo info("between", "3", std::string()); EXPECT_FALSE(info.IsValid()); } const std::string value[] = { @@ -169,31 +169,31 @@ TEST_F(NumberInfoTest, InvalidIntInfo) { "3.14" }; for (size_t i = 0; i < arraysize(value); ++i) { - IntInfo info("=", value[i], ""); + IntInfo info("=", value[i], std::string()); EXPECT_FALSE(info.IsValid()); } } TEST_F(NumberInfoTest, IntComparison) { { - IntInfo info("=", "3", ""); + IntInfo info("=", "3", std::string()); EXPECT_TRUE(info.Contains(3)); EXPECT_FALSE(info.Contains(4)); } { - IntInfo info(">", "3", ""); + IntInfo info(">", "3", std::string()); EXPECT_FALSE(info.Contains(2)); EXPECT_FALSE(info.Contains(3)); EXPECT_TRUE(info.Contains(4)); } { - IntInfo info("<=", "3", ""); + IntInfo info("<=", "3", std::string()); EXPECT_TRUE(info.Contains(2)); EXPECT_TRUE(info.Contains(3)); EXPECT_FALSE(info.Contains(4)); } { - IntInfo info("any", "", ""); + IntInfo info("any", std::string(), std::string()); EXPECT_TRUE(info.Contains(3)); } { diff --git a/content/browser/gpu/gpu_control_list_os_info_unittest.cc b/content/browser/gpu/gpu_control_list_os_info_unittest.cc index 8aefb03..5ea03b2 100644 --- a/content/browser/gpu/gpu_control_list_os_info_unittest.cc +++ b/content/browser/gpu/gpu_control_list_os_info_unittest.cc @@ -33,12 +33,12 @@ TEST_F(OsInfoTest, ValidOsInfo) { GpuControlList::kOsAny }; for (size_t i = 0; i < arraysize(os); ++i) { - OsInfo info(os[i], "=", "10.6", ""); + OsInfo info(os[i], "=", "10.6", std::string()); EXPECT_TRUE(info.IsValid()); EXPECT_EQ(os_type[i], info.type()); } { - OsInfo info("any", "any", "", ""); + OsInfo info("any", "any", std::string(), std::string()); EXPECT_TRUE(info.IsValid()); } } @@ -54,15 +54,15 @@ TEST_F(OsInfoTest, InvalidOsInfo) { }; for (size_t i = 0; i < arraysize(os); ++i) { { - OsInfo info(os[i], "", "", ""); + OsInfo info(os[i], std::string(), std::string(), std::string()); EXPECT_FALSE(info.IsValid()); } { - OsInfo info(os[i], "=", "", ""); + OsInfo info(os[i], "=", std::string(), std::string()); EXPECT_FALSE(info.IsValid()); } { - OsInfo info(os[i], "", "10.6", ""); + OsInfo info(os[i], std::string(), "10.6", std::string()); EXPECT_FALSE(info.IsValid()); } } @@ -74,34 +74,32 @@ TEST_F(OsInfoTest, InvalidOsInfo) { "Android", }; for (size_t i = 0; i < arraysize(os_cap); ++i) { - OsInfo info(os_cap[i], "=", "10.6", ""); + OsInfo info(os_cap[i], "=", "10.6", std::string()); EXPECT_FALSE(info.IsValid()); } } TEST_F(OsInfoTest, OsComparison) { { - OsInfo info("any", "any", "", ""); + OsInfo info("any", "any", std::string(), std::string()); const GpuControlList::OsType os_type[] = { - GpuControlList::kOsWin, - GpuControlList::kOsLinux, - GpuControlList::kOsMacosx, - GpuControlList::kOsChromeOS, + GpuControlList::kOsWin, GpuControlList::kOsLinux, + GpuControlList::kOsMacosx, GpuControlList::kOsChromeOS, GpuControlList::kOsAndroid, }; for (size_t i = 0; i < arraysize(os_type); ++i) { - EXPECT_TRUE(info.Contains(os_type[i], "")); + EXPECT_TRUE(info.Contains(os_type[i], std::string())); EXPECT_TRUE(info.Contains(os_type[i], "7.8")); } } { - OsInfo info("win", ">=", "6", ""); + OsInfo info("win", ">=", "6", std::string()); EXPECT_FALSE(info.Contains(GpuControlList::kOsMacosx, "10.8.3")); EXPECT_FALSE(info.Contains(GpuControlList::kOsLinux, "10")); EXPECT_FALSE(info.Contains(GpuControlList::kOsChromeOS, "13")); EXPECT_FALSE(info.Contains(GpuControlList::kOsAndroid, "7")); EXPECT_FALSE(info.Contains(GpuControlList::kOsAny, "7")); - EXPECT_FALSE(info.Contains(GpuControlList::kOsWin, "")); + EXPECT_FALSE(info.Contains(GpuControlList::kOsWin, std::string())); EXPECT_TRUE(info.Contains(GpuControlList::kOsWin, "6")); EXPECT_TRUE(info.Contains(GpuControlList::kOsWin, "6.1")); EXPECT_TRUE(info.Contains(GpuControlList::kOsWin, "7")); diff --git a/content/browser/gpu/gpu_control_list_string_info_unittest.cc b/content/browser/gpu/gpu_control_list_string_info_unittest.cc index 43bb952..c2c8009 100644 --- a/content/browser/gpu/gpu_control_list_string_info_unittest.cc +++ b/content/browser/gpu/gpu_control_list_string_info_unittest.cc @@ -24,7 +24,7 @@ TEST_F(StringInfoTest, ValidStringInfo) { }; for (size_t i = 0; i < arraysize(op); ++i) { { - StringInfo info(op[i], ""); + StringInfo info(op[i], std::string()); EXPECT_TRUE(info.IsValid()); } { diff --git a/content/browser/gpu/gpu_control_list_version_info_unittest.cc b/content/browser/gpu/gpu_control_list_version_info_unittest.cc index f05d71c..eb18648 100644 --- a/content/browser/gpu/gpu_control_list_version_info_unittest.cc +++ b/content/browser/gpu/gpu_control_list_version_info_unittest.cc @@ -32,7 +32,7 @@ TEST_F(VersionInfoTest, ValidVersionInfo) { string1 = "8.9"; if (op[i] == "between") string2 = "9.0"; - VersionInfo info(op[i], "", string1, string2); + VersionInfo info(op[i], std::string(), string1, string2); EXPECT_TRUE(info.IsValid()); } @@ -42,7 +42,7 @@ TEST_F(VersionInfoTest, ValidVersionInfo) { "" // Default, same as "numerical" }; for (size_t i =0; i < arraysize(style); ++i) { - VersionInfo info("=", style[i], "8.9", ""); + VersionInfo info("=", style[i], "8.9", std::string()); EXPECT_TRUE(info.IsValid()); if (style[i] == "lexical") EXPECT_TRUE(info.IsLexical()); @@ -65,7 +65,7 @@ TEST_F(VersionInfoTest, ValidVersionInfo) { "10. 9", }; for (size_t i =0; i < arraysize(number); ++i) { - VersionInfo info("=", "", number[i], ""); + VersionInfo info("=", std::string(), number[i], std::string()); EXPECT_TRUE(info.IsValid()); } } @@ -82,21 +82,21 @@ TEST_F(VersionInfoTest, InvalidVersionInfo) { }; for (size_t i = 0; i < arraysize(op); ++i) { { - VersionInfo info(op[i], "", "8.9", ""); + VersionInfo info(op[i], std::string(), "8.9", std::string()); if (op[i] == "between") EXPECT_FALSE(info.IsValid()); else EXPECT_TRUE(info.IsValid()); } { - VersionInfo info(op[i], "", "", ""); + VersionInfo info(op[i], std::string(), std::string(), std::string()); if (op[i] == "any") EXPECT_TRUE(info.IsValid()); else EXPECT_FALSE(info.IsValid()); } { - VersionInfo info(op[i], "", "8.9", "9.0"); + VersionInfo info(op[i], std::string(), "8.9", "9.0"); EXPECT_TRUE(info.IsValid()); } } @@ -106,34 +106,34 @@ TEST_F(VersionInfoTest, InvalidVersionInfo) { "8-9", }; for (size_t i = 0; i < arraysize(number); ++i) { - VersionInfo info("=", "", number[i], ""); + VersionInfo info("=", std::string(), number[i], std::string()); EXPECT_FALSE(info.IsValid()); } } TEST_F(VersionInfoTest, VersionComparison) { { - VersionInfo info("any", "", "", ""); + VersionInfo info("any", std::string(), std::string(), std::string()); EXPECT_TRUE(info.Contains("0")); EXPECT_TRUE(info.Contains("8.9")); EXPECT_TRUE(info.Contains("100")); } { - VersionInfo info(">", "", "8.9", ""); + VersionInfo info(">", std::string(), "8.9", std::string()); EXPECT_FALSE(info.Contains("7")); EXPECT_FALSE(info.Contains("8.9")); EXPECT_FALSE(info.Contains("8.9.1")); EXPECT_TRUE(info.Contains("9")); } { - VersionInfo info(">=", "", "8.9", ""); + VersionInfo info(">=", std::string(), "8.9", std::string()); EXPECT_FALSE(info.Contains("7")); EXPECT_TRUE(info.Contains("8.9")); EXPECT_TRUE(info.Contains("8.9.1")); EXPECT_TRUE(info.Contains("9")); } { - VersionInfo info("=", "", "8.9", ""); + VersionInfo info("=", std::string(), "8.9", std::string()); EXPECT_FALSE(info.Contains("7")); EXPECT_TRUE(info.Contains("8")); EXPECT_TRUE(info.Contains("8.9")); @@ -141,7 +141,7 @@ TEST_F(VersionInfoTest, VersionComparison) { EXPECT_FALSE(info.Contains("9")); } { - VersionInfo info("<", "", "8.9", ""); + VersionInfo info("<", std::string(), "8.9", std::string()); EXPECT_TRUE(info.Contains("7")); EXPECT_TRUE(info.Contains("8.8")); EXPECT_FALSE(info.Contains("8")); @@ -150,7 +150,7 @@ TEST_F(VersionInfoTest, VersionComparison) { EXPECT_FALSE(info.Contains("9")); } { - VersionInfo info("<=", "", "8.9", ""); + VersionInfo info("<=", std::string(), "8.9", std::string()); EXPECT_TRUE(info.Contains("7")); EXPECT_TRUE(info.Contains("8.8")); EXPECT_TRUE(info.Contains("8")); @@ -159,7 +159,7 @@ TEST_F(VersionInfoTest, VersionComparison) { EXPECT_FALSE(info.Contains("9")); } { - VersionInfo info("between", "", "8.9", "9.1"); + VersionInfo info("between", std::string(), "8.9", "9.1"); EXPECT_FALSE(info.Contains("7")); EXPECT_FALSE(info.Contains("8.8")); EXPECT_TRUE(info.Contains("8")); @@ -177,14 +177,14 @@ TEST_F(VersionInfoTest, DateComparison) { // When we use '-' as splitter, we assume a format of mm-dd-yyyy // or mm-yyyy, i.e., a date. { - VersionInfo info("=", "", "1976.3.21", ""); + VersionInfo info("=", std::string(), "1976.3.21", std::string()); EXPECT_TRUE(info.Contains("3-21-1976", '-')); EXPECT_TRUE(info.Contains("3-1976", '-')); EXPECT_TRUE(info.Contains("03-1976", '-')); EXPECT_FALSE(info.Contains("21-3-1976", '-')); } { - VersionInfo info(">", "", "1976.3.21", ""); + VersionInfo info(">", std::string(), "1976.3.21", std::string()); EXPECT_TRUE(info.Contains("3-22-1976", '-')); EXPECT_TRUE(info.Contains("4-1976", '-')); EXPECT_TRUE(info.Contains("04-1976", '-')); @@ -192,7 +192,7 @@ TEST_F(VersionInfoTest, DateComparison) { EXPECT_FALSE(info.Contains("2-1976", '-')); } { - VersionInfo info("between", "", "1976.3.21", "2012.12.25"); + VersionInfo info("between", std::string(), "1976.3.21", "2012.12.25"); EXPECT_FALSE(info.Contains("3-20-1976", '-')); EXPECT_TRUE(info.Contains("3-21-1976", '-')); EXPECT_TRUE(info.Contains("3-22-1976", '-')); @@ -215,7 +215,7 @@ TEST_F(VersionInfoTest, LexicalComparison) { // When we use lexical style, we assume a format major.minor.*. // We apply numerical comparison to major, lexical comparison to others. { - VersionInfo info("<", "lexical", "8.201", ""); + VersionInfo info("<", "lexical", "8.201", std::string()); EXPECT_TRUE(info.Contains("8.001.100")); EXPECT_TRUE(info.Contains("8.109")); EXPECT_TRUE(info.Contains("8.10900")); @@ -234,7 +234,7 @@ TEST_F(VersionInfoTest, LexicalComparison) { EXPECT_FALSE(info.Contains("12.201")); } { - VersionInfo info("<", "lexical", "9.002", ""); + VersionInfo info("<", "lexical", "9.002", std::string()); EXPECT_TRUE(info.Contains("8.001.100")); EXPECT_TRUE(info.Contains("8.109")); EXPECT_TRUE(info.Contains("8.10900")); diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc index 675222b..467cc21 100644 --- a/content/browser/gpu/gpu_data_manager_impl.cc +++ b/content/browser/gpu/gpu_data_manager_impl.cc @@ -117,7 +117,7 @@ void GpuDataManagerImpl::InitializeForTesting( // This function is for testing only, so disable histograms. update_histograms_ = false; - InitializeImpl(gpu_blacklist_json, "", "", gpu_info); + InitializeImpl(gpu_blacklist_json, std::string(), std::string(), gpu_info); } bool GpuDataManagerImpl::IsFeatureBlacklisted(int feature) const { @@ -350,7 +350,7 @@ void GpuDataManagerImpl::UpdateGpuInfo(const GPUInfo& gpu_info) { if (gpu_blacklist_.get()) { std::set<int> features = gpu_blacklist_->MakeDecision( - GpuControlList::kOsAny, "", my_gpu_info); + GpuControlList::kOsAny, std::string(), my_gpu_info); if (update_histograms_) UpdateStats(gpu_blacklist_.get(), features); @@ -358,7 +358,7 @@ void GpuDataManagerImpl::UpdateGpuInfo(const GPUInfo& gpu_info) { } if (gpu_switching_list_.get()) { std::set<int> option = gpu_switching_list_->MakeDecision( - GpuControlList::kOsAny, "", my_gpu_info); + GpuControlList::kOsAny, std::string(), my_gpu_info); if (option.size() == 1) { // Blacklist decision should not overwrite commandline switch from users. CommandLine* command_line = CommandLine::ForCurrentProcess(); @@ -368,7 +368,7 @@ void GpuDataManagerImpl::UpdateGpuInfo(const GPUInfo& gpu_info) { } if (gpu_driver_bug_list_.get()) gpu_driver_bugs_ = gpu_driver_bug_list_->MakeDecision( - GpuControlList::kOsAny, "", my_gpu_info); + GpuControlList::kOsAny, std::string(), my_gpu_info); // We have to update GpuFeatureType before notify all the observers. NotifyGpuInfoUpdate(); diff --git a/content/browser/gpu/gpu_memory_test.cc b/content/browser/gpu/gpu_memory_test.cc index 36584c3..832b947 100644 --- a/content/browser/gpu/gpu_memory_test.cc +++ b/content/browser/gpu/gpu_memory_test.cc @@ -116,12 +116,8 @@ class GpuMemoryTest : public ContentBrowserTest { js_call << mb_to_use; js_call << ");"; std::string message; - ASSERT_TRUE( - ExecuteScriptInFrameAndExtractString( - tab_to_load->web_contents(), - "", - js_call.str(), - &message)); + ASSERT_TRUE(ExecuteScriptInFrameAndExtractString( + tab_to_load->web_contents(), std::string(), js_call.str(), &message)); EXPECT_EQ("DONE_USE_GPU_MEMORY", message); } @@ -196,12 +192,8 @@ class GpuMemoryTest : public ContentBrowserTest { " domAutomationController.send(\"DONE_RAF\");" "})"); std::string message; - ASSERT_TRUE( - ExecuteScriptInFrameAndExtractString( - (*it)->web_contents(), - "", - js_call, - &message)); + ASSERT_TRUE(ExecuteScriptInFrameAndExtractString( + (*it)->web_contents(), std::string(), js_call, &message)); EXPECT_EQ("DONE_RAF", message); } // TODO(ccameron): send an IPC from Browser -> Renderer (delay it until diff --git a/content/browser/gpu/gpu_pixel_browsertest.cc b/content/browser/gpu/gpu_pixel_browsertest.cc index e146a08..758d2b4 100644 --- a/content/browser/gpu/gpu_pixel_browsertest.cc +++ b/content/browser/gpu/gpu_pixel_browsertest.cc @@ -147,7 +147,7 @@ class GpuPixelBrowserTest : public ContentBrowserTest { "DISABLED_", "FLAKY_", "FAILS_", "MANUAL_"}; for (size_t i = 0; i < arraysize(test_status_prefixes); ++i) { ReplaceFirstSubstringAfterOffset( - &test_name_, 0, test_status_prefixes[i], ""); + &test_name_, 0, test_status_prefixes[i], std::string()); } ui::DisableTestCompositor(); diff --git a/content/browser/media/media_internals_unittest.cc b/content/browser/media/media_internals_unittest.cc index 0db2580..591a287 100644 --- a/content/browser/media/media_internals_unittest.cc +++ b/content/browser/media/media_internals_unittest.cc @@ -41,7 +41,7 @@ class MediaInternalsTest : public testing::Test { void UpdateItem(const std::string& item, const std::string& property, base::Value* value) { - internals_->UpdateItem("", item, property, value); + internals_->UpdateItem(std::string(), item, property, value); } void SendUpdate(const std::string& function, base::Value* value) { diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc index 4ae318a..1734cc8 100644 --- a/content/browser/plugin_service_impl.cc +++ b/content/browser/plugin_service_impl.cc @@ -178,7 +178,7 @@ void PluginServiceImpl::Init() { if (command_line->HasSwitch(switches::kSitePerProcess)) { webkit::WebPluginInfo webview_plugin( ASCIIToUTF16("WebView Tag"), - base::FilePath(FILE_PATH_LITERAL("")), + base::FilePath(FILE_PATH_LITERAL(std::string())), ASCIIToUTF16("1.2.3.4"), ASCIIToUTF16("Browser Plugin.")); webview_plugin.type = webkit::WebPluginInfo::PLUGIN_TYPE_NPAPI; diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc index a315130..9956326 100644 --- a/content/browser/ppapi_plugin_process_host.cc +++ b/content/browser/ppapi_plugin_process_host.cc @@ -317,7 +317,7 @@ bool PpapiPluginProcessHost::Init(const PepperPluginInfo& info) { #if defined(OS_POSIX) bool use_zygote = !is_broker_ && plugin_launcher.empty() && info.is_sandboxed; if (!info.is_sandboxed) - cmd_line->AppendSwitchASCII(switches::kNoSandbox, ""); + cmd_line->AppendSwitchASCII(switches::kNoSandbox, std::string()); #endif // OS_POSIX process_->Launch( #if defined(OS_WIN) diff --git a/content/browser/renderer_host/gtk_key_bindings_handler.cc b/content/browser/renderer_host/gtk_key_bindings_handler.cc index 756bcc3..e86ea60 100644 --- a/content/browser/renderer_host/gtk_key_bindings_handler.cc +++ b/content/browser/renderer_host/gtk_key_bindings_handler.cc @@ -132,15 +132,16 @@ GtkKeyBindingsHandler* GtkKeyBindingsHandler::GetHandlerOwner( } void GtkKeyBindingsHandler::BackSpace(GtkTextView* text_view) { - GetHandlerOwner(text_view)->EditCommandMatched("DeleteBackward", ""); + GetHandlerOwner(text_view) + ->EditCommandMatched("DeleteBackward", std::string()); } void GtkKeyBindingsHandler::CopyClipboard(GtkTextView* text_view) { - GetHandlerOwner(text_view)->EditCommandMatched("Copy", ""); + GetHandlerOwner(text_view)->EditCommandMatched("Copy", std::string()); } void GtkKeyBindingsHandler::CutClipboard(GtkTextView* text_view) { - GetHandlerOwner(text_view)->EditCommandMatched("Cut", ""); + GetHandlerOwner(text_view)->EditCommandMatched("Cut", std::string()); } void GtkKeyBindingsHandler::DeleteFromCursor( @@ -191,7 +192,7 @@ void GtkKeyBindingsHandler::DeleteFromCursor( count = -count; for (; count > 0; --count) { for (const char* const* p = commands; *p; ++p) - owner->EditCommandMatched(*p, ""); + owner->EditCommandMatched(*p, std::string()); } } @@ -247,7 +248,7 @@ void GtkKeyBindingsHandler::MoveCursor( if (count < 0) count = -count; for (; count > 0; --count) - owner->EditCommandMatched(command, ""); + owner->EditCommandMatched(command, std::string()); } void GtkKeyBindingsHandler::MoveViewport( @@ -256,18 +257,18 @@ void GtkKeyBindingsHandler::MoveViewport( } void GtkKeyBindingsHandler::PasteClipboard(GtkTextView* text_view) { - GetHandlerOwner(text_view)->EditCommandMatched("Paste", ""); + GetHandlerOwner(text_view)->EditCommandMatched("Paste", std::string()); } void GtkKeyBindingsHandler::SelectAll(GtkTextView* text_view, gboolean select) { if (select) - GetHandlerOwner(text_view)->EditCommandMatched("SelectAll", ""); + GetHandlerOwner(text_view)->EditCommandMatched("SelectAll", std::string()); else - GetHandlerOwner(text_view)->EditCommandMatched("Unselect", ""); + GetHandlerOwner(text_view)->EditCommandMatched("Unselect", std::string()); } void GtkKeyBindingsHandler::SetAnchor(GtkTextView* text_view) { - GetHandlerOwner(text_view)->EditCommandMatched("SetMark", ""); + GetHandlerOwner(text_view)->EditCommandMatched("SetMark", std::string()); } void GtkKeyBindingsHandler::ToggleCursorVisible(GtkTextView* text_view) { diff --git a/content/browser/renderer_host/pepper/pepper_host_resolver_private_message_filter.cc b/content/browser/renderer_host/pepper/pepper_host_resolver_private_message_filter.cc index d42cb56..e4bb14c 100644 --- a/content/browser/renderer_host/pepper/pepper_host_resolver_private_message_filter.cc +++ b/content/browser/renderer_host/pepper/pepper_host_resolver_private_message_filter.cc @@ -122,9 +122,9 @@ int32_t PepperHostResolverPrivateMessageFilter::OnMsgResolve( // Check plugin permissions. SocketPermissionRequest request( - content::SocketPermissionRequest::NONE, "", 0); - RenderViewHost* render_view_host = RenderViewHost::FromID(render_process_id_, - render_view_id_); + content::SocketPermissionRequest::NONE, std::string(), 0); + RenderViewHost* render_view_host = + RenderViewHost::FromID(render_process_id_, render_view_id_); if (!render_view_host || !pepper_socket_utils::CanUseSocketAPIs(external_plugin_, request, diff --git a/content/browser/renderer_host/pepper/pepper_udp_socket_private_message_filter.cc b/content/browser/renderer_host/pepper/pepper_udp_socket_private_message_filter.cc index 08384e78..4799d66 100644 --- a/content/browser/renderer_host/pepper/pepper_udp_socket_private_message_filter.cc +++ b/content/browser/renderer_host/pepper/pepper_udp_socket_private_message_filter.cc @@ -380,7 +380,9 @@ void PepperUDPSocketPrivateMessageFilter::SendBindError( void PepperUDPSocketPrivateMessageFilter::SendRecvFromError( const ppapi::host::ReplyMessageContext& context, int32_t result) { - SendRecvFromReply(context, result, "", + SendRecvFromReply(context, + result, + std::string(), NetAddressPrivateImpl::kInvalidNetAddress); } diff --git a/content/browser/renderer_host/render_sandbox_host_linux.cc b/content/browser/renderer_host/render_sandbox_host_linux.cc index 0cc3638..78eba83 100644 --- a/content/browser/renderer_host/render_sandbox_host_linux.cc +++ b/content/browser/renderer_host/render_sandbox_host_linux.cc @@ -278,7 +278,7 @@ class SandboxIPCProcess { if (family.name.data()) { reply.WriteString(family.name.data()); } else { - reply.WriteString(""); + reply.WriteString(std::string()); } reply.WriteBool(family.isBold); reply.WriteBool(family.isItalic); diff --git a/content/browser/speech/google_one_shot_remote_engine_unittest.cc b/content/browser/speech/google_one_shot_remote_engine_unittest.cc index efcf84f..694e246 100644 --- a/content/browser/speech/google_one_shot_remote_engine_unittest.cc +++ b/content/browser/speech/google_one_shot_remote_engine_unittest.cc @@ -104,7 +104,7 @@ TEST_F(GoogleOneShotRemoteEngineTest, BasicTest) { EXPECT_EQ(0U, result().hypotheses.size()); // Http failure case. - CreateAndTestRequest(false, ""); + CreateAndTestRequest(false, std::string()); EXPECT_EQ(error_, SPEECH_RECOGNITION_ERROR_NETWORK); EXPECT_EQ(0U, result().hypotheses.size()); diff --git a/content/browser/speech/speech_recognition_manager_impl.cc b/content/browser/speech/speech_recognition_manager_impl.cc index 8f9c3e1..2dc6cf8 100644 --- a/content/browser/speech/speech_recognition_manager_impl.cc +++ b/content/browser/speech/speech_recognition_manager_impl.cc @@ -100,7 +100,8 @@ int SpeechRecognitionManagerImpl::CreateSession( remote_engine_config.interim_results = config.interim_results; remote_engine_config.max_hypotheses = config.max_hypotheses; remote_engine_config.hardware_info = hardware_info; - remote_engine_config.origin_url = can_report_metrics ? config.origin_url : ""; + remote_engine_config.origin_url = + can_report_metrics ? config.origin_url : std::string(); SpeechRecognitionEngine* google_remote_engine; if (config.is_legacy_api) { diff --git a/content/browser/speech/speech_recognizer_unittest.cc b/content/browser/speech/speech_recognizer_unittest.cc index 2cc4db3..4c061c2 100644 --- a/content/browser/speech/speech_recognizer_unittest.cc +++ b/content/browser/speech/speech_recognizer_unittest.cc @@ -305,7 +305,7 @@ TEST_F(SpeechRecognizerTest, ConnectionError) { status.set_error(net::ERR_CONNECTION_REFUSED); fetcher->set_status(status); fetcher->set_response_code(0); - fetcher->SetResponseString(""); + fetcher->SetResponseString(std::string()); fetcher->delegate()->OnURLFetchComplete(fetcher); MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(recognition_ended_); diff --git a/content/browser/storage_partition_impl_map_unittest.cc b/content/browser/storage_partition_impl_map_unittest.cc index 1c44fcc..04127cc 100644 --- a/content/browser/storage_partition_impl_map_unittest.cc +++ b/content/browser/storage_partition_impl_map_unittest.cc @@ -13,13 +13,18 @@ class StoragePartitionConfigTest : public testing::Test { // Test that the Less comparison function is implemented properly to uniquely // identify storage partitions used as keys in a std::map. TEST_F(StoragePartitionConfigTest, OperatorLess) { - StoragePartitionImplMap::StoragePartitionConfig c1("", "", false); - StoragePartitionImplMap::StoragePartitionConfig c2("", "", false); - StoragePartitionImplMap::StoragePartitionConfig c3("", "", true); - StoragePartitionImplMap::StoragePartitionConfig c4("a", "", true); - StoragePartitionImplMap::StoragePartitionConfig c5("b", "", true); - StoragePartitionImplMap::StoragePartitionConfig c6("", "abc", false); - StoragePartitionImplMap::StoragePartitionConfig c7("", "abc", true); + StoragePartitionImplMap::StoragePartitionConfig c1( + std::string(), std::string(), false); + StoragePartitionImplMap::StoragePartitionConfig c2( + std::string(), std::string(), false); + StoragePartitionImplMap::StoragePartitionConfig c3( + std::string(), std::string(), true); + StoragePartitionImplMap::StoragePartitionConfig c4("a", std::string(), true); + StoragePartitionImplMap::StoragePartitionConfig c5("b", std::string(), true); + StoragePartitionImplMap::StoragePartitionConfig c6( + std::string(), "abc", false); + StoragePartitionImplMap::StoragePartitionConfig c7( + std::string(), "abc", true); StoragePartitionImplMap::StoragePartitionConfig c8("a", "abc", false); StoragePartitionImplMap::StoragePartitionConfig c9("a", "abc", true); diff --git a/content/browser/streams/stream_url_request_job_unittest.cc b/content/browser/streams/stream_url_request_job_unittest.cc index 10a02c9..bed96fa 100644 --- a/content/browser/streams/stream_url_request_job_unittest.cc +++ b/content/browser/streams/stream_url_request_job_unittest.cc @@ -169,7 +169,7 @@ TEST_F(StreamURLRequestJobTest, TestInvalidRangeDataRequest) { net::HttpRequestHeaders extra_headers; extra_headers.SetHeader(net::HttpRequestHeaders::kRange, "bytes=1-3"); - TestRequest("GET", kStreamURL, extra_headers, 405, ""); + TestRequest("GET", kStreamURL, extra_headers, 405, std::string()); } } // namespace content diff --git a/content/browser/tracing/tracing_ui.cc b/content/browser/tracing/tracing_ui.cc index aa2e529..6c224c0 100644 --- a/content/browser/tracing/tracing_ui.cc +++ b/content/browser/tracing/tracing_ui.cc @@ -317,8 +317,11 @@ void TracingMessageHandler::OnLoadTraceFile(const base::ListValue* list) { ui::SelectFileDialog::SELECT_OPEN_FILE, string16(), base::FilePath(), - NULL, 0, FILE_PATH_LITERAL(""), - web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); + NULL, + 0, + FILE_PATH_LITERAL(std::string()), + web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), + NULL); } void TracingMessageHandler::LoadTraceFileComplete(string16* contents) { @@ -367,8 +370,11 @@ void TracingMessageHandler::OnSaveTraceFile(const base::ListValue* list) { ui::SelectFileDialog::SELECT_SAVEAS_FILE, string16(), base::FilePath(), - NULL, 0, FILE_PATH_LITERAL(""), - web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); + NULL, + 0, + FILE_PATH_LITERAL(std::string()), + web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), + NULL); } void TracingMessageHandler::SaveTraceFileComplete() { diff --git a/content/browser/web_contents/navigation_entry_impl_unittest.cc b/content/browser/web_contents/navigation_entry_impl_unittest.cc index 00857ed..8bc5de1 100644 --- a/content/browser/web_contents/navigation_entry_impl_unittest.cc +++ b/content/browser/web_contents/navigation_entry_impl_unittest.cc @@ -61,23 +61,23 @@ TEST_F(NavigationEntryTest, NavigationEntryURLs) { EXPECT_EQ(GURL(), entry1_->GetURL()); EXPECT_EQ(GURL(), entry1_->GetVirtualURL()); - EXPECT_TRUE(entry1_->GetTitleForDisplay("").empty()); + EXPECT_TRUE(entry1_->GetTitleForDisplay(std::string()).empty()); // Setting URL affects virtual_url and GetTitleForDisplay entry1_->SetURL(GURL("http://www.google.com")); EXPECT_EQ(GURL("http://www.google.com"), entry1_->GetURL()); EXPECT_EQ(GURL("http://www.google.com"), entry1_->GetVirtualURL()); EXPECT_EQ(ASCIIToUTF16("www.google.com"), - entry1_->GetTitleForDisplay("")); + entry1_->GetTitleForDisplay(std::string())); // file:/// URLs should only show the filename. entry1_->SetURL(GURL("file:///foo/bar baz.txt")); EXPECT_EQ(ASCIIToUTF16("bar baz.txt"), - entry1_->GetTitleForDisplay("")); + entry1_->GetTitleForDisplay(std::string())); // Title affects GetTitleForDisplay entry1_->SetTitle(ASCIIToUTF16("Google")); - EXPECT_EQ(ASCIIToUTF16("Google"), entry1_->GetTitleForDisplay("")); + EXPECT_EQ(ASCIIToUTF16("Google"), entry1_->GetTitleForDisplay(std::string())); // Setting virtual_url doesn't affect URL entry2_->SetVirtualURL(GURL("display:url")); @@ -86,7 +86,7 @@ TEST_F(NavigationEntryTest, NavigationEntryURLs) { EXPECT_EQ(GURL("display:url"), entry2_->GetVirtualURL()); // Having a title set in constructor overrides virtual URL - EXPECT_EQ(ASCIIToUTF16("title"), entry2_->GetTitleForDisplay("")); + EXPECT_EQ(ASCIIToUTF16("title"), entry2_->GetTitleForDisplay(std::string())); // User typed URL is independent of the others EXPECT_EQ(GURL(), entry1_->GetUserTypedURL()); diff --git a/content/browser/webui/web_ui_data_source_unittest.cc b/content/browser/webui/web_ui_data_source_unittest.cc index 24d1d2b..bece8d0 100644 --- a/content/browser/webui/web_ui_data_source_unittest.cc +++ b/content/browser/webui/web_ui_data_source_unittest.cc @@ -141,7 +141,7 @@ TEST_F(WebUIDataSourceTest, NamedResource) { TEST_F(WebUIDataSourceTest, MimeType) { const char* html = "text/html"; const char* js = "application/javascript"; - EXPECT_EQ(GetMimeType(""), html); + EXPECT_EQ(GetMimeType(std::string()), html); EXPECT_EQ(GetMimeType("foo"), html); EXPECT_EQ(GetMimeType("foo.html"), html); EXPECT_EQ(GetMimeType(".js"), js); diff --git a/content/browser/worker_host/test/worker_browsertest.cc b/content/browser/worker_host/test/worker_browsertest.cc index 1be3007..3e67d7f 100644 --- a/content/browser/worker_host/test/worker_browsertest.cc +++ b/content/browser/worker_host/test/worker_browsertest.cc @@ -300,11 +300,11 @@ class WorkerTest : public ContentBrowserTest { }; IN_PROC_BROWSER_TEST_F(WorkerTest, SingleWorker) { - RunTest("single_worker.html", ""); + RunTest("single_worker.html", std::string()); } IN_PROC_BROWSER_TEST_F(WorkerTest, MultipleWorkers) { - RunTest("multi_worker.html", ""); + RunTest("multi_worker.html", std::string()); } IN_PROC_BROWSER_TEST_F(WorkerTest, SingleSharedWorker) { @@ -320,10 +320,10 @@ IN_PROC_BROWSER_TEST_F(WorkerTest, MultipleSharedWorkers) { // http://crbug.com/30021 IN_PROC_BROWSER_TEST_F(WorkerTest, IncognitoSharedWorkers) { // Load a non-incognito tab and have it create a shared worker - RunTest("incognito_worker.html", ""); + RunTest("incognito_worker.html", std::string()); // Incognito worker should not share with non-incognito - RunTest(CreateOffTheRecordBrowser(), "incognito_worker.html", ""); + RunTest(CreateOffTheRecordBrowser(), "incognito_worker.html", std::string()); } // Make sure that auth dialog is displayed from worker context. @@ -399,7 +399,7 @@ IN_PROC_BROWSER_TEST_F(WorkerTest, LimitTotal) { // Flaky, http://crbug.com/59786. IN_PROC_BROWSER_TEST_F(WorkerTest, WorkerClose) { - RunTest("worker_close.html", ""); + RunTest("worker_close.html", std::string()); ASSERT_TRUE(WaitForWorkerProcessCount(0)); } diff --git a/content/gpu/gpu_info_collector.cc b/content/gpu/gpu_info_collector.cc index 86fb0c5..d3f5867 100644 --- a/content/gpu/gpu_info_collector.cc +++ b/content/gpu/gpu_info_collector.cc @@ -53,7 +53,7 @@ std::string GetGLString(unsigned int pname) { reinterpret_cast<const char*>(glGetString(pname)); if (gl_string) return std::string(gl_string); - return ""; + return std::string(); } // Return a version string in the format of "major.minor". @@ -71,7 +71,7 @@ std::string GetVersionFromString(const std::string& version_string) { if (pieces.size() >= 2) return pieces[0] + "." + pieces[1]; } - return ""; + return std::string(); } } // namespace anonymous diff --git a/content/public/test/test_launcher.cc b/content/public/test/test_launcher.cc index 40545d5..f4635ec 100644 --- a/content/public/test/test_launcher.cc +++ b/content/public/test/test_launcher.cc @@ -454,7 +454,7 @@ bool RunTests(TestLauncherDelegate* launcher_delegate, // Split --gtest_filter at '-', if there is one, to separate into // positive filter and negative filter portions. std::string positive_filter = filter; - std::string negative_filter = ""; + std::string negative_filter; size_t dash_pos = filter.find('-'); if (dash_pos != std::string::npos) { positive_filter = filter.substr(0, dash_pos); // Everything up to the dash. diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc index 9fe3191..62c973318 100644 --- a/content/renderer/browser_plugin/browser_plugin.cc +++ b/content/renderer/browser_plugin/browser_plugin.cc @@ -110,7 +110,7 @@ static std::string PermissionTypeToString(BrowserPluginPermissionType type) { NOTREACHED(); break; } - return ""; + return std::string(); } typedef std::map<WebKit::WebPluginContainer*, @@ -227,7 +227,7 @@ void BrowserPlugin::RemoveDOMAttribute(const std::string& attribute_name) { std::string BrowserPlugin::GetDOMAttributeValue( const std::string& attribute_name) const { if (!container()) - return ""; + return std::string(); return container()->element().getAttribute( WebKit::WebString::fromUTF8(attribute_name)).utf8(); diff --git a/content/renderer/date_time_formatter.cc b/content/renderer/date_time_formatter.cc index d3c16e3..1adb0de 100644 --- a/content/renderer/date_time_formatter.cc +++ b/content/renderer/date_time_formatter.cc @@ -95,7 +95,7 @@ const std::string DateTimeFormatter::FormatString() const { UErrorCode success = U_ZERO_ERROR; if (year_ == 0 && month_ == 0 && day_ == 0 && hour_ == 0 && minute_ == 0 && second_ == 0) { - return ""; + return std::string(); } std::string result; @@ -113,7 +113,7 @@ const std::string DateTimeFormatter::FormatString() const { return result; } LOG(WARNING) << "Calendar not created: error " << success; - return ""; + return std::string(); } void DateTimeFormatter::ExtractType( diff --git a/content/renderer/media/mock_media_stream_dependency_factory.cc b/content/renderer/media/mock_media_stream_dependency_factory.cc index af3177f..f2656c0 100644 --- a/content/renderer/media/mock_media_stream_dependency_factory.cc +++ b/content/renderer/media/mock_media_stream_dependency_factory.cc @@ -203,7 +203,7 @@ cricket::VideoRenderer* MockLocalVideoTrack::FrameInput() { std::string MockLocalVideoTrack::kind() const { NOTIMPLEMENTED(); - return ""; + return std::string(); } std::string MockLocalVideoTrack::id() const { return id_; } @@ -239,7 +239,7 @@ VideoSourceInterface* MockLocalVideoTrack::GetSource() const { std::string MockLocalAudioTrack::kind() const { NOTIMPLEMENTED(); - return ""; + return std::string(); } std::string MockLocalAudioTrack::id() const { return id_; } @@ -292,11 +292,11 @@ class MockSessionDescription : public SessionDescriptionInterface { } virtual std::string session_id() const OVERRIDE { NOTIMPLEMENTED(); - return ""; + return std::string(); } virtual std::string session_version() const OVERRIDE { NOTIMPLEMENTED(); - return ""; + return std::string(); } virtual std::string type() const OVERRIDE { return type_; diff --git a/content/renderer/media/peer_connection_tracker.cc b/content/renderer/media/peer_connection_tracker.cc index 095d85f..82f3c58 100644 --- a/content/renderer/media/peer_connection_tracker.cc +++ b/content/renderer/media/peer_connection_tracker.cc @@ -376,7 +376,7 @@ void PeerConnectionTracker::TrackCreateDataChannel( } void PeerConnectionTracker::TrackStop(RTCPeerConnectionHandler* pc_handler) { - SendPeerConnectionUpdate(pc_handler, "stop", ""); + SendPeerConnectionUpdate(pc_handler, "stop", std::string()); } void PeerConnectionTracker::TrackSignalingStateChange( @@ -430,7 +430,7 @@ void PeerConnectionTracker::TrackSessionDescriptionCallback( void PeerConnectionTracker::TrackOnRenegotiationNeeded( RTCPeerConnectionHandler* pc_handler) { - SendPeerConnectionUpdate(pc_handler, "onRenegotiationNeeded", ""); + SendPeerConnectionUpdate(pc_handler, "onRenegotiationNeeded", std::string()); } void PeerConnectionTracker::TrackCreateDTMFSender( diff --git a/content/renderer/p2p/port_allocator.cc b/content/renderer/p2p/port_allocator.cc index 7d06f6e..7380113 100644 --- a/content/renderer/p2p/port_allocator.cc +++ b/content/renderer/p2p/port_allocator.cc @@ -282,8 +282,8 @@ void P2PPortAllocatorSession::ParseRelayResponse() { } void P2PPortAllocatorSession::AddConfig() { - cricket::PortConfiguration* config = - new cricket::PortConfiguration(stun_server_address_, "", ""); + cricket::PortConfiguration* config = new cricket::PortConfiguration( + stun_server_address_, std::string(), std::string()); if (allocator_->config_.legacy_relay) { // Passing empty credentials for legacy google relay. diff --git a/content/renderer/pepper/pepper_device_enumeration_event_handler.cc b/content/renderer/pepper/pepper_device_enumeration_event_handler.cc index b23df8a..7a8dce6 100644 --- a/content/renderer/pepper/pepper_device_enumeration_event_handler.cc +++ b/content/renderer/pepper/pepper_device_enumeration_event_handler.cc @@ -78,7 +78,7 @@ void PepperDeviceEnumerationEventHandler::OnDeviceOpened( } void PepperDeviceEnumerationEventHandler::OnDeviceOpenFailed(int request_id) { - NotifyDeviceOpened(request_id, false, ""); + NotifyDeviceOpened(request_id, false, std::string()); } // static diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index 0c4212b..3e06f1f 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -180,7 +180,7 @@ std::string HostToCustomHistogramSuffix(const std::string& host) { return ".docs"; if (host == "plus.google.com") return ".plus"; - return ""; + return std::string(); } void* CreateHistogram( diff --git a/content/renderer/v8_value_converter_impl_unittest.cc b/content/renderer/v8_value_converter_impl_unittest.cc index df68e80..1f6b9bf 100644 --- a/content/renderer/v8_value_converter_impl_unittest.cc +++ b/content/renderer/v8_value_converter_impl_unittest.cc @@ -70,7 +70,7 @@ class V8ValueConverterImplTest : public testing::Test { std::string temp; if (!value->GetString(key, &temp)) { ADD_FAILURE(); - return ""; + return std::string(); } return temp; } @@ -80,7 +80,7 @@ class V8ValueConverterImplTest : public testing::Test { value->Get(v8::String::New(key.c_str())).As<v8::String>(); if (temp.IsEmpty()) { ADD_FAILURE(); - return ""; + return std::string(); } v8::String::Utf8Value utf8(temp); return std::string(*utf8, utf8.length()); @@ -90,7 +90,7 @@ class V8ValueConverterImplTest : public testing::Test { std::string temp; if (!value->GetString(static_cast<size_t>(index), &temp)) { ADD_FAILURE(); - return ""; + return std::string(); } return temp; } @@ -99,7 +99,7 @@ class V8ValueConverterImplTest : public testing::Test { v8::Handle<v8::String> temp = value->Get(index).As<v8::String>(); if (temp.IsEmpty()) { ADD_FAILURE(); - return ""; + return std::string(); } v8::String::Utf8Value utf8(temp); return std::string(*utf8, utf8.length()); diff --git a/content/shell/shell_devtools_delegate.cc b/content/shell/shell_devtools_delegate.cc index 58182f1..07ebbde 100644 --- a/content/shell/shell_devtools_delegate.cc +++ b/content/shell/shell_devtools_delegate.cc @@ -30,12 +30,11 @@ ShellDevToolsDelegate::ShellDevToolsDelegate(BrowserContext* browser_context, devtools_http_handler_ = DevToolsHttpHandler::Start( #if defined(OS_ANDROID) new net::UnixDomainSocketWithAbstractNamespaceFactory( - kSocketName, - base::Bind(&CanUserConnectToDevTools)), + kSocketName, base::Bind(&CanUserConnectToDevTools)), #else new net::TCPListenSocketFactory("127.0.0.1", port), #endif - "", + std::string(), this); } @@ -61,7 +60,7 @@ base::FilePath ShellDevToolsDelegate::GetDebugFrontendDir() { } std::string ShellDevToolsDelegate::GetPageThumbnailData(const GURL& url) { - return ""; + return std::string(); } RenderViewHost* ShellDevToolsDelegate::CreateNewTarget() { @@ -80,7 +79,7 @@ ShellDevToolsDelegate::GetTargetType(RenderViewHost*) { std::string ShellDevToolsDelegate::GetViewDescription( content::RenderViewHost*) { - return ""; + return std::string(); } } // namespace content diff --git a/content/test/gpu/gpu_test_config_unittest.cc b/content/test/gpu/gpu_test_config_unittest.cc index f58139f..a87d215 100644 --- a/content/test/gpu/gpu_test_config_unittest.cc +++ b/content/test/gpu/gpu_test_config_unittest.cc @@ -148,7 +148,7 @@ TEST_F(GPUTestConfigTest, StringMatches) { config.set_gpu_device_id(0x0640); EXPECT_TRUE(config.IsValid()); - EXPECT_TRUE(config.Matches("")); + EXPECT_TRUE(config.Matches(std::string())); // os matching EXPECT_TRUE(config.Matches("WIN")); diff --git a/content/test/layout_browsertest.cc b/content/test/layout_browsertest.cc index 4c34a38..155dbbe 100644 --- a/content/test/layout_browsertest.cc +++ b/content/test/layout_browsertest.cc @@ -155,8 +155,8 @@ void InProcessBrowserLayoutTest::RunLayoutTestInternal( test_controller_->set_printer(printer.release()); LOG(INFO) << "Navigating to URL " << url << " and blocking."; - ASSERT_TRUE( - test_controller_->PrepareForLayoutTest(url, layout_test_dir_, false, "")); + ASSERT_TRUE(test_controller_->PrepareForLayoutTest( + url, layout_test_dir_, false, std::string())); base::RunLoop run_loop; run_loop.Run(); LOG(INFO) << "Navigation completed."; @@ -195,9 +195,10 @@ void InProcessBrowserLayoutTest::RunLayoutTestInternal( std::string InProcessBrowserLayoutTest::SaveResults(const std::string& expected, const std::string& actual) { base::FilePath cwd; - EXPECT_TRUE(file_util::CreateNewTempDirectory(FILE_PATH_LITERAL(""), &cwd)); - base::FilePath expected_filename = cwd.Append( - FILE_PATH_LITERAL("expected.txt")); + EXPECT_TRUE(file_util::CreateNewTempDirectory( + FILE_PATH_LITERAL(std::string()), &cwd)); + base::FilePath expected_filename = + cwd.Append(FILE_PATH_LITERAL("expected.txt")); base::FilePath actual_filename = cwd.Append(FILE_PATH_LITERAL("actual.txt")); EXPECT_NE(-1, file_util::WriteFile(expected_filename, expected.c_str(), |