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

Unified Diff: webkit/blob/blob_data.cc

Issue 10834386: Cleanup Blob code dependency (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months 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/tools/test_shell/test_shell_webblobregistry_impl.cc » ('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 33ee36b9faacb2f016e2fa9f6681bd28223ef09f..894736754a37796495c4e1aac874c04195492aa2 100644
--- a/webkit/blob/blob_data.cc
+++ b/webkit/blob/blob_data.cc
@@ -8,31 +8,6 @@
#include "base/sys_string_conversions.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebBlobData.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.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 {
@@ -47,43 +22,6 @@ BlobData::Item::~Item() {}
BlobData::BlobData() {}
-BlobData::BlobData(const WebBlobData& data) {
- size_t i = 0;
- WebBlobData::Item item;
- while (data.itemAt(i++, item)) {
- switch (item.type) {
- case WebBlobData::Item::TypeData:
- if (!item.data.isEmpty()) {
- // WebBlobData does not allow partial data.
- DCHECK(!item.offset && item.length == -1);
- AppendData(item.data);
- }
- break;
- case WebBlobData::Item::TypeFile:
- if (item.length) {
- AppendFile(
- WebStringToFilePath(item.filePath),
- static_cast<uint64>(item.offset),
- static_cast<uint64>(item.length),
- base::Time::FromDoubleT(item.expectedModificationTime));
- }
- break;
- case WebBlobData::Item::TypeBlob:
- if (item.length) {
- AppendBlob(
- item.blobURL,
- static_cast<uint64>(item.offset),
- static_cast<uint64>(item.length));
- }
- break;
- default:
- NOTREACHED();
- }
- }
- content_type_= data.contentType().utf8().data();
- content_disposition_ = data.contentDisposition().utf8().data();
-}
-
BlobData::~BlobData() {}
void BlobData::AppendData(const char* data, size_t length) {
« no previous file with comments | « webkit/blob/blob_data.h ('k') | webkit/tools/test_shell/test_shell_webblobregistry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698