[Webkit-unassigned] [Bug 36903] Implement BlobBuilder internal class for BlobBuilder support as defined in FileWriter

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 27 18:43:19 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=36903





--- Comment #8 from Kinuko Yasuda <kinuko at chromium.org>  2010-04-27 18:43:18 PST ---
Thanks for your comments.  Let me update with the current status.

(In reply to comment #7)
> Looking at the patch, I think we can make what you have as CombinedBlob to be
> the only type of the blob... A Blob. It would be always a list of BlobItems. A
> BlobItem would be an abstract class, with implementations like FileBlobItem,
> StringBlobItem, ByteArrayBlobItem.When File derives from the Blob, such Blob
> would only have 1 FielBlobitem in the list... StringBlobItem would be the one
> constructed from string and stored in a mutable list of BlobBuilder. Once
> BlobBuilder::getBlob() (it probably should be createBlob()) is called, the new
> list created, with FileBlobItems just copied, and StringBlobItems replaced with
> ByteArrayBlobItems, with encoding and current endings attached.

I've started to make those changes with an attempt to refactor BlobBuilder and
FormData.

In my local tree I'm trying / have tried to:
- move most of Blob implementation into BlobItems and make Blob a simple
collection of BlobItems.
- File would be a special Blob that contains only one FileBlobItem.
- BlobBuilder would be a very lightweight class as well.
- refactor FormDataList::Item and FormDataElement as a wrapper of BlobItem. 
This makes appending Blobs to FormData much simpler (it can just pass a list of
BlobItems).  For now I'm trying to make them keep the same interface as before
to avoid refactoring in platform-dependent code.

The changes are still rough but I want to get some feedbacks in a design aspect
before I go too far.
How do they sound to you?

Fyi my current patch is uploaded at:
http://codereview.chromium.org/1769002

> BTW, why do we need to make all Blobs (or BlobItems, if we'll have them)
> ThreadSafeShared? I suspect it's because of the FileThread?

No, we won't need it to be ThreadSafeShared.
When I wrote the initial patch I wasn't very sure but in the current design
it'll be ok without making it ThreadSafeShared (at least for FileReader/Writer
usage).

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list