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

Side by Side Diff: Source/WebCore/loader/cache/CachedResource.h

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller <mueller@kde.org> 3 Copyright (C) 2001 Dirk Mueller <mueller@kde.org>
4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 DecodeError 87 DecodeError
88 }; 88 };
89 89
90 CachedResource(const ResourceRequest&, Type); 90 CachedResource(const ResourceRequest&, Type);
91 virtual ~CachedResource(); 91 virtual ~CachedResource();
92 92
93 virtual void load(CachedResourceLoader*, const ResourceLoaderOptions&); 93 virtual void load(CachedResourceLoader*, const ResourceLoaderOptions&);
94 94
95 virtual void setEncoding(const String&) { } 95 virtual void setEncoding(const String&) { }
96 virtual String encoding() const { return String(); } 96 virtual String encoding() const { return String(); }
97 virtual void data(PassRefPtr<ResourceBuffer> data, bool allDataReceived); 97 virtual void data(PassRefPtr<ResourceBuffer> data);
98 virtual void error(CachedResource::Status); 98 virtual void error(CachedResource::Status);
99 99
100 void setResourceError(const ResourceError& error) { m_error = error; } 100 void setResourceError(const ResourceError& error) { m_error = error; }
101 const ResourceError& resourceError() const { return m_error; } 101 const ResourceError& resourceError() const { return m_error; }
102 102
103 virtual bool shouldIgnoreHTTPStatusCodeErrors() const { return false; } 103 virtual bool shouldIgnoreHTTPStatusCodeErrors() const { return false; }
104 104
105 ResourceRequest& resourceRequest() { return m_resourceRequest; } 105 ResourceRequest& resourceRequest() { return m_resourceRequest; }
106 const KURL& url() const { return m_resourceRequest.url();} 106 const KURL& url() const { return m_resourceRequest.url();}
107 Type type() const { return static_cast<Type>(m_type); } 107 Type type() const { return static_cast<Type>(m_type); }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 || type() == LinkPrefetch 152 || type() == LinkPrefetch
153 || type() == LinkSubresource 153 || type() == LinkSubresource
154 || type() == RawResource; 154 || type() == RawResource;
155 } 155 }
156 156
157 unsigned accessCount() const { return m_accessCount; } 157 unsigned accessCount() const { return m_accessCount; }
158 void increaseAccessCount() { m_accessCount++; } 158 void increaseAccessCount() { m_accessCount++; }
159 159
160 // Computes the status of an object after loading. 160 // Computes the status of an object after loading.
161 // Updates the expire date on the cache entry file 161 // Updates the expire date on the cache entry file
162 virtual void finishOnePart();
162 void finish(); 163 void finish();
163 164
164 bool passesAccessControlCheck(SecurityOrigin*); 165 bool passesAccessControlCheck(SecurityOrigin*);
165 166
166 // Called by the cache if the object has been removed from the cache 167 // Called by the cache if the object has been removed from the cache
167 // while still being referenced. This means the object should delete itself 168 // while still being referenced. This means the object should delete itself
168 // if the number of clients observing it ever drops to 0. 169 // if the number of clients observing it ever drops to 0.
169 // The resource can be brought back to cache after successful revalidation. 170 // The resource can be brought back to cache after successful revalidation.
170 void setInCache(bool inCache) { m_inCache = inCache; } 171 void setInCache(bool inCache) { m_inCache = inCache; }
171 bool inCache() const { return m_inCache; } 172 bool inCache() const { return m_inCache; }
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 // If this field is non-null, the resource has a proxy for checking whether it is still up to date (see m_resourceToRevalidate). 352 // If this field is non-null, the resource has a proxy for checking whether it is still up to date (see m_resourceToRevalidate).
352 CachedResource* m_proxyResource; 353 CachedResource* m_proxyResource;
353 354
354 // These handles will need to be updated to point to the m_resourceToRevalid ate in case we get 304 response. 355 // These handles will need to be updated to point to the m_resourceToRevalid ate in case we get 304 response.
355 HashSet<CachedResourceHandleBase*> m_handlesToRevalidate; 356 HashSet<CachedResourceHandleBase*> m_handlesToRevalidate;
356 }; 357 };
357 358
358 } 359 }
359 360
360 #endif 361 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/loader/cache/CachedRawResource.cpp ('k') | Source/WebCore/loader/cache/CachedResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698