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

Unified Diff: webkit/blob/blob_data.cc

Issue 8508059: build blob as a component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clean up nits Created 9 years, 1 month 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 | « webkit/blob/blob_data.h ('k') | webkit/blob/blob_export.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/blob/blob_data.cc
diff --git a/webkit/blob/blob_data.cc b/webkit/blob/blob_data.cc
index b73a13921798c59a2a97acf8ad5474c763a7d871..da03639524177569fa5a8f6372c0eb160e218a2f 100644
--- a/webkit/blob/blob_data.cc
+++ b/webkit/blob/blob_data.cc
@@ -5,16 +5,35 @@
#include "webkit/blob/blob_data.h"
#include "base/logging.h"
+#include "base/sys_string_conversions.h"
#include "base/time.h"
+#include "base/utf_string_conversions.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebBlobData.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebData.h"
-#include "webkit/glue/webkit_glue.h"
using WebKit::WebBlobData;
using WebKit::WebData;
using WebKit::WebString;
+namespace {
+
+// TODO(dpranke): These two functions are cloned from webkit_glue
+// to avoid a dependency on that library. This should be fixed.
+FilePath::StringType WebStringToFilePathString(const WebString& str) {
+#if defined(OS_POSIX)
+ return base::SysWideToNativeMB(UTF16ToWideHack(str));
+#elif defined(OS_WIN)
+ return UTF16ToWideHack(str);
+#endif
+}
+
+FilePath WebStringToFilePath(const WebString& str) {
+ return FilePath(WebStringToFilePathString(str));
+}
+
+}
+
namespace webkit_blob {
BlobData::Item::Item()
@@ -42,7 +61,7 @@ BlobData::BlobData(const WebBlobData& data) {
break;
case WebBlobData::Item::TypeFile:
AppendFile(
- webkit_glue::WebStringToFilePath(item.filePath),
+ WebStringToFilePath(item.filePath),
static_cast<uint64>(item.offset),
static_cast<uint64>(item.length),
base::Time::FromDoubleT(item.expectedModificationTime));
« no previous file with comments | « webkit/blob/blob_data.h ('k') | webkit/blob/blob_export.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698