[fsp] Fix crash when reading files.
Before, the net::IOBuffer was being passed as a pointer, from the FileStreamReader::Read to operations::ReadFile. However, there are PostTask invocations on the way. When FileStreamReader is deleted after a PostTask is fired from FileStreamReader::Read, and the operation is not completed, then the net::IOBuffer will become invalid. When the operation is completed, operation::ReadFile would cause a segmentation fault. Since net::IOBuffer is ref counted, we should pass it as ref counted object to be sure, that the buffer is always valid. This patch migrates from passing IOBuffer as a pointer, to scoped_refptr. TEST=Tested manually, that crashing doesn't occur anymore. BUG=248427 Review URL: https://codereview.chromium.org/301973007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274174 0039d316-1c4b-4281-b951-d872f2087c98
Showing
Please register or sign in to comment