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

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

Issue 2649853003: Make Resource::setResponse() private
Patch Set: Rebase Created 3 years, 10 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 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 rights reserved. 6 rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 223
224 virtual bool willFollowRedirect(const ResourceRequest&, 224 virtual bool willFollowRedirect(const ResourceRequest&,
225 const ResourceResponse&); 225 const ResourceResponse&);
226 226
227 // Called when a redirect response was received but a decision has already 227 // Called when a redirect response was received but a decision has already
228 // been made to not follow it. 228 // been made to not follow it.
229 virtual void willNotFollowRedirect() {} 229 virtual void willNotFollowRedirect() {}
230 230
231 virtual void responseReceived(const ResourceResponse&, 231 virtual void responseReceived(const ResourceResponse&,
232 std::unique_ptr<WebDataConsumerHandle>); 232 std::unique_ptr<WebDataConsumerHandle>);
233 void setResponse(const ResourceResponse&);
234 const ResourceResponse& response() const { return m_response; } 233 const ResourceResponse& response() const { return m_response; }
235 234
236 virtual void reportResourceTimingToClients(const ResourceTimingInfo&) {} 235 virtual void reportResourceTimingToClients(const ResourceTimingInfo&) {}
237 236
238 // Sets the serialized metadata retrieved from the platform's cache. 237 // Sets the serialized metadata retrieved from the platform's cache.
239 virtual void setSerializedCachedMetadata(const char*, size_t); 238 virtual void setSerializedCachedMetadata(const char*, size_t);
240 239
241 // This may return nullptr when the resource isn't cacheable. 240 // This may return nullptr when the resource isn't cacheable.
242 CachedMetadataHandler* cacheHandler(); 241 CachedMetadataHandler* cacheHandler();
243 242
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 344
346 static const char* resourceTypeToString( 345 static const char* resourceTypeToString(
347 Type, 346 Type,
348 const AtomicString& fetchInitiatorName); 347 const AtomicString& fetchInitiatorName);
349 348
350 protected: 349 protected:
351 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&); 350 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&);
352 351
353 virtual void checkNotify(); 352 virtual void checkNotify();
354 353
354 void setResponse(const ResourceResponse&);
355
355 void markClientFinished(ResourceClient*); 356 void markClientFinished(ResourceClient*);
356 357
357 virtual bool hasClientsOrObservers() const { 358 virtual bool hasClientsOrObservers() const {
358 return !m_clients.isEmpty() || !m_clientsAwaitingCallback.isEmpty() || 359 return !m_clients.isEmpty() || !m_clientsAwaitingCallback.isEmpty() ||
359 !m_finishedClients.isEmpty(); 360 !m_finishedClients.isEmpty();
360 } 361 }
361 virtual void destroyDecodedDataForFailedRevalidation() {} 362 virtual void destroyDecodedDataForFailedRevalidation() {}
362 363
363 void setEncodedSize(size_t); 364 void setEncodedSize(size_t);
364 void setDecodedSize(size_t); 365 void setDecodedSize(size_t);
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 }; 511 };
511 512
512 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 513 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
513 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ 514 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \
514 resource->getType() == Resource::typeName, \ 515 resource->getType() == Resource::typeName, \
515 resource.getType() == Resource::typeName); 516 resource.getType() == Resource::typeName);
516 517
517 } // namespace blink 518 } // namespace blink
518 519
519 #endif 520 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/RawResourceTest.cpp ('k') | third_party/WebKit/Source/core/fetch/ResourceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698