diff options
Diffstat (limited to 'webkit/glue/glue_util.cc')
-rw-r--r-- | webkit/glue/glue_util.cc | 18 |
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) { |