* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef SourceProviderCache_h
+#define SourceProviderCache_h
+
+#include "SourceProviderCacheItem.h"
#include <wtf/HashMap.h>
+#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
+#include <wtf/RefCounted.h>
namespace JSC {
-class SourceProviderCacheItem;
-
-class SourceProviderCache {
+class SourceProviderCache : public RefCounted<SourceProviderCache> {
+ WTF_MAKE_FAST_ALLOCATED;
public:
- SourceProviderCache() : m_contentByteSize(0) {}
- ~SourceProviderCache();
+ SourceProviderCache() { }
+ JS_EXPORT_PRIVATE ~SourceProviderCache();
- void clear();
- unsigned byteSize() const;
- void add(int sourcePosition, PassOwnPtr<SourceProviderCacheItem>, unsigned size);
+ JS_EXPORT_PRIVATE void clear();
+ void add(int sourcePosition, PassOwnPtr<SourceProviderCacheItem>);
const SourceProviderCacheItem* get(int sourcePosition) const { return m_map.get(sourcePosition); }
private:
- HashMap<int, SourceProviderCacheItem*> m_map;
- unsigned m_contentByteSize;
+ HashMap<int, OwnPtr<SourceProviderCacheItem> > m_map;
};
}
+
+#endif // SourceProviderCache_h