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

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 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 virtual void reportResourceTimingToClients(const ResourceTimingInfo&) { } 186 virtual void reportResourceTimingToClients(const ResourceTimingInfo&) { }
187 187
188 // Sets the serialized metadata retrieved from the platform's cache. 188 // Sets the serialized metadata retrieved from the platform's cache.
189 virtual void setSerializedCachedMetadata(const char*, size_t); 189 virtual void setSerializedCachedMetadata(const char*, size_t);
190 190
191 // This may return nullptr when the resource isn't cacheable. 191 // This may return nullptr when the resource isn't cacheable.
192 CachedMetadataHandler* cacheHandler(); 192 CachedMetadataHandler* cacheHandler();
193 193
194 String reasonNotDeletable() const; 194 String reasonNotDeletable() const;
195 195
196 // List of acceptable MIME types separated by ",".
197 // A MIME type may contain a wildcard, e.g. "text/*".
198 AtomicString accept() const { return m_accept; }
199 void setAccept(const AtomicString& accept) { m_accept = accept; }
200
201 AtomicString httpContentType() const; 196 AtomicString httpContentType() const;
202 197
203 bool wasCanceled() const { return m_error.isCancellation(); } 198 bool wasCanceled() const { return m_error.isCancellation(); }
204 bool errorOccurred() const { return m_status == LoadError || m_status == Dec odeError; } 199 bool errorOccurred() const { return m_status == LoadError || m_status == Dec odeError; }
205 bool loadFailedOrCanceled() { return !m_error.isNull(); } 200 bool loadFailedOrCanceled() { return !m_error.isNull(); }
206 201
207 DataBufferingPolicy getDataBufferingPolicy() const { return m_options.dataBu fferingPolicy; } 202 DataBufferingPolicy getDataBufferingPolicy() const { return m_options.dataBu fferingPolicy; }
208 void setDataBufferingPolicy(DataBufferingPolicy); 203 void setDataBufferingPolicy(DataBufferingPolicy);
209 204
210 bool isUnusedPreload() const { return isPreloaded() && getPreloadResult() == PreloadNotReferenced; } 205 bool isUnusedPreload() const { return isPreloaded() && getPreloadResult() == PreloadNotReferenced; }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 virtual bool isSafeToUnlock() const { return false; } 300 virtual bool isSafeToUnlock() const { return false; }
306 virtual void destroyDecodedDataIfPossible() { } 301 virtual void destroyDecodedDataIfPossible() { }
307 302
308 void markClientsFinished(); 303 void markClientsFinished();
309 304
310 // Returns the memory dump name used for tracing. See Resource::onMemoryDump . 305 // Returns the memory dump name used for tracing. See Resource::onMemoryDump .
311 String getMemoryDumpName() const; 306 String getMemoryDumpName() const;
312 307
313 ResourceRequest m_resourceRequest; 308 ResourceRequest m_resourceRequest;
314 ResourceRequest m_revalidatingRequest; 309 ResourceRequest m_revalidatingRequest;
315 AtomicString m_accept;
316 Member<ResourceLoader> m_loader; 310 Member<ResourceLoader> m_loader;
317 ResourceLoaderOptions m_options; 311 ResourceLoaderOptions m_options;
318 312
319 ResourceResponse m_response; 313 ResourceResponse m_response;
320 double m_responseTimestamp; 314 double m_responseTimestamp;
321 315
322 RefPtr<SharedBuffer> m_data; 316 RefPtr<SharedBuffer> m_data;
323 Timer<Resource> m_cancelTimer; 317 Timer<Resource> m_cancelTimer;
324 318
325 private: 319 private:
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 Resource::Type m_type; 382 Resource::Type m_type;
389 }; 383 };
390 384
391 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 385 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
392 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); \
393 inline typeName##Resource* to##typeName##Resource(const RawPtr<Resource>& pt r) { return to##typeName##Resource(ptr.get()); } 387 inline typeName##Resource* to##typeName##Resource(const RawPtr<Resource>& pt r) { return to##typeName##Resource(ptr.get()); }
394 388
395 } // namespace blink 389 } // namespace blink
396 390
397 #endif 391 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698