summaryrefslogtreecommitdiffstats
path: root/webkit/glue/glue_util.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-14 01:20:41 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-14 01:20:41 +0000
commitbae0ea1f95c5c3a02761d942c0802ec877c1a106 (patch)
tree456d3b2eb7cc4fc497870385223c88312db8a914 /webkit/glue/glue_util.cc
parent8a5deb2ef0a4cc84b06a3466b32e94375110106c (diff)
downloadchromium_src-bae0ea1f95c5c3a02761d942c0802ec877c1a106.zip
chromium_src-bae0ea1f95c5c3a02761d942c0802ec877c1a106.tar.gz
chromium_src-bae0ea1f95c5c3a02761d942c0802ec877c1a106.tar.bz2
Change mime type utils to operate on platform-specific string types for filenames/file extensions.
Review URL: http://codereview.chromium.org/21327 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9809 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/glue_util.cc')
-rw-r--r--webkit/glue/glue_util.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/webkit/glue/glue_util.cc b/webkit/glue/glue_util.cc
index 3759b2b..52ace87 100644
--- a/webkit/glue/glue_util.cc
+++ b/webkit/glue/glue_util.cc
@@ -8,7 +8,9 @@
#include "webkit/glue/glue_util.h"
#include "base/compiler_specific.h"
#include "base/gfx/rect.h"
+#include "base/string_part.h"
#include "base/string_util.h"
+#include "base/sys_string_conversions.h"
MSVC_PUSH_WARNING_LEVEL(0);
#undef LOG
@@ -75,6 +77,22 @@ WebCore::String StdStringToString(const std::string& str) {
static_cast<unsigned>(str.length()));
}
+FilePath::StringType StringToFilePathString(const WebCore::String& str) {
+#if defined(OS_WIN)
+ return StringToStdWString(str);
+#elif defined(OS_POSIX)
+ return base::SysWideToNativeMB(StringToStdWString(str));
+#endif
+}
+
+WebCore::String FilePathStringToString(const FilePath::StringType& str) {
+#if defined(OS_WIN)
+ return StdWStringToString(str);
+#elif defined(OS_POSIX)
+ return StdWStringToString(base::SysNativeMBToWide(str));
+#endif
+}
+
// URL conversions -------------------------------------------------------------
GURL KURLToGURL(const WebCore::KURL& url) {