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

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

Issue 14672042: Prepare to add more initiator info to CachedResource(Request) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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.
11 11
12 This library is distributed in the hope that it will be useful, 12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details. 15 Library General Public License for more details.
16 16
17 You should have received a copy of the GNU Library General Public License 17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to 18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA. 20 Boston, MA 02110-1301, USA.
21 */ 21 */
22 22
23 #ifndef CachedResource_h 23 #ifndef CachedResource_h
24 #define CachedResource_h 24 #define CachedResource_h
25 25
26 #include <time.h> 26 #include <time.h>
27 #include "core/loader/FrameLoaderTypes.h" 27 #include "core/loader/FrameLoaderTypes.h"
28 #include "core/loader/ResourceLoaderOptions.h" 28 #include "core/loader/ResourceLoaderOptions.h"
29 #include "core/loader/cache/CachePolicy.h" 29 #include "core/loader/cache/CachePolicy.h"
30 #include "core/loader/cache/CachedResourceInitiatorInfo.h"
30 #include "core/platform/PurgePriority.h" 31 #include "core/platform/PurgePriority.h"
31 #include "core/platform/Timer.h" 32 #include "core/platform/Timer.h"
32 #include "core/platform/network/ResourceError.h" 33 #include "core/platform/network/ResourceError.h"
33 #include "core/platform/network/ResourceLoadPriority.h" 34 #include "core/platform/network/ResourceLoadPriority.h"
34 #include "core/platform/network/ResourceRequest.h" 35 #include "core/platform/network/ResourceRequest.h"
35 #include "core/platform/network/ResourceResponse.h" 36 #include "core/platform/network/ResourceResponse.h"
36 #include <wtf/HashCountedSet.h> 37 #include <wtf/HashCountedSet.h>
37 #include <wtf/HashSet.h> 38 #include <wtf/HashSet.h>
38 #include <wtf/OwnPtr.h> 39 #include <wtf/OwnPtr.h>
39 #include <wtf/text/WTFString.h> 40 #include <wtf/text/WTFString.h>
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 virtual void didSendData(unsigned long long /* bytesSent */, unsigned long l ong /* totalBytesToBeSent */) { } 244 virtual void didSendData(unsigned long long /* bytesSent */, unsigned long l ong /* totalBytesToBeSent */) { }
244 virtual void didDownloadData(int) { } 245 virtual void didDownloadData(int) { }
245 246
246 void setLoadFinishTime(double finishTime) { m_loadFinishTime = finishTime; } 247 void setLoadFinishTime(double finishTime) { m_loadFinishTime = finishTime; }
247 double loadFinishTime() const { return m_loadFinishTime; } 248 double loadFinishTime() const { return m_loadFinishTime; }
248 249
249 virtual void reportMemoryUsage(MemoryObjectInfo*) const; 250 virtual void reportMemoryUsage(MemoryObjectInfo*) const;
250 251
251 virtual bool canReuse(const ResourceRequest&) const { return true; } 252 virtual bool canReuse(const ResourceRequest&) const { return true; }
252 253
254 const CachedResourceInitiatorInfo& initiatorInfo() const { return m_initiato rInfo; }
255 void setInitiatorInfo(const CachedResourceInitiatorInfo& initiatorInfo) { m_ initiatorInfo = initiatorInfo; }
Nate Chapin 2013/05/15 22:14:58 What is the rationale for moving this here from Ca
abarth-chromium 2013/05/15 22:21:25 Previously CachedResourceLoader kept a HashMap key
256
253 protected: 257 protected:
254 virtual void checkNotify(); 258 virtual void checkNotify();
255 virtual void finishOnePart(); 259 virtual void finishOnePart();
256 260
257 void setEncodedSize(unsigned); 261 void setEncodedSize(unsigned);
258 void setDecodedSize(unsigned); 262 void setDecodedSize(unsigned);
259 void didAccessDecodedData(double timeStamp); 263 void didAccessDecodedData(double timeStamp);
260 264
261 bool isSafeToMakePurgeable() const; 265 bool isSafeToMakePurgeable() const;
262 266
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 // using HTTP If-Modified-Since/If-None-Match headers. If the response is 30 4 all clients of this resource are moved 351 // using HTTP If-Modified-Since/If-None-Match headers. If the response is 30 4 all clients of this resource are moved
348 // to to be clients of m_resourceToRevalidate and the resource is deleted. I f not, the field is zeroed and this 352 // to to be clients of m_resourceToRevalidate and the resource is deleted. I f not, the field is zeroed and this
349 // resources becomes normal resource load. 353 // resources becomes normal resource load.
350 CachedResource* m_resourceToRevalidate; 354 CachedResource* m_resourceToRevalidate;
351 355
352 // If this field is non-null, the resource has a proxy for checking whether it is still up to date (see m_resourceToRevalidate). 356 // If this field is non-null, the resource has a proxy for checking whether it is still up to date (see m_resourceToRevalidate).
353 CachedResource* m_proxyResource; 357 CachedResource* m_proxyResource;
354 358
355 // These handles will need to be updated to point to the m_resourceToRevalid ate in case we get 304 response. 359 // These handles will need to be updated to point to the m_resourceToRevalid ate in case we get 304 response.
356 HashSet<CachedResourceHandleBase*> m_handlesToRevalidate; 360 HashSet<CachedResourceHandleBase*> m_handlesToRevalidate;
361
362 CachedResourceInitiatorInfo m_initiatorInfo;
357 }; 363 };
358 364
359 } 365 }
360 366
361 #endif 367 #endif
OLDNEW
« no previous file with comments | « Source/core/loader/TextTrackLoader.cpp ('k') | Source/core/loader/cache/CachedResourceInitiatorInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698