Chromium Code Reviews| Index: third_party/WebKit/Source/core/fetch/Resource.cpp |
| diff --git a/third_party/WebKit/Source/core/fetch/Resource.cpp b/third_party/WebKit/Source/core/fetch/Resource.cpp |
| index 12621de8365409e9784d700520514048d1d857c3..124cca3bca2360db40c368935d86739fc4f8fd83 100644 |
| --- a/third_party/WebKit/Source/core/fetch/Resource.cpp |
| +++ b/third_party/WebKit/Source/core/fetch/Resource.cpp |
| @@ -204,8 +204,6 @@ DEFINE_TRACE(Resource) |
| #if ENABLE(OILPAN) |
| visitor->trace(m_cacheHandler); |
| #endif |
| - visitor->trace(m_multipartParser); |
| - MultipartImageResourceParser::Client::trace(visitor); |
| } |
| void Resource::load(ResourceFetcher* fetcher, const ResourceLoaderOptions& options) |
| @@ -249,15 +247,6 @@ void Resource::checkNotify() |
| void Resource::appendData(const char* data, size_t length) |
| { |
| TRACE_EVENT0("blink", "Resource::appendData"); |
| - if (isMultipartImage()) { |
| - m_multipartParser->addData(data, length); |
| - return; |
| - } |
| - appendDataInternal(data, length); |
| -} |
| - |
| -void Resource::appendDataInternal(const char* data, size_t length) |
| -{ |
| ASSERT(m_revalidatingRequest.isNull()); |
| ASSERT(!errorOccurred()); |
| if (m_options.dataBufferingPolicy == DoNotBufferData) |
| @@ -298,9 +287,6 @@ void Resource::markClientsFinished() |
| void Resource::error(Resource::Status status) |
| { |
| - if (m_multipartParser) |
| - m_multipartParser->cancel(); |
| - |
| if (!m_revalidatingRequest.isNull()) |
| m_revalidatingRequest = ResourceRequest(); |
| @@ -316,20 +302,11 @@ void Resource::error(Resource::Status status) |
| markClientsFinished(); |
| } |
| -void Resource::finishOnePart() |
| -{ |
| - setLoading(false); |
| - checkNotify(); |
| -} |
| - |
| void Resource::finish() |
| { |
| ASSERT(m_revalidatingRequest.isNull()); |
| - ASSERT(!errorOccurred()); |
|
hiroshige
2016/02/26 19:03:35
What is the reason for removing ASSERT(!errorOccur
yhirano
2016/02/27 02:03:20
It's possible that m_status is modified in ImageRe
|
| - if (m_multipartParser) |
| - m_multipartParser->finish(); |
| - |
| - finishOnePart(); |
| + setLoading(false); |
| + checkNotify(); |
| markClientsFinished(); |
| if (!errorOccurred()) |
| m_status = Cached; |
| @@ -473,10 +450,6 @@ void Resource::responseReceived(const ResourceResponse& response, PassOwnPtr<Web |
| } |
| revalidationFailed(); |
| } |
| - // If there's no boundary, just handle the request normally. In the gecko |
| - // code, nsMultiMixedConv::OnStartRequest throws an exception. |
| - if (response.isMultipart() && !response.multipartBoundary().isEmpty() && (m_type == Resource::Image || m_type == Resource::MainResource) && !m_multipartParser) |
| - m_multipartParser = new MultipartImageResourceParser(response, response.multipartBoundary(), this); |
| setResponse(response); |
| String encoding = response.textEncodingName(); |
| if (!encoding.isNull()) |
| @@ -536,30 +509,6 @@ WeakPtrWillBeRawPtr<Resource> Resource::asWeakPtr() |
| #endif |
| } |
| -bool Resource::isMultipartImage() const |
| -{ |
| - return m_multipartParser; |
| -} |
| - |
| -void Resource::didReceiveResponse(const ResourceResponse& response) |
| -{ |
| - ASSERT(isMultipartImage()); |
| - responseReceived(response, nullptr); |
| - if (response.isMultipartPayload()) { |
| - // Since a subresource loader does not load multipart sections progressively, data was delivered to the loader all at once. |
| - // After the first multipart section is complete, signal to delegates that this load is "finished" |
| - m_loader->fetcher()->subresourceLoaderFinishedLoadingOnePart(m_loader); |
| - if (m_loader) |
| - m_loader->didFinishLoadingOnePart(0, WebURLLoaderClient::kUnknownEncodedDataLength); |
| - } |
| -} |
| - |
| -void Resource::didReceiveData(const char* bytes, size_t size) |
| -{ |
| - ASSERT(isMultipartImage()); |
| - appendDataInternal(bytes, size); |
| -} |
| - |
| String Resource::reasonNotDeletable() const |
| { |
| StringBuilder builder; |
| @@ -713,8 +662,6 @@ void Resource::allClientsRemoved() |
| else if (!m_cancelTimer.isActive()) |
| m_cancelTimer.startOneShot(0, BLINK_FROM_HERE); |
| - if (m_multipartParser) |
| - m_multipartParser->cancel(); |
| unlock(); |
| } |