[Fetch API] Use Ref<const T> in FetchBody::m_data variant
https://bugs.webkit.org/show_bug.cgi?id=162599

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-27
Reviewed by Alex Christensen.

Source/WebCore:

Covered by existing tests.

Using Ref<const T> for all variants of m_data except for FormData since FetchBody is actually creating it and may modifiy it.
Updating blob loading code path to use a const Blob& instead of a Blob&.

* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::FetchBody):
(WebCore::FetchBody::extract):
(WebCore::FetchBody::clone):
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::blobBody):
(WebCore::FetchBody::arrayBufferBody):
(WebCore::FetchBody::arrayBufferViewBody):
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::loadBlob):
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start):
* Modules/fetch/FetchLoader.h:

Source/WTF:

Enabling to use DeferrableRefCounted<const T> by making m_refCount mutable.

* wtf/DeferrableRefCounted.h:
(WTF::DeferrableRefCountedBase::ref):
(WTF::DeferrableRefCountedBase::derefBase):
(WTF::DeferrableRefCounted::deref):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@206438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
9 files changed