summaryrefslogtreecommitdiffstats
path: root/Source/JavaScriptCore/parser/SourceProvider.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/parser/SourceProvider.h')
-rw-r--r--Source/JavaScriptCore/parser/SourceProvider.h19
1 files changed, 1 insertions, 18 deletions
diff --git a/Source/JavaScriptCore/parser/SourceProvider.h b/Source/JavaScriptCore/parser/SourceProvider.h
index bcc445b..e9b6b56 100644
--- a/Source/JavaScriptCore/parser/SourceProvider.h
+++ b/Source/JavaScriptCore/parser/SourceProvider.h
@@ -29,32 +29,15 @@
#ifndef SourceProvider_h
#define SourceProvider_h
+#include "SourceProviderCache.h"
#include "UString.h"
-#include <wtf/HashMap.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/UnusedParam.h>
#include <wtf/text/TextPosition.h>
-
namespace JSC {
- class SourceProviderCache {
- public:
- struct Item {};
-
- SourceProviderCache() : m_contentByteSize(0) {}
- ~SourceProviderCache() { deleteAllValues(m_map); }
-
- unsigned byteSize() const { return m_contentByteSize + sizeof(*this) + m_map.capacity() * sizeof(Item*); }
- void add(int sourcePosition, PassOwnPtr<Item> item, unsigned size) { m_map.add(sourcePosition, item.leakPtr()); m_contentByteSize += size; }
- const Item* get(int sourcePosition) const { return m_map.get(sourcePosition); }
-
- private:
- HashMap<int, Item*> m_map;
- unsigned m_contentByteSize;
- };
-
class SourceProvider : public RefCounted<SourceProvider> {
public:
SourceProvider(const UString& url, SourceProviderCache* cache = 0)