WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
134732
Move resource buffering from SynchronousLoaderClient to NetworkResourceLoader
https://bugs.webkit.org/show_bug.cgi?id=134732
Summary
Move resource buffering from SynchronousLoaderClient to NetworkResourceLoader
Pratik Solanki
Reported
2014-07-08 10:39:02 PDT
We want to buffer JS and CSS and resources as well - see
bug 134560
. In order to share code, we should move the buffering code SynchronousLoaderClient to NetworkResourceLoader.
Attachments
Patch
(9.96 KB, patch)
2014-07-08 10:46 PDT
,
Pratik Solanki
darin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Pratik Solanki
Comment 1
2014-07-08 10:46:44 PDT
Created
attachment 234572
[details]
Patch
Darin Adler
Comment 2
2014-07-08 16:19:36 PDT
Comment on
attachment 234572
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=234572&action=review
> Source/WebKit2/NetworkProcess/SynchronousNetworkLoaderClient.cpp:104 > + ASSERT(loader);
Assertion that an argument is non-null is a clue that the argument should be a reference rather than a pointer.
> Source/WebKit2/NetworkProcess/SynchronousNetworkLoaderClient.cpp:116 > + Vector<char> responseData; > + SharedBuffer* buffer = loader->bufferedData(); > + if (buffer && buffer->size()) > + responseData.append(buffer->data(), buffer->size()); > + > + m_delayedReply->send(m_error, m_response, responseData);
It’s annoying to have to put this into a Vector. What does send do with the Vector? Can we somehow avoid the copy by using either move or getting the bits directly from the SharedBuffer.
> Source/WebKit2/NetworkProcess/SynchronousNetworkLoaderClient.h:63 > + void sendDelayedReply(NetworkResourceLoader*);
This should take a reference rather than a pointer.
Pratik Solanki
Comment 3
2014-07-08 17:34:36 PDT
Comment on
attachment 234572
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=234572&action=review
>> Source/WebKit2/NetworkProcess/SynchronousNetworkLoaderClient.cpp:104 >> + ASSERT(loader); > > Assertion that an argument is non-null is a clue that the argument should be a reference rather than a pointer.
True. I'll make this a reference.
>> Source/WebKit2/NetworkProcess/SynchronousNetworkLoaderClient.cpp:116 >> + m_delayedReply->send(m_error, m_response, responseData); > > It’s annoying to have to put this into a Vector. What does send do with the Vector? Can we somehow avoid the copy by using either move or getting the bits directly from the SharedBuffer.
I didn't like this as well but it didn't seem much worse than we had before. send() seems to be generated code and it looks like it just passes the Vector down to the encoder. I think we should be able to modify it to take SharedBuffer but it's not straightforward. I'll ask Anders.
>> Source/WebKit2/NetworkProcess/SynchronousNetworkLoaderClient.h:63 >> + void sendDelayedReply(NetworkResourceLoader*); > > This should take a reference rather than a pointer.
Ok.
Pratik Solanki
Comment 4
2014-07-09 13:56:16 PDT
Committed
r170928
: <
http://trac.webkit.org/changeset/170928
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug