Bug 112310 - Add a mode to ResourceLoader that takes SharedBuffers instead of raw pointers and lengths
Summary: Add a mode to ResourceLoader that takes SharedBuffers instead of raw pointers...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-03-13 19:10 PDT by Brady Eidson
Modified: 2013-03-15 13:55 PDT (History)
6 users (show)

See Also:


Attachments
Patch v1 (24.02 KB, patch)
2013-03-13 23:32 PDT, Brady Eidson
aestes: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2013-03-13 19:10:49 PDT
Add a mode to ResourceLoader that takes SharedBuffers instead of raw pointers and lengths.

For platforms whose ResourceHandle::didReceiveData implementation gets some sort of buffer object (Mac, CF, qt, soup) this is an optimization that can be used today to avoid at least one data copy in many cases.

For other platforms whose ResourceHandle::didReceiveData implementations get raw pointers and lengths themselves, it is possible that they have options to rewrite their platform layers to use some sort of shared buffer object or introduce special modes to SharedBuffer that could help encapsulate the same thing.

Some day we might be able to get away from the current didReceiveData(char*, int) model entirely and work solely with SharedBuffers...  but we can't do that today without introducing a "copy into a SharedBuffer" step to those other platforms.
Comment 1 Brady Eidson 2013-03-13 19:11:16 PDT
In radar as <rdar://problem/13416953>
Comment 2 Brady Eidson 2013-03-13 23:32:16 PDT
Created attachment 193073 [details]
Patch v1

Patch to get the EWS ball rolling while I finish up layout tests locally (so far so good)
Comment 3 Andy Estes 2013-03-13 23:54:38 PDT
Comment on attachment 193073 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=193073&action=review

> Source/WebCore/ChangeLog:18
> +        that can be a much bigger win then simply avoiding a copy.

than, not then.
Comment 4 Build Bot 2013-03-14 00:08:14 PDT
Comment on attachment 193073 [details]
Patch v1

Attachment 193073 [details] did not pass win-ews (win):
Output: http://webkit-commit-queue.appspot.com/results/17180106
Comment 5 Brady Eidson 2013-03-14 00:20:16 PDT
(In reply to comment #4)
> (From update of attachment 193073 [details])
> Attachment 193073 [details] did not pass win-ews (win):
> Output: http://webkit-commit-queue.appspot.com/results/17180106

The failure is bizarre, as it implies willStopBufferingData is not in the ResourceHandleClient base class, which it is...  but oh well.  WIll fix before landing.
Comment 6 Brady Eidson 2013-03-14 09:31:20 PDT
http://trac.webkit.org/changeset/145820