From 629c91530ad4f81cc8c534b68f006b1b29f2885f Mon Sep 17 00:00:00 2001 From: "kinuko@chromium.org" Date: Tue, 21 Aug 2012 03:06:05 +0000 Subject: Cleanup Blob code dependency Removing BlobData::BlobData(const WebBlobData&), and instead adding new NewBlobData(const WebBlobData&) method only for test_shell. BUG=none Review URL: https://chromiumcodereview.appspot.com/10834386 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152497 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/blob/blob_data.cc | 62 ------------------------------------------------ webkit/blob/blob_data.h | 1 - 2 files changed, 63 deletions(-) (limited to 'webkit/blob') diff --git a/webkit/blob/blob_data.cc b/webkit/blob/blob_data.cc index 33ee36b..8947367 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(item.offset), - static_cast(item.length), - base::Time::FromDoubleT(item.expectedModificationTime)); - } - break; - case WebBlobData::Item::TypeBlob: - if (item.length) { - AppendBlob( - item.blobURL, - static_cast(item.offset), - static_cast(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) { diff --git a/webkit/blob/blob_data.h b/webkit/blob/blob_data.h index 3d276f0..9599394 100644 --- a/webkit/blob/blob_data.h +++ b/webkit/blob/blob_data.h @@ -79,7 +79,6 @@ class BLOB_EXPORT BlobData : public base::RefCounted { }; BlobData(); - explicit BlobData(const WebKit::WebBlobData& data); void AppendData(const std::string& data) { AppendData(data.c_str(), data.size()); -- cgit v1.1