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

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

Issue 450183002: Add instance counters of Resource and AudioNode, and expose them via WebLeakDetector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | Source/core/fetch/Resource.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 #if ENABLE(OILPAN) 86 #if ENABLE(OILPAN)
87 virtual ~Resource(); 87 virtual ~Resource();
88 #else 88 #else
89 protected: 89 protected:
90 // Only deleteIfPossible should delete this. 90 // Only deleteIfPossible should delete this.
91 virtual ~Resource(); 91 virtual ~Resource();
92 public: 92 public:
93 #endif 93 #endif
94 virtual void dispose(); 94 virtual void dispose();
95 virtual void trace(Visitor*); 95 virtual void trace(Visitor*);
96 static unsigned instanceCount() { return s_instanceCount; }
96 97
97 virtual void load(ResourceFetcher*, const ResourceLoaderOptions&); 98 virtual void load(ResourceFetcher*, const ResourceLoaderOptions&);
98 99
99 virtual void setEncoding(const String&) { } 100 virtual void setEncoding(const String&) { }
100 virtual String encoding() const { return String(); } 101 virtual String encoding() const { return String(); }
101 virtual void appendData(const char*, int); 102 virtual void appendData(const char*, int);
102 virtual void error(Resource::Status); 103 virtual void error(Resource::Status);
103 104
104 void setNeedsSynchronousCacheHit(bool needsSynchronousCacheHit) { m_needsSyn chronousCacheHit = needsSynchronousCacheHit; } 105 void setNeedsSynchronousCacheHit(bool needsSynchronousCacheHit) { m_needsSyn chronousCacheHit = needsSynchronousCacheHit; }
105 106
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 RawPtrWillBeMember<Resource> m_resourceToRevalidate; 395 RawPtrWillBeMember<Resource> m_resourceToRevalidate;
395 396
396 // If this field is non-null, the resource has a proxy for checking whether it is still up to date (see m_resourceToRevalidate). 397 // If this field is non-null, the resource has a proxy for checking whether it is still up to date (see m_resourceToRevalidate).
397 RawPtrWillBeMember<Resource> m_proxyResource; 398 RawPtrWillBeMember<Resource> m_proxyResource;
398 399
399 // These handles will need to be updated to point to the m_resourceToRevalid ate in case we get 304 response. 400 // These handles will need to be updated to point to the m_resourceToRevalid ate in case we get 304 response.
400 HashSet<ResourcePtrBase*> m_handlesToRevalidate; 401 HashSet<ResourcePtrBase*> m_handlesToRevalidate;
401 402
402 // Ordered list of all redirects followed while fetching this resource. 403 // Ordered list of all redirects followed while fetching this resource.
403 Vector<RedirectPair> m_redirectChain; 404 Vector<RedirectPair> m_redirectChain;
405
406 static unsigned s_instanceCount;
404 }; 407 };
405 408
406 #if !LOG_DISABLED 409 #if !LOG_DISABLED
407 // Intended to be used in LOG statements. 410 // Intended to be used in LOG statements.
408 const char* ResourceTypeName(Resource::Type); 411 const char* ResourceTypeName(Resource::Type);
409 #endif 412 #endif
410 413
411 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 414 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
412 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->type() = = Resource::typeName, resource.type() == Resource::typeName); \ 415 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->type() = = Resource::typeName, resource.type() == Resource::typeName); \
413 inline typeName##Resource* to##typeName##Resource(const ResourcePtr<Resource >& ptr) { return to##typeName##Resource(ptr.get()); } 416 inline typeName##Resource* to##typeName##Resource(const ResourcePtr<Resource >& ptr) { return to##typeName##Resource(ptr.get()); }
414 417
415 } 418 }
416 419
417 #endif 420 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/fetch/Resource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698