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

Unified Diff: Source/WebCore/loader/cache/CachedResource.cpp

Issue 14210003: Simplify CachedResource::data (Closed) Base URL: svn://svn.chromium.org/blink/trunk/
Patch Set: Created 7 years, 8 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
« no previous file with comments | « Source/WebCore/loader/cache/CachedResource.h ('k') | Source/WebCore/loader/cache/CachedSVGDocument.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/loader/cache/CachedResource.cpp
===================================================================
--- Source/WebCore/loader/cache/CachedResource.cpp (revision 148397)
+++ Source/WebCore/loader/cache/CachedResource.cpp (working copy)
@@ -349,13 +349,10 @@
c->notifyFinished(this);
}
-void CachedResource::data(PassRefPtr<ResourceBuffer>, bool allDataReceived)
+void CachedResource::data(PassRefPtr<ResourceBuffer> data)
{
- if (!allDataReceived)
- return;
-
- setLoading(false);
- checkNotify();
+ m_data = data;
+ setEncodedSize(m_data ? m_data->size() : 0);
}
void CachedResource::error(CachedResource::Status status)
@@ -368,8 +365,15 @@
checkNotify();
}
+void CachedResource::finishOnePart()
+{
+ setLoading(false);
+ checkNotify();
+}
+
void CachedResource::finish()
{
+ finishOnePart();
if (!errorOccurred())
m_status = Cached;
}
@@ -466,7 +470,7 @@
CachedResourceHandle<CachedResource> protect(this);
- // All loads finish with data(allDataReceived = true) or error(), except for
+ // All loads finish with finish() or error(), except for
// canceled loads, which silently set our request to 0. Be sure to notify our
// client in that case, so we don't seem to continue loading forever.
if (isLoading()) {
« no previous file with comments | « Source/WebCore/loader/cache/CachedResource.h ('k') | Source/WebCore/loader/cache/CachedSVGDocument.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698