diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-09-13 12:51:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 20:50:05 +0200 |
commit | d441d6f39bb846989d95bcf5caf387b42414718d (patch) | |
tree | e367e64a75991c554930278175d403c072de6bb8 /Source/JavaScriptCore/parser/SourceProvider.h | |
parent | 0060b2994c07842f4c59de64b5e3e430525c4b90 (diff) | |
download | qtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz |
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit.
Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/JavaScriptCore/parser/SourceProvider.h')
-rw-r--r-- | Source/JavaScriptCore/parser/SourceProvider.h | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/Source/JavaScriptCore/parser/SourceProvider.h b/Source/JavaScriptCore/parser/SourceProvider.h index 145b2dd16..4ced9d9c7 100644 --- a/Source/JavaScriptCore/parser/SourceProvider.h +++ b/Source/JavaScriptCore/parser/SourceProvider.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008, 2009, 2012 Apple Inc. All rights reserved. + * Copyright (C) 2008, 2009, 2012, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,11 +29,10 @@ #ifndef SourceProvider_h #define SourceProvider_h -#include "SourceProviderCache.h" #include <wtf/PassOwnPtr.h> #include <wtf/RefCounted.h> -#include <wtf/UnusedParam.h> #include <wtf/text/TextPosition.h> +#include <wtf/text/WTFString.h> namespace JSC { @@ -41,20 +40,9 @@ namespace JSC { public: static const intptr_t nullID = 1; - SourceProvider(const String& url, const TextPosition& startPosition, SourceProviderCache* cache = 0) - : m_url(url) - , m_startPosition(startPosition) - , m_validated(false) - , m_cache(cache ? cache : new SourceProviderCache) - , m_cacheOwned(!cache) - { - } + JS_EXPORT_PRIVATE SourceProvider(const String& url, const TextPosition& startPosition); - virtual ~SourceProvider() - { - if (m_cacheOwned) - delete m_cache; - } + JS_EXPORT_PRIVATE virtual ~SourceProvider(); virtual const String& source() const = 0; String getRange(int start, int end) const @@ -69,23 +57,23 @@ namespace JSC { ASSERT(this); if (!this) // Be defensive in release mode. return nullID; - return reinterpret_cast<intptr_t>(this); + if (!m_id) + getID(); + return m_id; } bool isValid() const { return m_validated; } void setValid() { m_validated = true; } - SourceProviderCache* cache() const { return m_cache; } - void notifyCacheSizeChanged(int delta) { if (!m_cacheOwned) cacheSizeChanged(delta); } - private: - virtual void cacheSizeChanged(int delta) { UNUSED_PARAM(delta); } + + JS_EXPORT_PRIVATE void getID(); + Vector<size_t>& lineStarts(); String m_url; TextPosition m_startPosition; - bool m_validated; - SourceProviderCache* m_cache; - bool m_cacheOwned; + bool m_validated : 1; + uintptr_t m_id : sizeof(uintptr_t) * 8 - 1; }; class StringSourceProvider : public SourceProvider { |