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

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

Issue 13973026: remove memoryinstrumentation Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove the rest part of MemoryInstrumentation Created 7 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 23 matching lines...) Expand all
34 public: 34 public:
35 ~CachedResourceHandleBase() { if (m_resource) m_resource->unregisterHand le(this); } 35 ~CachedResourceHandleBase() { if (m_resource) m_resource->unregisterHand le(this); }
36 CachedResource* get() const { return m_resource; } 36 CachedResource* get() const { return m_resource; }
37 37
38 bool operator!() const { return !m_resource; } 38 bool operator!() const { return !m_resource; }
39 39
40 // This conversion operator allows implicit conversion to bool but not t o other integer types. 40 // This conversion operator allows implicit conversion to bool but not t o other integer types.
41 typedef CachedResource* CachedResourceHandleBase::*UnspecifiedBoolType; 41 typedef CachedResource* CachedResourceHandleBase::*UnspecifiedBoolType;
42 operator UnspecifiedBoolType() const { return m_resource ? &CachedResour ceHandleBase::m_resource : 0; } 42 operator UnspecifiedBoolType() const { return m_resource ? &CachedResour ceHandleBase::m_resource : 0; }
43 43
44 void reportMemoryUsage(MemoryObjectInfo*) const;
45
46 protected: 44 protected:
47 CachedResourceHandleBase() : m_resource(0) {} 45 CachedResourceHandleBase() : m_resource(0) {}
48 CachedResourceHandleBase(CachedResource* res) { m_resource = res; if (m_ resource) m_resource->registerHandle(this); } 46 CachedResourceHandleBase(CachedResource* res) { m_resource = res; if (m_ resource) m_resource->registerHandle(this); }
49 CachedResourceHandleBase(const CachedResourceHandleBase& o) : m_resource (o.m_resource) { if (m_resource) m_resource->registerHandle(this); } 47 CachedResourceHandleBase(const CachedResourceHandleBase& o) : m_resource (o.m_resource) { if (m_resource) m_resource->registerHandle(this); }
50 48
51 void setResource(CachedResource*); 49 void setResource(CachedResource*);
52 50
53 private: 51 private:
54 CachedResourceHandleBase& operator=(const CachedResourceHandleBase&) { r eturn *this; } 52 CachedResourceHandleBase& operator=(const CachedResourceHandleBase&) { r eturn *this; }
55 53
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 { 86 {
89 return h.get() != res; 87 return h.get() != res;
90 } 88 }
91 template <class R, class RR> bool operator!=(const RR* res, const CachedReso urceHandle<R>& h) 89 template <class R, class RR> bool operator!=(const RR* res, const CachedReso urceHandle<R>& h)
92 { 90 {
93 return h.get() != res; 91 return h.get() != res;
94 } 92 }
95 } 93 }
96 94
97 #endif 95 #endif
OLDNEW
« no previous file with comments | « Source/core/loader/cache/CachedResource.cpp ('k') | Source/core/loader/cache/CachedResourceHandle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698