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

Unified Diff: WebCore/platform/chromium/ChromiumDataObjectItem.cpp

Issue 11192017: ********** WebCore blob hacking (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/Source/
Patch Set: Created 8 years, 2 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
Index: WebCore/platform/chromium/ChromiumDataObjectItem.cpp
===================================================================
--- WebCore/platform/chromium/ChromiumDataObjectItem.cpp (revision 132804)
+++ WebCore/platform/chromium/ChromiumDataObjectItem.cpp (working copy)
@@ -143,13 +143,14 @@
// method to the blob registry; that way the data is only copied over
// into the renderer when it's actually read, not when the blob is
// initially constructed).
+ // TODO: Could use a BlobRegistry interface to create a blobDataHandle directly from the clipboard data w/o having to read it?
RefPtr<SharedBuffer> data = static_cast<PassRefPtr<SharedBuffer> >(WebKit::Platform::current()->clipboard()->readImage(WebKit::WebClipboard::BufferStandard));
RefPtr<RawData> rawData = RawData::create();
rawData->mutableData()->append(data->data(), data->size());
OwnPtr<BlobData> blobData = BlobData::create();
blobData->appendData(rawData, 0, -1);
blobData->setContentType(mimeTypeImagePng);
- return Blob::create(blobData.release(), data->size());
+ return Blob::create(BlobDataHandle::create(blobData.release(), data->size()));
}
return 0;

Powered by Google App Engine
This is Rietveld 408576698