Original report: https://code.google.com/p/chromium/issues/detail?id=166374 To reproduce, go to a plugin that loads as a main resource in a chromium canary (e.g., http://www.scb.se/statistik/_publikationer/NR0001_2012K02_TI_A28TI1203.pdf). That 4MB pdf can easily consume multiple GBs of memory. The problem is that CachedRawResource implicitly assumes that, if setShouldBufferData() will be called, it will be called before the load starts. PluginDocument calls it after receiving the first chunk of data, which leaves CachedRawResource in an inconsistent state> It ends up sending the entirety of the data received so far in each callback instead of only the incremental data.
Created attachment 180047 [details] patch
Comment on attachment 180047 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=180047&action=review > Source/WebCore/ChangeLog:12 > + (WebCore::ResourceLoader::setShouldBufferData): shouldBufferData is an enum, not a boolean, so this is reversed. It's named as a boolean, so it should be renamed.
(In reply to comment #2) > (From update of attachment 180047 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=180047&action=review > > > Source/WebCore/ChangeLog:12 > > + (WebCore::ResourceLoader::setShouldBufferData): shouldBufferData is an enum, not a boolean, so this is reversed. > > It's named as a boolean, so it should be renamed. true I'll do that in a separate patch.
Comment on attachment 180047 [details] patch Clearing flags on attachment: 180047 Committed r138174: <http://trac.webkit.org/changeset/138174>
All reviewed patches have been landed. Closing bug.