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

Side by Side Diff: third_party/WebKit/Source/core/fetch/Resource.h

Issue 1710733002: Move multipart resource handling to core/fetch (2/2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@multipart-cleanup
Patch Set: Created 4 years, 9 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
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 163
164 ResourceLoader* loader() const { return m_loader.get(); } 164 ResourceLoader* loader() const { return m_loader.get(); }
165 165
166 virtual bool isImage() const { return false; } 166 virtual bool isImage() const { return false; }
167 bool shouldBlockLoadEvent() const; 167 bool shouldBlockLoadEvent() const;
168 bool isLoadEventBlockingResourceType() const; 168 bool isLoadEventBlockingResourceType() const;
169 169
170 // Computes the status of an object after loading. 170 // Computes the status of an object after loading.
171 // Updates the expire date on the cache entry file 171 // Updates the expire date on the cache entry file
172 void setLoadFinishTime(double finishTime) { m_loadFinishTime = finishTime; } 172 void setLoadFinishTime(double finishTime) { m_loadFinishTime = finishTime; }
173 void finish(); 173 virtual void finish();
174 174
175 // FIXME: Remove the stringless variant once all the callsites' error messag es are updated. 175 // FIXME: Remove the stringless variant once all the callsites' error messag es are updated.
176 bool passesAccessControlCheck(SecurityOrigin*) const; 176 bool passesAccessControlCheck(SecurityOrigin*) const;
177 bool passesAccessControlCheck(SecurityOrigin*, String& errorDescription) con st; 177 bool passesAccessControlCheck(SecurityOrigin*, String& errorDescription) con st;
178 178
179 bool isEligibleForIntegrityCheck(SecurityOrigin*) const; 179 bool isEligibleForIntegrityCheck(SecurityOrigin*) const;
180 180
181 void clearLoader(); 181 void clearLoader();
182 182
183 SharedBuffer* resourceBuffer() const { return m_data.get(); } 183 SharedBuffer* resourceBuffer() const { return m_data.get(); }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&); 251 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&);
252 static const char* resourceTypeName(Type); 252 static const char* resourceTypeName(Type);
253 253
254 // TODO(japhet): Remove once oilpan ships, it doesn't need the WeakPtr. 254 // TODO(japhet): Remove once oilpan ships, it doesn't need the WeakPtr.
255 WeakPtrWillBeRawPtr<Resource> asWeakPtr(); 255 WeakPtrWillBeRawPtr<Resource> asWeakPtr();
256 256
257 protected: 257 protected:
258 Resource(const ResourceRequest&, Type); 258 Resource(const ResourceRequest&, Type);
259 259
260 virtual void checkNotify(); 260 virtual void checkNotify();
261 virtual void finishOnePart();
262 261
263 virtual void destroyDecodedDataForFailedRevalidation() { } 262 virtual void destroyDecodedDataForFailedRevalidation() { }
264 263
265 void setEncodedSize(size_t); 264 void setEncodedSize(size_t);
266 void setDecodedSize(size_t); 265 void setDecodedSize(size_t);
267 void didAccessDecodedData(); 266 void didAccessDecodedData();
268 267
269 void finishPendingClients(); 268 void finishPendingClients();
270 269
271 HashCountedSet<ResourceClient*> m_clients; 270 HashCountedSet<ResourceClient*> m_clients;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 Resource::Type m_type; 382 Resource::Type m_type;
384 }; 383 };
385 384
386 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 385 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
387 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType( ) == Resource::typeName, resource.getType() == Resource::typeName); \ 386 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType( ) == Resource::typeName, resource.getType() == Resource::typeName); \
388 inline typeName##Resource* to##typeName##Resource(const RefPtrWillBeRawPtr<R esource>& ptr) { return to##typeName##Resource(ptr.get()); } 387 inline typeName##Resource* to##typeName##Resource(const RefPtrWillBeRawPtr<R esource>& ptr) { return to##typeName##Resource(ptr.get()); }
389 388
390 } // namespace blink 389 } // namespace blink
391 390
392 #endif 391 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698