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

Unified Diff: Source/modules/filesystem/DOMFilePath.cpp

Issue 124943003: Remove 'String::append' from some of the blink source. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removing the CustomFilterValidatedProgram.cpp from the patch(File is deleted in r164847) Created 6 years, 11 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
« no previous file with comments | « Source/core/loader/WorkerThreadableLoader.cpp ('k') | Source/modules/websockets/WebSocketChannel.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/filesystem/DOMFilePath.cpp
diff --git a/Source/modules/filesystem/DOMFilePath.cpp b/Source/modules/filesystem/DOMFilePath.cpp
old mode 100644
new mode 100755
index fd5b8077e2dcbbd04697b34c9d110943c6ca885e..8016c927c6e402790d303b2de35ae15daeb34cb9
--- a/Source/modules/filesystem/DOMFilePath.cpp
+++ b/Source/modules/filesystem/DOMFilePath.cpp
@@ -33,6 +33,7 @@
#include "wtf/Vector.h"
#include "wtf/text/CString.h"
+#include "wtf/text/StringBuilder.h"
namespace WebCore {
@@ -46,11 +47,8 @@ String DOMFilePath::append(const String& base, const String& components)
String DOMFilePath::ensureDirectoryPath(const String& path)
{
- if (!DOMFilePath::endsWithSeparator(path)) {
- String newPath = path;
- newPath.append(DOMFilePath::separator);
- return newPath;
- }
+ if (!DOMFilePath::endsWithSeparator(path))
+ return path + DOMFilePath::separator;
return path;
}
@@ -103,12 +101,12 @@ String DOMFilePath::removeExtraParentReferences(const String& path)
}
if (canonicalized.isEmpty())
return DOMFilePath::root;
- String result;
+ StringBuilder result;
for (size_t i = 0; i < canonicalized.size(); ++i) {
result.append(DOMFilePath::separator);
result.append(canonicalized[i]);
}
- return result;
+ return result.toString();
}
bool DOMFilePath::isValidPath(const String& path)
« no previous file with comments | « Source/core/loader/WorkerThreadableLoader.cpp ('k') | Source/modules/websockets/WebSocketChannel.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698