diff options
Diffstat (limited to 'content/browser')
44 files changed, 210 insertions, 224 deletions
diff --git a/content/browser/accessibility/accessibility_tree_formatter.cc b/content/browser/accessibility/accessibility_tree_formatter.cc index 3904bc0..cbe0629 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 base::FilePath::StringType(); + return FILE_PATH_LITERAL(""); } // static const base::FilePath::StringType AccessibilityTreeFormatter::GetExpectedFileSuffix() { - return base::FilePath::StringType(); + return FILE_PATH_LITERAL(""); } // static const std::string AccessibilityTreeFormatter::GetAllowEmptyString() { - return std::string(); + return ""; } // static const std::string AccessibilityTreeFormatter::GetAllowString() { - return std::string(); + return ""; } // static const std::string AccessibilityTreeFormatter::GetDenyString() { - return std::string(); + return ""; } #endif diff --git a/content/browser/accessibility/cross_platform_accessibility_browsertest.cc b/content/browser/accessibility/cross_platform_accessibility_browsertest.cc index ff5789a..9fe99c4 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 std::string(); + return ""; } // 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 3248afd..14dbc9a 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 std::string(); + return ""; } } diff --git a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc index 94568493..23977a5 100644 --- a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc +++ b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc @@ -388,8 +388,7 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, TestShortHangTimeoutGuestFactory::GetInstance()); const char kEmbedderURL[] = "files/browser_plugin_embedder_guest_unresponsive.html"; - StartBrowserPluginTest( - kEmbedderURL, kHTMLForGuestBusyLoop, true, std::string()); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuestBusyLoop, true, ""); // Wait until the busy loop starts. { const string16 expected_title = ASCIIToUTF16("start"); @@ -454,7 +453,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, ""); SimulateMouseClick(test_embedder()->web_contents(), 0, WebKit::WebMouseEvent::ButtonLeft); @@ -485,7 +484,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); // 2. Navigate to a URL in https, so we trigger a RenderViewHost swap. GURL test_https_url(https_server.GetURL( @@ -511,7 +510,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); WebContentsImpl* embedder_web_contents = test_embedder()->web_contents(); // Navigate to another page in same host and port, so RenderViewHost swap @@ -536,7 +535,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); // Hide the Browser Plugin. RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( @@ -550,7 +549,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); // Hide the embedder. test_embedder()->web_contents()->WasHidden(); @@ -562,7 +561,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); test_guest()->ResetUpdateRectCount(); @@ -576,7 +575,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); @@ -588,8 +587,7 @@ 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, std::string()); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuestTouchHandler, true, ""); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); @@ -617,7 +615,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, std::string()); + kEmbedderURL, GetHTMLForGuestWithTitle("P1"), true, ""); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); @@ -712,7 +710,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); @@ -763,7 +761,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); @@ -778,7 +776,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, std::string()); + kEmbedderURL, GetHTMLForGuestWithTitle("P1"), true, ""); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); @@ -820,7 +818,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, "about:blank", true, ""); const string16 expected_title = ASCIIToUTF16(kHTMLForGuest); content::TitleWatcher title_watcher(test_embedder()->web_contents(), @@ -837,7 +835,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, "about:blank", true, ""); { // Navigate the guest to "close-socket". @@ -884,7 +882,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, "about:blank", true, ""); const string16 expected_title = ASCIIToUTF16("redirected"); content::TitleWatcher title_watcher(test_embedder()->web_contents(), @@ -924,8 +922,7 @@ 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, std::string()); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuestAcceptDrag, true, ""); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); @@ -981,7 +978,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, ""); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); { @@ -1009,7 +1006,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, ""); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); { @@ -1055,7 +1052,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, "about:blank", true, ""); const string16 expected_title = ASCIIToUTF16("loadStop"); content::TitleWatcher title_watcher( @@ -1072,7 +1069,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, "about:blank", true, ""); const string16 expected_title = ASCIIToUTF16( base::StringPrintf("loadCommit:%s", kHTMLForGuest)); @@ -1108,7 +1105,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); // Hide the BrowserPlugin. @@ -1148,7 +1145,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>( @@ -1187,7 +1184,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>( @@ -1232,7 +1229,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, std::string()); + kEmbedderURL, kHTMLForGuestWithSize, true, ""); RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( test_embedder()->web_contents()->GetRenderViewHost()); @@ -1286,7 +1283,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, std::string()); + StartBrowserPluginTest(kEmbedderURL, kGuestURL, false, ""); 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 29030ad..48f7304 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(), std::string()); + CompareRecords(shell(), ""); 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(), std::string()); + CompareRecords(shell(), ""); RunScriptAndCheckResult( shell(), "deleteRecord(1)", "could not find row with index: 1"); - CompareRecords(shell(), std::string()); + CompareRecords(shell(), ""); } // 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, std::string()); + CompareRecords(otr, ""); } // 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(), std::string()); + CompareRecords(shell(), ""); } // 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 4869c2b..414785e 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, std::string()); + SendJson(connection_id, net::HTTP_OK, &version, ""); 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(), std::string()); + SendJson(connection_id, net::HTTP_OK, dictionary.get(), ""); 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, std::string()); + SendJson(connection_id, net::HTTP_OK, target_list, ""); 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 c926015..839ef60 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 std::string(); } + virtual std::string GetDiscoveryPageHTML() OVERRIDE { return ""; } virtual bool BundlesFrontendResources() OVERRIDE { return true; } virtual base::FilePath GetDebugFrontendDir() OVERRIDE { return base::FilePath(); } virtual std::string GetPageThumbnailData(const GURL& url) OVERRIDE { - return std::string(); + return ""; } virtual RenderViewHost* CreateNewTarget() OVERRIDE { return NULL; } virtual TargetType GetTargetType(RenderViewHost*) OVERRIDE { return kTargetTypeTab; } virtual std::string GetViewDescription(content::RenderViewHost*) OVERRIDE { - return std::string(); + return ""; } }; @@ -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()), - std::string(), + new DummyListenSocketFactory( + run_loop.QuitClosure(), run_loop_2.QuitClosure()), + "", 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 f7db2e8..94395d1 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, std::string()); + web_contents->GetController().LoadURL( + gurl, Referrer(), PAGE_TRANSITION_TYPED, ""); return command->SuccessResponse(new base::DictionaryValue()); } } diff --git a/content/browser/download/base_file.cc b/content/browser/download/base_file.cc index 0b1db97..b5ded45 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 std::string(); + return ""; Pickle hash_state; if (!secure_hash_->Serialize(&hash_state)) - return std::string(); + return ""; 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 0e6239f..799076d 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(std::string())); + EXPECT_FALSE(BaseFile::IsEmptyHash("")); } // 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 5286e0c..ab95900 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, base::FilePath::StringType()); + int uniquifier = + file_util::GetUniquePathNumber(new_path, FILE_PATH_LITERAL("")); 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 caee4ae..83b0cf0 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, std::string()); + item->UpdateProgress(kDownloadChunkSize, kDownloadSpeed, ""); 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(std::string()); + safe_item->OnAllDataSaved(""); 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(std::string()); + unsafeurl_item->OnAllDataSaved(""); 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(std::string()); + unsafefile_item->OnAllDataSaved(""); 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(std::string()); + item->DestinationObserverAsWeakPtr()->DestinationCompleted(""); 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(std::string()); + item->DestinationObserverAsWeakPtr()->DestinationCompleted(""); 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(std::string()); + item->DestinationObserverAsWeakPtr()->DestinationCompleted(""); 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(std::string()); + item->DestinationObserverAsWeakPtr()->DestinationCompleted(""); 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(std::string()); + item->DestinationObserverAsWeakPtr()->DestinationCompleted(""); 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(std::string()); + item->DestinationObserverAsWeakPtr()->DestinationCompleted(""); 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(std::string()); + item->DestinationObserverAsWeakPtr()->DestinationCompleted(""); 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 e08402e..4a33159 100644 --- a/content/browser/download/download_manager_impl_unittest.cc +++ b/content/browser/download/download_manager_impl_unittest.cc @@ -169,9 +169,7 @@ 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 std::string(); - } + virtual std::string DebugString(bool verbose) const OVERRIDE { return ""; } }; class MockDownloadManagerDelegate : public DownloadManagerDelegate { diff --git a/content/browser/download/download_stats.cc b/content/browser/download/download_stats.cc index e13200e..cad6cbe 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, - std::string()); + net::HttpContentDisposition content_disposition( + content_disposition_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 80caf13..3e7f7bd 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 f97d2d6..cbff60a 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, std::string()); + download_->UpdateProgress(size, 0, ""); // Must call OnAllDataSaved here in order for // GDataDownloadObserver::ShouldUpload() to return true. // ShouldCompleteDownload() may depend on the gdata uploader to finish. @@ -449,11 +449,7 @@ 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, - std::string(), - std::string(), - std::string(), + base::FilePath file_path = net::GenerateFileName(url, disposition, "", "", "", kDefaultSaveName); DCHECK(!file_path.empty()); @@ -792,8 +788,7 @@ void SavePackage::Finish() { // with SavePackage flow. if (download_->IsInProgress()) { if (save_type_ != SAVE_PAGE_TYPE_AS_MHTML) { - download_->UpdateProgress( - all_save_items_count_, CurrentSpeed(), std::string()); + download_->UpdateProgress(all_save_items_count_, CurrentSpeed(), ""); download_->OnAllDataSaved(DownloadItem::kEmptyFileHash); } download_->MarkAsComplete(); @@ -823,7 +818,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(), std::string()); + download_->UpdateProgress(completed_count(), CurrentSpeed(), ""); if (save_item->save_source() == SaveFileCreateInfo::SAVE_FILE_FROM_DOM && save_item->url() == page_url_ && !save_item->received_bytes()) { @@ -868,7 +863,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(), std::string()); + download_->UpdateProgress(completed_count(), CurrentSpeed(), ""); 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 e40af08..b5a07ae 100644 --- a/content/browser/download/save_package_unittest.cc +++ b/content/browser/download/save_package_unittest.cc @@ -221,21 +221,20 @@ TEST_F(SavePackageTest, MAYBE_TestLongSavePackageFilename) { base::FilePath::StringType filename; // Test that the filename is successfully shortened to fit. - ASSERT_TRUE(GetGeneratedFilename(true, std::string(), url, false, &filename)); + ASSERT_TRUE(GetGeneratedFilename(true, "", 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, std::string(), url, false, &filename)); + ASSERT_TRUE(GetGeneratedFilename(true, "", 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, std::string(), url, false, &filename2)); + ASSERT_TRUE(GetGeneratedFilename(true, "", 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 3b91466..fb01795 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, std::string()); + CheckRequestIsValid(*fetcher, 0, 0, 0, ""); } TEST_F(GeolocationNetworkProviderTest, StartProviderDefaultUrl) { @@ -353,9 +353,10 @@ 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, std::string()); + CheckRequestIsValid(*fetcher, 0, 0, 0, ""); } + TEST_F(GeolocationNetworkProviderTest, StartProviderLongRequest) { scoped_ptr<LocationProviderBase> provider(CreateProvider(true)); EXPECT_TRUE(provider->StartProvider(false)); @@ -368,7 +369,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, std::string()); + CheckRequestIsValid(*fetcher, 0, 16, 4, ""); } TEST_F(GeolocationNetworkProviderTest, MultiRegistrations) { @@ -417,7 +418,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, std::string()); + CheckRequestIsValid(*fetcher, 0, kFirstScanAps, 0, ""); // Send a reply with good position fix. const char* kReferenceNetworkResponse = @@ -471,7 +472,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(std::string()); + fetcher->SetResponseString(""); 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 c8d68ac..709063a 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, ":", std::string()); + ReplaceSubstringsAfterOffset(&mac, 0U, ":", ""); 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 0fba7c8..3592505 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, std::string(), version_string, version_string2)); + version_info_.reset( + new VersionInfo(version_op, "", 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, std::string(), version_string, version_string2)); + version_info_.reset( + new VersionInfo(version_op, "", 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, std::string(), date_string, date_string2)); + new VersionInfo(date_op, "", 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, std::string(), version_string, version_string2)); + browser_version_info.reset( + new VersionInfo(version_op, "", 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 8d00a33..b8c3b1f 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,7 +47,8 @@ TEST_F(MachineModelInfoTest, ValidModelInfo) { } TEST_F(MachineModelInfoTest, ModelComparison) { - MachineModelInfo info("=", "model_a", ">", "3.4", std::string()); + MachineModelInfo info("=", "model_a", + ">", "3.4", ""); 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 0cb72a7..f4e0ba6 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], std::string()); + FloatInfo info("=", value[i], ""); 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], std::string(), std::string()); + FloatInfo info(op[i], "", ""); EXPECT_FALSE(info.IsValid()); } { - FloatInfo info("between", "3.14", std::string()); + FloatInfo info("between", "3.14", ""); 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], std::string()); + FloatInfo info("=", value[i], ""); EXPECT_FALSE(info.IsValid()); } } TEST_F(NumberInfoTest, FloatComparison) { { - FloatInfo info("=", "3.14", std::string()); + FloatInfo info("=", "3.14", ""); 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", std::string()); + FloatInfo info(">", "3.14", ""); EXPECT_FALSE(info.Contains(3.14f)); EXPECT_TRUE(info.Contains(3.141f)); EXPECT_FALSE(info.Contains(3.1f)); } { - FloatInfo info("<=", "3.14", std::string()); + FloatInfo info("<=", "3.14", ""); EXPECT_TRUE(info.Contains(3.14f)); EXPECT_FALSE(info.Contains(3.141f)); EXPECT_TRUE(info.Contains(3.1f)); } { - FloatInfo info("any", std::string(), std::string()); + FloatInfo info("any", "", ""); 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], std::string()); + IntInfo info("=", value[i], ""); 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], std::string(), std::string()); + IntInfo info(op[i], "", ""); EXPECT_FALSE(info.IsValid()); } { - IntInfo info("between", "3", std::string()); + IntInfo info("between", "3", ""); 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], std::string()); + IntInfo info("=", value[i], ""); EXPECT_FALSE(info.IsValid()); } } TEST_F(NumberInfoTest, IntComparison) { { - IntInfo info("=", "3", std::string()); + IntInfo info("=", "3", ""); EXPECT_TRUE(info.Contains(3)); EXPECT_FALSE(info.Contains(4)); } { - IntInfo info(">", "3", std::string()); + IntInfo info(">", "3", ""); EXPECT_FALSE(info.Contains(2)); EXPECT_FALSE(info.Contains(3)); EXPECT_TRUE(info.Contains(4)); } { - IntInfo info("<=", "3", std::string()); + IntInfo info("<=", "3", ""); EXPECT_TRUE(info.Contains(2)); EXPECT_TRUE(info.Contains(3)); EXPECT_FALSE(info.Contains(4)); } { - IntInfo info("any", std::string(), std::string()); + IntInfo info("any", "", ""); 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 5ea03b2..8aefb03 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", std::string()); + OsInfo info(os[i], "=", "10.6", ""); EXPECT_TRUE(info.IsValid()); EXPECT_EQ(os_type[i], info.type()); } { - OsInfo info("any", "any", std::string(), std::string()); + OsInfo info("any", "any", "", ""); 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], std::string(), std::string(), std::string()); + OsInfo info(os[i], "", "", ""); EXPECT_FALSE(info.IsValid()); } { - OsInfo info(os[i], "=", std::string(), std::string()); + OsInfo info(os[i], "=", "", ""); EXPECT_FALSE(info.IsValid()); } { - OsInfo info(os[i], std::string(), "10.6", std::string()); + OsInfo info(os[i], "", "10.6", ""); EXPECT_FALSE(info.IsValid()); } } @@ -74,32 +74,34 @@ TEST_F(OsInfoTest, InvalidOsInfo) { "Android", }; for (size_t i = 0; i < arraysize(os_cap); ++i) { - OsInfo info(os_cap[i], "=", "10.6", std::string()); + OsInfo info(os_cap[i], "=", "10.6", ""); EXPECT_FALSE(info.IsValid()); } } TEST_F(OsInfoTest, OsComparison) { { - OsInfo info("any", "any", std::string(), std::string()); + OsInfo info("any", "any", "", ""); 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], std::string())); + EXPECT_TRUE(info.Contains(os_type[i], "")); EXPECT_TRUE(info.Contains(os_type[i], "7.8")); } } { - OsInfo info("win", ">=", "6", std::string()); + OsInfo info("win", ">=", "6", ""); 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, std::string())); + EXPECT_FALSE(info.Contains(GpuControlList::kOsWin, "")); 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 c2c8009..43bb952 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], std::string()); + StringInfo info(op[i], ""); 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 eb18648..f05d71c 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], std::string(), string1, string2); + VersionInfo info(op[i], "", 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", std::string()); + VersionInfo info("=", style[i], "8.9", ""); 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("=", std::string(), number[i], std::string()); + VersionInfo info("=", "", number[i], ""); 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], std::string(), "8.9", std::string()); + VersionInfo info(op[i], "", "8.9", ""); if (op[i] == "between") EXPECT_FALSE(info.IsValid()); else EXPECT_TRUE(info.IsValid()); } { - VersionInfo info(op[i], std::string(), std::string(), std::string()); + VersionInfo info(op[i], "", "", ""); if (op[i] == "any") EXPECT_TRUE(info.IsValid()); else EXPECT_FALSE(info.IsValid()); } { - VersionInfo info(op[i], std::string(), "8.9", "9.0"); + VersionInfo info(op[i], "", "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("=", std::string(), number[i], std::string()); + VersionInfo info("=", "", number[i], ""); EXPECT_FALSE(info.IsValid()); } } TEST_F(VersionInfoTest, VersionComparison) { { - VersionInfo info("any", std::string(), std::string(), std::string()); + VersionInfo info("any", "", "", ""); EXPECT_TRUE(info.Contains("0")); EXPECT_TRUE(info.Contains("8.9")); EXPECT_TRUE(info.Contains("100")); } { - VersionInfo info(">", std::string(), "8.9", std::string()); + VersionInfo info(">", "", "8.9", ""); 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(">=", std::string(), "8.9", std::string()); + VersionInfo info(">=", "", "8.9", ""); 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("=", std::string(), "8.9", std::string()); + VersionInfo info("=", "", "8.9", ""); 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("<", std::string(), "8.9", std::string()); + VersionInfo info("<", "", "8.9", ""); 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("<=", std::string(), "8.9", std::string()); + VersionInfo info("<=", "", "8.9", ""); 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", std::string(), "8.9", "9.1"); + VersionInfo info("between", "", "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("=", std::string(), "1976.3.21", std::string()); + VersionInfo info("=", "", "1976.3.21", ""); 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(">", std::string(), "1976.3.21", std::string()); + VersionInfo info(">", "", "1976.3.21", ""); 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", std::string(), "1976.3.21", "2012.12.25"); + VersionInfo info("between", "", "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", std::string()); + VersionInfo info("<", "lexical", "8.201", ""); 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", std::string()); + VersionInfo info("<", "lexical", "9.002", ""); 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 467cc21..675222b 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, std::string(), std::string(), gpu_info); + InitializeImpl(gpu_blacklist_json, "", "", 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, std::string(), my_gpu_info); + GpuControlList::kOsAny, "", 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, std::string(), my_gpu_info); + GpuControlList::kOsAny, "", 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, std::string(), my_gpu_info); + GpuControlList::kOsAny, "", 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 832b947..36584c3 100644 --- a/content/browser/gpu/gpu_memory_test.cc +++ b/content/browser/gpu/gpu_memory_test.cc @@ -116,8 +116,12 @@ class GpuMemoryTest : public ContentBrowserTest { js_call << mb_to_use; js_call << ");"; std::string message; - ASSERT_TRUE(ExecuteScriptInFrameAndExtractString( - tab_to_load->web_contents(), std::string(), js_call.str(), &message)); + ASSERT_TRUE( + ExecuteScriptInFrameAndExtractString( + tab_to_load->web_contents(), + "", + js_call.str(), + &message)); EXPECT_EQ("DONE_USE_GPU_MEMORY", message); } @@ -192,8 +196,12 @@ class GpuMemoryTest : public ContentBrowserTest { " domAutomationController.send(\"DONE_RAF\");" "})"); std::string message; - ASSERT_TRUE(ExecuteScriptInFrameAndExtractString( - (*it)->web_contents(), std::string(), js_call, &message)); + ASSERT_TRUE( + ExecuteScriptInFrameAndExtractString( + (*it)->web_contents(), + "", + 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 758d2b4..e146a08 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], std::string()); + &test_name_, 0, test_status_prefixes[i], ""); } ui::DisableTestCompositor(); diff --git a/content/browser/media/media_internals_unittest.cc b/content/browser/media/media_internals_unittest.cc index 591a287..0db2580 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(std::string(), item, property, value); + internals_->UpdateItem("", 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 a800ec2..4ae318a 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(), + base::FilePath(FILE_PATH_LITERAL("")), 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 9956326..a315130 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, std::string()); + cmd_line->AppendSwitchASCII(switches::kNoSandbox, ""); #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 e86ea60..756bcc3 100644 --- a/content/browser/renderer_host/gtk_key_bindings_handler.cc +++ b/content/browser/renderer_host/gtk_key_bindings_handler.cc @@ -132,16 +132,15 @@ GtkKeyBindingsHandler* GtkKeyBindingsHandler::GetHandlerOwner( } void GtkKeyBindingsHandler::BackSpace(GtkTextView* text_view) { - GetHandlerOwner(text_view) - ->EditCommandMatched("DeleteBackward", std::string()); + GetHandlerOwner(text_view)->EditCommandMatched("DeleteBackward", ""); } void GtkKeyBindingsHandler::CopyClipboard(GtkTextView* text_view) { - GetHandlerOwner(text_view)->EditCommandMatched("Copy", std::string()); + GetHandlerOwner(text_view)->EditCommandMatched("Copy", ""); } void GtkKeyBindingsHandler::CutClipboard(GtkTextView* text_view) { - GetHandlerOwner(text_view)->EditCommandMatched("Cut", std::string()); + GetHandlerOwner(text_view)->EditCommandMatched("Cut", ""); } void GtkKeyBindingsHandler::DeleteFromCursor( @@ -192,7 +191,7 @@ void GtkKeyBindingsHandler::DeleteFromCursor( count = -count; for (; count > 0; --count) { for (const char* const* p = commands; *p; ++p) - owner->EditCommandMatched(*p, std::string()); + owner->EditCommandMatched(*p, ""); } } @@ -248,7 +247,7 @@ void GtkKeyBindingsHandler::MoveCursor( if (count < 0) count = -count; for (; count > 0; --count) - owner->EditCommandMatched(command, std::string()); + owner->EditCommandMatched(command, ""); } void GtkKeyBindingsHandler::MoveViewport( @@ -257,18 +256,18 @@ void GtkKeyBindingsHandler::MoveViewport( } void GtkKeyBindingsHandler::PasteClipboard(GtkTextView* text_view) { - GetHandlerOwner(text_view)->EditCommandMatched("Paste", std::string()); + GetHandlerOwner(text_view)->EditCommandMatched("Paste", ""); } void GtkKeyBindingsHandler::SelectAll(GtkTextView* text_view, gboolean select) { if (select) - GetHandlerOwner(text_view)->EditCommandMatched("SelectAll", std::string()); + GetHandlerOwner(text_view)->EditCommandMatched("SelectAll", ""); else - GetHandlerOwner(text_view)->EditCommandMatched("Unselect", std::string()); + GetHandlerOwner(text_view)->EditCommandMatched("Unselect", ""); } void GtkKeyBindingsHandler::SetAnchor(GtkTextView* text_view) { - GetHandlerOwner(text_view)->EditCommandMatched("SetMark", std::string()); + GetHandlerOwner(text_view)->EditCommandMatched("SetMark", ""); } 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 e4bb14c..d42cb56 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, std::string(), 0); - RenderViewHost* render_view_host = - RenderViewHost::FromID(render_process_id_, render_view_id_); + content::SocketPermissionRequest::NONE, "", 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 4799d66..08384e78 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,9 +380,7 @@ void PepperUDPSocketPrivateMessageFilter::SendBindError( void PepperUDPSocketPrivateMessageFilter::SendRecvFromError( const ppapi::host::ReplyMessageContext& context, int32_t result) { - SendRecvFromReply(context, - result, - std::string(), + SendRecvFromReply(context, result, "", 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 78eba83..0cc3638 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(std::string()); + reply.WriteString(""); } 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 694e246..efcf84f 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, std::string()); + CreateAndTestRequest(false, ""); 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 2dc6cf8..8f9c3e1 100644 --- a/content/browser/speech/speech_recognition_manager_impl.cc +++ b/content/browser/speech/speech_recognition_manager_impl.cc @@ -100,8 +100,7 @@ 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 : std::string(); + remote_engine_config.origin_url = can_report_metrics ? config.origin_url : ""; 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 4c061c2..2cc4db3 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(std::string()); + fetcher->SetResponseString(""); 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 04127cc..1c44fcc 100644 --- a/content/browser/storage_partition_impl_map_unittest.cc +++ b/content/browser/storage_partition_impl_map_unittest.cc @@ -13,18 +13,13 @@ 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( - 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 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 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 bed96fa..10a02c9 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, std::string()); + TestRequest("GET", kStreamURL, extra_headers, 405, ""); } } // namespace content diff --git a/content/browser/tracing/tracing_ui.cc b/content/browser/tracing/tracing_ui.cc index 40bbee3..aa2e529 100644 --- a/content/browser/tracing/tracing_ui.cc +++ b/content/browser/tracing/tracing_ui.cc @@ -317,11 +317,8 @@ void TracingMessageHandler::OnLoadTraceFile(const base::ListValue* list) { ui::SelectFileDialog::SELECT_OPEN_FILE, string16(), base::FilePath(), - NULL, - 0, - base::FilePath::StringType(), - web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), - NULL); + NULL, 0, FILE_PATH_LITERAL(""), + web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); } void TracingMessageHandler::LoadTraceFileComplete(string16* contents) { @@ -370,11 +367,8 @@ void TracingMessageHandler::OnSaveTraceFile(const base::ListValue* list) { ui::SelectFileDialog::SELECT_SAVEAS_FILE, string16(), base::FilePath(), - NULL, - 0, - base::FilePath::StringType(), - web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), - NULL); + NULL, 0, FILE_PATH_LITERAL(""), + 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 8bc5de1..00857ed 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(std::string()).empty()); + EXPECT_TRUE(entry1_->GetTitleForDisplay("").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(std::string())); + entry1_->GetTitleForDisplay("")); // file:/// URLs should only show the filename. entry1_->SetURL(GURL("file:///foo/bar baz.txt")); EXPECT_EQ(ASCIIToUTF16("bar baz.txt"), - entry1_->GetTitleForDisplay(std::string())); + entry1_->GetTitleForDisplay("")); // Title affects GetTitleForDisplay entry1_->SetTitle(ASCIIToUTF16("Google")); - EXPECT_EQ(ASCIIToUTF16("Google"), entry1_->GetTitleForDisplay(std::string())); + EXPECT_EQ(ASCIIToUTF16("Google"), entry1_->GetTitleForDisplay("")); // 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(std::string())); + EXPECT_EQ(ASCIIToUTF16("title"), entry2_->GetTitleForDisplay("")); // 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 bece8d0..24d1d2b 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(std::string()), html); + EXPECT_EQ(GetMimeType(""), 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 3e67d7f..1be3007 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", std::string()); + RunTest("single_worker.html", ""); } IN_PROC_BROWSER_TEST_F(WorkerTest, MultipleWorkers) { - RunTest("multi_worker.html", std::string()); + RunTest("multi_worker.html", ""); } 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", std::string()); + RunTest("incognito_worker.html", ""); // Incognito worker should not share with non-incognito - RunTest(CreateOffTheRecordBrowser(), "incognito_worker.html", std::string()); + RunTest(CreateOffTheRecordBrowser(), "incognito_worker.html", ""); } // 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", std::string()); + RunTest("worker_close.html", ""); ASSERT_TRUE(WaitForWorkerProcessCount(0)); } |