Bug 138174

Summary: Eliminate ResourceBuffer and use SharedBuffer directly instead
Product: WebKit Reporter: Darin Adler <darin>
Component: Page LoadingAssignee: Darin Adler <darin>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, ap, beidson, commit-queue, kling, koivisto, ossy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 138327    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Darin Adler 2014-10-29 08:28:52 PDT
Eliminate ResourceBuffer and use SharedBuffer directly instead
Comment 1 Darin Adler 2014-10-29 09:49:45 PDT
Created attachment 240607 [details]
Patch
Comment 2 Darin Adler 2014-10-29 09:57:05 PDT
Looks like I didn’t update the EFL build system to remove the reference to ResourceBuffer.
Comment 3 Darin Adler 2014-10-29 09:57:28 PDT
Still interested in review of this first cut, though.
Comment 4 Antti Koivisto 2014-10-29 11:58:14 PDT
Comment on attachment 240607 [details]
Patch

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

> Source/WebCore/loader/cache/CachedResource.h:361
> +class CachedResource::Callback {
> +public:
> +    Callback(CachedResource&, CachedResourceClient&);
> +
> +    void cancel();
> +
> +private:
> +    void timerFired(Timer<Callback>&);
> +
> +    CachedResource& m_resource;
> +    CachedResourceClient& m_client;
> +    Timer<Callback> m_timer;
> +};

You could probably remove this awkward type and use a lambda.
Comment 5 Darin Adler 2014-10-29 20:20:46 PDT
Comment on attachment 240607 [details]
Patch

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

>> Source/WebCore/loader/cache/CachedResource.h:361
>> +};
> 
> You could probably remove this awkward type and use a lambda.

Good direction; but for the moment, not sure how to use a lambda with a Timer since there’s no std::function version yet.
Comment 6 Darin Adler 2014-10-30 08:46:57 PDT
Created attachment 240673 [details]
Patch
Comment 7 Darin Adler 2014-10-30 09:08:32 PDT
Created attachment 240675 [details]
Patch
Comment 8 Darin Adler 2014-10-30 09:43:09 PDT
Created attachment 240679 [details]
Patch
Comment 9 Darin Adler 2014-10-30 19:31:28 PDT
Created attachment 240721 [details]
Patch
Comment 10 Darin Adler 2014-10-30 21:25:29 PDT
Committed r175406: <http://trac.webkit.org/changeset/175406>
Comment 11 Csaba Osztrogonác 2014-10-31 05:06:14 PDT
(In reply to comment #10)
> Committed r175406: <http://trac.webkit.org/changeset/175406>

It made 15 tests crash on Apple's debug bots.
Comment 12 Antti Koivisto 2014-10-31 14:10:05 PDT
Looking
Comment 13 Antti Koivisto 2014-10-31 14:14:46 PDT
http://trac.webkit.org/changeset/175423 should help
Comment 14 Alexey Proskuryakov 2014-11-03 11:36:12 PST
Some tests are still broken after this change.

https://build.webkit.org/results/Apple%20Yosemite%20Debug%20WK1%20(Tests)/r175469%20(258)/results.html
Comment 15 Alexey Proskuryakov 2014-11-03 11:45:54 PST
CRASHING TEST:/multipart/stop-crash.html

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.JavaScriptCore      	0x000000010d817bfa WTFCrash + 42
1   com.apple.WebCore             	0x000000010f0ce16e WTF::PassRef<WebCore::SharedBuffer>::~PassRef() + 62 (PassRef.h:102)
2   com.apple.WebCore             	0x000000010f0cda15 WTF::PassRef<WebCore::SharedBuffer>::~PassRef() + 21 (PassRef.h:103)
3   com.apple.WebCore             	0x0000000110aa440c WebCore::SubresourceLoader::didReceiveResponse(WebCore::ResourceResponse const&) + 764 (SubresourceLoader.cpp:239)
4   com.apple.WebKit              	0x000000010ac27a87 WebKit::WebResourceLoader::didReceiveResponse(WebCore::ResourceResponse const&, bool) + 311 (WebResourceLoader.cpp:129)
5   com.apple.WebKit              	0x000000010ac2b6fa void IPC::callMemberFunctionImpl<WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(WebCore::ResourceResponse const&, bool), std::__1::tuple<WebCore::ResourceResponse, bool>, 0ul, 1ul>(WebKit::WebResourceLoader*, void (WebKit::WebResourceLoader::*)(WebCore::ResourceResponse const&, bool), std::__1::tuple<WebCore::ResourceResponse, bool>&&, std::index_sequence<0ul, 1ul>) + 186 (HandleMessage.h:17)
Comment 16 WebKit Commit Bot 2014-11-03 14:20:25 PST
Re-opened since this is blocked by bug 138327
Comment 17 Alexey Proskuryakov 2014-11-03 14:29:07 PST
Rolled out the patch and follow-up fixes in <https://trac.webkit.org/r175491>.
Comment 18 Darin Adler 2014-11-04 08:47:47 PST
Committed r175549: <http://trac.webkit.org/changeset/175549>
Comment 19 Darin Adler 2014-11-04 08:55:33 PST
Oops, one test still failing. Opening a new bug to fix that.
Comment 20 Andy Estes 2014-11-04 11:12:32 PST
Landed an iOS build fix: http://trac.webkit.org/changeset/175552