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

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

Issue 1839473002: Centralize the setting of Accept headers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again Created 4 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
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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 virtual void reportResourceTimingToClients(const ResourceTimingInfo&) { } 191 virtual void reportResourceTimingToClients(const ResourceTimingInfo&) { }
192 192
193 // Sets the serialized metadata retrieved from the platform's cache. 193 // Sets the serialized metadata retrieved from the platform's cache.
194 virtual void setSerializedCachedMetadata(const char*, size_t); 194 virtual void setSerializedCachedMetadata(const char*, size_t);
195 195
196 // This may return nullptr when the resource isn't cacheable. 196 // This may return nullptr when the resource isn't cacheable.
197 CachedMetadataHandler* cacheHandler(); 197 CachedMetadataHandler* cacheHandler();
198 198
199 String reasonNotDeletable() const; 199 String reasonNotDeletable() const;
200 200
201 // List of acceptable MIME types separated by ",".
202 // A MIME type may contain a wildcard, e.g. "text/*".
203 AtomicString accept() const { return m_accept; }
204 void setAccept(const AtomicString& accept) { m_accept = accept; }
205
206 AtomicString httpContentType() const; 201 AtomicString httpContentType() const;
207 202
208 bool wasCanceled() const { return m_error.isCancellation(); } 203 bool wasCanceled() const { return m_error.isCancellation(); }
209 bool errorOccurred() const { return m_status == LoadError || m_status == Dec odeError; } 204 bool errorOccurred() const { return m_status == LoadError || m_status == Dec odeError; }
210 bool loadFailedOrCanceled() { return !m_error.isNull(); } 205 bool loadFailedOrCanceled() { return !m_error.isNull(); }
211 206
212 DataBufferingPolicy getDataBufferingPolicy() const { return m_options.dataBu fferingPolicy; } 207 DataBufferingPolicy getDataBufferingPolicy() const { return m_options.dataBu fferingPolicy; }
213 void setDataBufferingPolicy(DataBufferingPolicy); 208 void setDataBufferingPolicy(DataBufferingPolicy);
214 209
215 bool isUnusedPreload() const { return isPreloaded() && getPreloadResult() == PreloadNotReferenced; } 210 bool isUnusedPreload() const { return isPreloaded() && getPreloadResult() == PreloadNotReferenced; }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 virtual bool isSafeToUnlock() const { return false; } 291 virtual bool isSafeToUnlock() const { return false; }
297 virtual void destroyDecodedDataIfPossible() { } 292 virtual void destroyDecodedDataIfPossible() { }
298 293
299 void markClientsFinished(); 294 void markClientsFinished();
300 295
301 // Returns the memory dump name used for tracing. See Resource::onMemoryDump . 296 // Returns the memory dump name used for tracing. See Resource::onMemoryDump .
302 String getMemoryDumpName() const; 297 String getMemoryDumpName() const;
303 298
304 ResourceRequest m_resourceRequest; 299 ResourceRequest m_resourceRequest;
305 ResourceRequest m_revalidatingRequest; 300 ResourceRequest m_revalidatingRequest;
306 AtomicString m_accept;
307 Member<ResourceLoader> m_loader; 301 Member<ResourceLoader> m_loader;
308 ResourceLoaderOptions m_options; 302 ResourceLoaderOptions m_options;
309 303
310 ResourceResponse m_response; 304 ResourceResponse m_response;
311 double m_responseTimestamp; 305 double m_responseTimestamp;
312 306
313 RefPtr<SharedBuffer> m_data; 307 RefPtr<SharedBuffer> m_data;
314 Timer<Resource> m_cancelTimer; 308 Timer<Resource> m_cancelTimer;
315 309
316 private: 310 private:
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 372
379 Resource::Type m_type; 373 Resource::Type m_type;
380 }; 374 };
381 375
382 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 376 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
383 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType( ) == Resource::typeName, resource.getType() == Resource::typeName); 377 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType( ) == Resource::typeName, resource.getType() == Resource::typeName);
384 378
385 } // namespace blink 379 } // namespace blink
386 380
387 #endif 381 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.cpp ('k') | third_party/WebKit/Source/core/fetch/Resource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698