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

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 2ee9c2e1d4dccc96cffa1c882c164075ddcd2bee..5ee37c948f08ad9e2589748e0ce3039b9653e985 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.cpp
+++ b/third_party/WebKit/Source/core/fetch/Resource.cpp
@@ -205,8 +205,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)
@@ -250,15 +248,6 @@ void Resource::checkNotify()
void Resource::appendData(const char* data, size_t length)
{
TRACE_EVENT0("blink", "Resource::appendData");
- if (isMultipartImage()) {
- m_multipartParser->appendData(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)
@@ -299,9 +288,6 @@ void Resource::markClientsFinished()
void Resource::error(Resource::Status status)
{
- if (m_multipartParser)
- m_multipartParser->cancel();
-
if (!m_revalidatingRequest.isNull())
m_revalidatingRequest = ResourceRequest();
@@ -317,20 +303,11 @@ void Resource::error(Resource::Status status)
markClientsFinished();
}
-void Resource::finishOnePart()
-{
- setLoading(false);
- checkNotify();
-}
-
void Resource::finish()
{
ASSERT(m_revalidatingRequest.isNull());
- ASSERT(!errorOccurred());
- if (m_multipartParser)
- m_multipartParser->finish();
-
- finishOnePart();
+ setLoading(false);
+ checkNotify();
markClientsFinished();
if (!errorOccurred())
m_status = Cached;
@@ -479,9 +456,6 @@ void Resource::responseReceived(const ResourceResponse& response, PassOwnPtr<Web
}
revalidationFailed();
}
- // If there's no boundary, just handle the request normally.
- 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())
@@ -541,25 +515,6 @@ WeakPtrWillBeRawPtr<Resource> Resource::asWeakPtr()
#endif
}
-bool Resource::isMultipartImage() const
-{
- return m_multipartParser;
-}
-
-void Resource::onePartInMultipartReceived(const ResourceResponse& response)
-{
- ASSERT(isMultipartImage());
- responseReceived(response, nullptr);
- if (response.isMultipartPayload() && m_loader)
- m_loader->didFinishLoadingOnePart(0, WebURLLoaderClient::kUnknownEncodedDataLength);
-}
-
-void Resource::multipartDataReceived(const char* bytes, size_t size)
-{
- ASSERT(isMultipartImage());
- appendDataInternal(bytes, size);
-}
-
String Resource::reasonNotDeletable() const
{
StringBuilder builder;
@@ -713,8 +668,6 @@ void Resource::allClientsRemoved()
else if (!m_cancelTimer.isActive())
m_cancelTimer.startOneShot(0, BLINK_FROM_HERE);
- if (m_multipartParser)
- m_multipartParser->cancel();
unlock();
}
« no previous file with comments | « third_party/WebKit/Source/core/fetch/Resource.h ('k') | third_party/WebKit/Source/core/fetch/ResourceLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698