Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Unified Diff: third_party/WebKit/Source/core/fetch/Resource.cpp

Issue 1738553002: [ABANDONED] Move multipart/x-mixed-replace related code to ImageResource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@multipart-cleanup-2
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();
}

Powered by Google App Engine
This is Rietveld 408576698