WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 77718
SharedBuffer::getSomeData() must support m_dataArray if NETWORK_CFDATA_ARRAY_CALLBACK is defined
https://bugs.webkit.org/show_bug.cgi?id=77718
Summary
SharedBuffer::getSomeData() must support m_dataArray if NETWORK_CFDATA_ARRAY_...
Benjamin Poulain
Reported
2012-02-02 22:58:00 PST
We ignore the data of m_dataArray at the moment, which causes crashes in many tests. Radar: <
rdar://problem/10786745
> Related to
https://bugs.webkit.org/show_bug.cgi?id=77715
Patch coming after I get some sleep :)
Attachments
Patch
(4.74 KB, patch)
2012-02-03 14:48 PST
,
Benjamin Poulain
ddkilzer
: review+
ddkilzer
: commit-queue-
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Benjamin Poulain
Comment 1
2012-02-03 14:48:11 PST
Created
attachment 125422
[details]
Patch
Benjamin Poulain
Comment 2
2012-02-03 16:40:43 PST
Comment on
attachment 125422
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=125422&action=review
Thinking about it...here is a couple more ASSERT() to avoid future problems. Tell me if you can think of useful additional ones.
> Source/WebCore/platform/SharedBuffer.cpp:261 > + someData = m_segments[segment] + positionInSegment;
ASSERT(segment < m_segments.size());
> Source/WebCore/platform/SharedBuffer.cpp:265 > + position -= maxSegmentedSize;
ASSERT(maxSegmentedSize <= position);
> Source/WebCore/platform/cf/SharedBufferCF.cpp:125 > + unsigned localOffset = position - totalOffset;
ASSERT(totalOffset <= position);
Pratik Solanki
Comment 3
2012-02-03 18:01:49 PST
Comment on
attachment 125422
[details]
Patch Patch looks fine to me. But yeah, we should really fix
bug 77715
. I'm surprised this was all working so far with this bug.
David Kilzer (:ddkilzer)
Comment 4
2012-02-11 21:41:48 PST
Comment on
attachment 125422
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=125422&action=review
r=me
>> Source/WebCore/platform/SharedBuffer.cpp:261 >> + someData = m_segments[segment] + positionInSegment; > > ASSERT(segment < m_segments.size());
This is a redundant ASSERT(). It will always be true inside this if statement because it's already checking (segment < segments) and segments = m_segments.size().
> Source/WebCore/platform/SharedBuffer.cpp:269 > +#endif > + ASSERT_NOT_REACHED(); > + return 0;
The last part of this method should be in an #else/#endif clause: #else ASSERT_NOT_REACHED(); return 0; #endif
> Source/WebCore/platform/cf/SharedBufferCF.cpp:121 > + Vector<RetainPtr<CFDataRef> >::const_iterator end = m_dataArray.end();
Nit: Might be nice to have a typedef for Vector<RetainPtr<CFDataRef> >.
Benjamin Poulain
Comment 5
2012-02-11 22:09:35 PST
It is <
rdar://problem/10801705
> Sorry David.
Benjamin Poulain
Comment 6
2012-02-13 17:28:16 PST
Committed
r107648
: <
http://trac.webkit.org/changeset/107648
>
Benjamin Poulain
Comment 7
2012-02-13 17:29:17 PST
> > Source/WebCore/platform/cf/SharedBufferCF.cpp:121 > > + Vector<RetainPtr<CFDataRef> >::const_iterator end = m_dataArray.end(); > > Nit: Might be nice to have a typedef for Vector<RetainPtr<CFDataRef> >.
This is a good idea for the whole class. I'll fix that separately:
https://bugs.webkit.org/show_bug.cgi?id=78552
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