Bug 99361 - Re-order CachedRawResource::data() to set m_data earlier
Summary: Re-order CachedRawResource::data() to set m_data earlier
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nate Chapin
URL:
Keywords:
Depends on:
Blocks: 49246
  Show dependency treegraph
 
Reported: 2012-10-15 13:57 PDT by Nate Chapin
Modified: 2012-10-16 09:56 PDT (History)
2 users (show)

See Also:


Attachments
patch (2.96 KB, patch)
2012-10-15 14:04 PDT, Nate Chapin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Chapin 2012-10-15 13:57:16 PDT
Currently, we calculate the diff between the data parameter and m_data, call dataReceived(), then set m_data to data.

If something inside dataReceived() tries to access m_data via CachedResource::resourceBuffer(), it will see the old data instead of the new data, which seems inconsistent.

To the best of my knowledge, this isn't needed currently, but it's necessary for caching main resources, as much more work will be done on main resource dataReceived() callbacks.
Comment 1 Nate Chapin 2012-10-15 14:04:54 PDT
Created attachment 168775 [details]
patch
Comment 2 Adam Barth 2012-10-16 09:51:20 PDT
Comment on attachment 168775 [details]
patch

ok
Comment 3 WebKit Review Bot 2012-10-16 09:56:20 PDT
Comment on attachment 168775 [details]
patch

Clearing flags on attachment: 168775

Committed r131467: <http://trac.webkit.org/changeset/131467>
Comment 4 WebKit Review Bot 2012-10-16 09:56:23 PDT
All reviewed patches have been landed.  Closing bug.