Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(542)

Unified Diff: content/shell/renderer/test_runner/TestCommon.cpp

Issue 373443002: Remove all uses of "using namespace std" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adding myself in AUTHORS Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/shell/renderer/test_runner/TestCommon.cpp
diff --git a/content/shell/renderer/test_runner/TestCommon.cpp b/content/shell/renderer/test_runner/TestCommon.cpp
index 24e642d456a0e922cb8c585574019b0b83947196..a4976a0eed0b120429995bae8bf9494cfb53e472 100644
--- a/content/shell/renderer/test_runner/TestCommon.cpp
+++ b/content/shell/renderer/test_runner/TestCommon.cpp
@@ -4,31 +4,29 @@
#include "content/shell/renderer/test_runner/TestCommon.h"
-using namespace std;
-
namespace content {
namespace {
const char layoutTestsPattern[] = "/LayoutTests/";
-const string::size_type layoutTestsPatternSize = sizeof(layoutTestsPattern) - 1;
+const std::string::size_type layoutTestsPatternSize = sizeof(layoutTestsPattern) - 1;
const char fileUrlPattern[] = "file:/";
const char fileTestPrefix[] = "(file test):";
const char dataUrlPattern[] = "data:";
-const string::size_type dataUrlPatternSize = sizeof(dataUrlPattern) - 1;
+const std::string::size_type dataUrlPatternSize = sizeof(dataUrlPattern) - 1;
} // namespace
-string normalizeLayoutTestURL(const string& url)
+std::string normalizeLayoutTestURL(const std::string& url)
{
- string result = url;
+ std::string result = url;
size_t pos;
- if (!url.find(fileUrlPattern) && ((pos = url.find(layoutTestsPattern)) != string::npos)) {
+ if (!url.find(fileUrlPattern) && ((pos = url.find(layoutTestsPattern)) != std::string::npos)) {
// adjust file URLs to match upstream results.
result.replace(0, pos + layoutTestsPatternSize, fileTestPrefix);
} else if (!url.find(dataUrlPattern)) {
// URL-escape data URLs to match results upstream.
- string path = url.substr(dataUrlPatternSize);
+ std::string path = url.substr(dataUrlPatternSize);
result.replace(dataUrlPatternSize, url.length(), path);
}
return result;
« no previous file with comments | « content/shell/renderer/test_runner/SpellCheckClient.cpp ('k') | content/shell/renderer/test_runner/TestInterfaces.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698