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

Unified Diff: ppapi/shared_impl/file_path.cc

Issue 11437038: Revert 171408 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years 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 | « ppapi/shared_impl/file_path.h ('k') | ppapi/shared_impl/ppb_flash_shared.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/file_path.cc
diff --git a/ppapi/shared_impl/file_path.cc b/ppapi/shared_impl/file_path.cc
index 1502d898589e9fd5b1263dc069c32e884eff5a46..1208b0803e2fad335495057cb4dcf7ab319dbdf5 100644
--- a/ppapi/shared_impl/file_path.cc
+++ b/ppapi/shared_impl/file_path.cc
@@ -4,8 +4,26 @@
#include "ppapi/shared_impl/file_path.h"
+#include <string>
+
+#if defined(OS_WIN)
+#include "base/utf_string_conversions.h"
+#endif
+
namespace ppapi {
+namespace {
+
+FilePath GetFilePathFromUTF8(const std::string& utf8_path) {
+#if defined(OS_WIN)
+ return FilePath(UTF8ToUTF16(utf8_path));
+#else
+ return FilePath(utf8_path);
+#endif
+}
+
+} // namespace
+
PepperFilePath::PepperFilePath()
: domain_(DOMAIN_INVALID),
path_() {
@@ -17,4 +35,17 @@ PepperFilePath::PepperFilePath(Domain domain, const FilePath& path)
// TODO(viettrungluu): Should we DCHECK() some things here?
}
+// static
+PepperFilePath PepperFilePath::MakeAbsolute(const FilePath& path) {
+ return PepperFilePath(DOMAIN_ABSOLUTE, path);
+}
+
+// static
+PepperFilePath PepperFilePath::MakeModuleLocal(const std::string& name,
+ const char* utf8_path) {
+ FilePath full_path = GetFilePathFromUTF8(name).Append(
+ GetFilePathFromUTF8(utf8_path));
+ return PepperFilePath(DOMAIN_MODULE_LOCAL, full_path);
+}
+
} // namespace ppapi
« no previous file with comments | « ppapi/shared_impl/file_path.h ('k') | ppapi/shared_impl/ppb_flash_shared.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698