summaryrefslogtreecommitdiffstats
path: root/base/file_path.h
diff options
context:
space:
mode:
authordeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-29 13:11:36 +0000
committerdeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-29 13:11:36 +0000
commit2423881b28e6944b3f61fe70af6222ef0a75d59e (patch)
tree312b39ed379bd480db83b143fba419205698aed9 /base/file_path.h
parentb7b24f6a1512fdfb3b1f292242e62490b5c6b9fd (diff)
downloadchromium_src-2423881b28e6944b3f61fe70af6222ef0a75d59e.zip
chromium_src-2423881b28e6944b3f61fe70af6222ef0a75d59e.tar.gz
chromium_src-2423881b28e6944b3f61fe70af6222ef0a75d59e.tar.bz2
Move a few functions commonly called with char* to StringPiece.
In some cases this will avoid the implicit char* -> std::string conversion, object creation, and string copying. One of the biggest benefit is on Windows, where we can save some conversions in FilePath::AppendASCII. Review URL: http://codereview.chromium.org/113996 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17182 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_path.h')
-rw-r--r--base/file_path.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/base/file_path.h b/base/file_path.h
index d4f35d1..73de4a6 100644
--- a/base/file_path.h
+++ b/base/file_path.h
@@ -70,6 +70,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/hash_tables.h"
+#include "base/string_piece.h" // For implicit conversions.
// Windows-style drive letter support and pathname separator characters can be
// enabled and disabled independently, to aid testing. These #defines are
@@ -199,7 +200,7 @@ class FilePath {
// On Linux, although it can use any 8-bit encoding for paths, we assume that
// ASCII is a valid subset, regardless of the encoding, since many operating
// system paths will always be ASCII.
- FilePath AppendASCII(const std::string& component) const WARN_UNUSED_RESULT;
+ FilePath AppendASCII(const StringPiece& component) const WARN_UNUSED_RESULT;
// Returns true if this FilePath contains an absolute path. On Windows, an
// absolute path begins with either a drive letter specification followed by