Bug 77715 - SharedBuffer m_segments and m_dataArray must be exclusive
Summary: SharedBuffer m_segments and m_dataArray must be exclusive
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Pratik Solanki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-02-02 22:19 PST by Benjamin Poulain
Modified: 2013-08-29 11:00 PDT (History)
2 users (show)

See Also:


Attachments
Patch (6.13 KB, patch)
2012-11-29 13:59 PST, Pratik Solanki
no flags Details | Formatted Diff | Diff
Patch (5.57 KB, patch)
2013-05-03 12:05 PDT, Pratik Solanki
benjamin: review+
benjamin: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2012-02-02 22:19:15 PST
There is a clear order and size relation between m_buffer and m_segments.

With m_dataArray, there is the implicit rule that m_dataArray comes after m_buffer and m_segments, and all segments are completely full.

In practice, we never mix m_dataArray and m_segments (well, I hope at least) which is why that works.

We should make those relations explicit.

Related to:
<rdar://problem/10801705>
Comment 1 Benjamin Poulain 2012-02-03 17:46:37 PST
<rdar://problem/10808108>
Comment 2 Pratik Solanki 2012-11-19 12:56:25 PST
Updating title. m_buffer is still needed even with data array. Also taking bug since I have a patch.
Comment 3 Pratik Solanki 2012-11-29 13:59:55 PST
Created attachment 176814 [details]
Patch
Comment 4 Pratik Solanki 2013-05-03 12:05:44 PDT
Created attachment 200453 [details]
Patch
Comment 5 Benjamin Poulain 2013-05-03 16:06:00 PDT
Comment on attachment 200453 [details]
Patch

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

> Source/WebCore/platform/SharedBuffer.cpp:211
> +        m_buffer.reserveInitialCapacity(length);

I don't think that matters. The append() call has the size, it will allocate the best block size for the input.
Comment 6 Pratik Solanki 2013-05-03 16:33:04 PDT
Comment on attachment 200453 [details]
Patch

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

>> Source/WebCore/platform/SharedBuffer.cpp:211
>> +        m_buffer.reserveInitialCapacity(length);
> 
> I don't think that matters. The append() call has the size, it will allocate the best block size for the input.

That change was inspired by <http://trac.webkit.org/changeset/135098> made for bug 102625
Comment 7 Pratik Solanki 2013-08-28 17:13:13 PDT
Hmm.. Looks like I never checked this in. :( I am going to rebase the patch, make sure it works and maybe upload a new one for review.
Comment 8 Pratik Solanki 2013-08-28 17:50:19 PDT
Looks like the patch compiles and runs fine with USE(NETWORK_CFDATA_ARRAY_CALLBACK) disabled. If it works fine with the flag turned on, I'll just go ahead and commit.
Comment 9 Pratik Solanki 2013-08-29 11:00:43 PDT
Committed r154823: <http://trac.webkit.org/changeset/154823>