Commit 41ab4de1 authored by loislo@chromium.org's avatar loislo@chromium.org

Web Inspector: NMI: migrate core instrumentation code to WTF namespace

https://bugs.webkit.org/show_bug.cgi?id=96511

Reviewed by Yury Semikhatsky.

After moving core NMI code to WTF namespace I removed forward declarations
of MemoryObjectInfo and MemoryInstrumentation from WebCore headers and add
forward declaration into wtf/Forward.h

Source/WebCore:

* bindings/v8/DOMDataStore.h:
(WebCore):
* bindings/v8/ScriptProfiler.h:
(WebCore):
* bindings/v8/V8DOMMap.h:
(WebCore):
* bindings/v8/V8PerIsolateData.h:
(WebCore):
* bindings/v8/V8ValueCache.h:
(WebCore):
* css/CSSProperty.h:
* css/CSSRule.h:
(WebCore):
* css/CSSSelectorList.h:
(WebCore):
* css/CSSStyleDeclaration.h:
(WebCore):
* css/CSSStyleSheet.h:
(WebCore):
* css/CSSValue.h:
* css/MediaList.h:
(WebCore):
* css/MediaQuery.h:
* css/MediaQueryExp.h:
* css/StylePropertySet.h:
(WebCore):
* css/StyleResolver.h:
* css/StyleRule.h:
(WebCore):
* css/StyleRuleImport.h:
(WebCore):
* css/StyleSheetContents.h:
(WebCore):
* css/WebKitCSSKeyframeRule.h:
* css/WebKitCSSKeyframesRule.h:
(WebCore):
* css/WebKitCSSMixFunctionValue.h:
* dom/DocumentEventQueue.h:
(WebCore):
* dom/ElementAttributeData.h:
(WebCore):
* dom/Event.h:
(WebCore):
* dom/Node.h:
(WebCore):
* dom/WebCoreMemoryInstrumentation.cpp:
(WTF):
(WTF::WebCore::KURL):
* dom/WebCoreMemoryInstrumentation.h:
(WebCore):
(WTF):
* inspector/MemoryInstrumentationImpl.h:
* loader/DocumentLoader.h:
(WebCore):
* loader/FrameLoader.h:
(WebCore):
* loader/ResourceLoader.h:
(WebCore):
* loader/SubstituteData.h:
* loader/cache/CachedCSSStyleSheet.h:
(WebCore):
* loader/cache/CachedRawResource.h:
(WebCore):
* loader/cache/CachedResource.h:
(WebCore):
* loader/cache/CachedResourceHandle.h:
* loader/cache/CachedResourceLoader.h:
(WebCore):
* loader/cache/CachedScript.h:
(WebCore):
* loader/cache/CachedShader.h:
* loader/cache/CachedXSLStyleSheet.h:
(WebCore):
* loader/cache/MemoryCache.h:
(WebCore):
* page/Frame.h:
(WebCore):
* platform/SharedBuffer.h:
* platform/graphics/CrossfadeGeneratedImage.h:
(WebCore):
* platform/graphics/Image.h:
(WebCore):
* platform/network/FormData.h:
(WebCore):
* platform/network/ResourceRequestBase.h:
* platform/network/ResourceResponseBase.h:
* rendering/style/RenderStyle.h:
(WebCore):
* rendering/style/StyleRareInheritedData.h:
(WebCore):
* rendering/style/StyleRareNonInheritedData.h:
(WebCore):

Source/WTF:

* wtf/Forward.h:
(WTF):
* wtf/MemoryInstrumentation.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128418 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c0d1c4a2
2012-09-12 Ilya Tikhonovsky <loislo@chromium.org>
Web Inspector: NMI: migrate core instrumentation code to WTF namespace
https://bugs.webkit.org/show_bug.cgi?id=96511
Reviewed by Yury Semikhatsky.
After moving core NMI code to WTF namespace I removed forward declarations
of MemoryObjectInfo and MemoryInstrumentation from WebCore headers and add
forward declaration into wtf/Forward.h
* wtf/Forward.h:
(WTF):
* wtf/MemoryInstrumentation.h:
2012-09-12 Dan Bernstein <mitz@apple.com>
Removed a reference to a file that doesn’t participate in any target.
......
......@@ -46,6 +46,8 @@ namespace WTF {
class Int8Array;
class Int16Array;
class Int32Array;
class MemoryInstrumentation;
class MemoryObjectInfo;
class String;
template <typename T> class StringBuffer;
class StringBuilder;
......@@ -78,6 +80,8 @@ using WTF::Float64Array;
using WTF::Int8Array;
using WTF::Int16Array;
using WTF::Int32Array;
using WTF::MemoryInstrumentation;
using WTF::MemoryObjectInfo;
using WTF::String;
using WTF::StringBuffer;
using WTF::StringBuilder;
......
......@@ -35,7 +35,7 @@
#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
namespace WebCore {
namespace WTF {
class MemoryClassInfo;
class MemoryObjectInfo;
......@@ -356,6 +356,6 @@ void MemoryInstrumentation::InstrumentedPointer<T>::process(MemoryInstrumentatio
memoryInstrumentation->countObjectSize(memoryObjectInfo.objectType(), memoryObjectInfo.objectSize());
}
} // namespace WebCore
} // namespace WTF
#endif // !defined(MemoryInstrumentation_h)
2012-09-12 Ilya Tikhonovsky <loislo@chromium.org>
Web Inspector: NMI: migrate core instrumentation code to WTF namespace
https://bugs.webkit.org/show_bug.cgi?id=96511
Reviewed by Yury Semikhatsky.
After moving core NMI code to WTF namespace I removed forward declarations
of MemoryObjectInfo and MemoryInstrumentation from WebCore headers and add
forward declaration into wtf/Forward.h
* bindings/v8/DOMDataStore.h:
(WebCore):
* bindings/v8/ScriptProfiler.h:
(WebCore):
* bindings/v8/V8DOMMap.h:
(WebCore):
* bindings/v8/V8PerIsolateData.h:
(WebCore):
* bindings/v8/V8ValueCache.h:
(WebCore):
* css/CSSProperty.h:
* css/CSSRule.h:
(WebCore):
* css/CSSSelectorList.h:
(WebCore):
* css/CSSStyleDeclaration.h:
(WebCore):
* css/CSSStyleSheet.h:
(WebCore):
* css/CSSValue.h:
* css/MediaList.h:
(WebCore):
* css/MediaQuery.h:
* css/MediaQueryExp.h:
* css/StylePropertySet.h:
(WebCore):
* css/StyleResolver.h:
* css/StyleRule.h:
(WebCore):
* css/StyleRuleImport.h:
(WebCore):
* css/StyleSheetContents.h:
(WebCore):
* css/WebKitCSSKeyframeRule.h:
* css/WebKitCSSKeyframesRule.h:
(WebCore):
* css/WebKitCSSMixFunctionValue.h:
* dom/DocumentEventQueue.h:
(WebCore):
* dom/ElementAttributeData.h:
(WebCore):
* dom/Event.h:
(WebCore):
* dom/Node.h:
(WebCore):
* dom/WebCoreMemoryInstrumentation.cpp:
(WTF):
(WTF::WebCore::KURL):
* dom/WebCoreMemoryInstrumentation.h:
(WebCore):
(WTF):
* inspector/MemoryInstrumentationImpl.h:
* loader/DocumentLoader.h:
(WebCore):
* loader/FrameLoader.h:
(WebCore):
* loader/ResourceLoader.h:
(WebCore):
* loader/SubstituteData.h:
* loader/cache/CachedCSSStyleSheet.h:
(WebCore):
* loader/cache/CachedRawResource.h:
(WebCore):
* loader/cache/CachedResource.h:
(WebCore):
* loader/cache/CachedResourceHandle.h:
* loader/cache/CachedResourceLoader.h:
(WebCore):
* loader/cache/CachedScript.h:
(WebCore):
* loader/cache/CachedShader.h:
* loader/cache/CachedXSLStyleSheet.h:
(WebCore):
* loader/cache/MemoryCache.h:
(WebCore):
* page/Frame.h:
(WebCore):
* platform/SharedBuffer.h:
* platform/graphics/CrossfadeGeneratedImage.h:
(WebCore):
* platform/graphics/Image.h:
(WebCore):
* platform/network/FormData.h:
(WebCore):
* platform/network/ResourceRequestBase.h:
* platform/network/ResourceResponseBase.h:
* rendering/style/RenderStyle.h:
(WebCore):
* rendering/style/StyleRareInheritedData.h:
(WebCore):
* rendering/style/StyleRareNonInheritedData.h:
(WebCore):
2012-09-13 Raul Hudea <rhudea@adobe.com>
[CSSRegions][CSSOM] Implement Element.getRegionFlowRanges
......@@ -251,7 +251,6 @@ __ZN7WebCore14DocumentLoader8setTitleERKNS_19StringWithDirectionE
__ZN7WebCore14DocumentLoaderC1ERKNS_15ResourceRequestERKNS_14SubstituteDataE
__ZN7WebCore14DocumentLoaderC2ERKNS_15ResourceRequestERKNS_14SubstituteDataE
__ZN7WebCore14DocumentLoaderD2Ev
__ZNK7WebCore14DocumentLoader17reportMemoryUsageEPNS_16MemoryObjectInfoE
__ZN7WebCore14DocumentWriter11setEncodingERKN3WTF6StringEb
__ZN7WebCore14FileIconLoader14notifyFinishedEN3WTF10PassRefPtrINS_4IconEEE
__ZN7WebCore14FormController22getReferencedFilePathsERKN3WTF6VectorINS1_6StringELm0EEE
......@@ -1152,6 +1151,7 @@ __ZNK7WebCore14DocumentLoader15getSubresourcesERN3WTF6VectorINS1_10PassRefPtrINS
__ZNK7WebCore14DocumentLoader15originalRequestEv
__ZNK7WebCore14DocumentLoader16mainResourceDataEv
__ZNK7WebCore14DocumentLoader17parsedArchiveDataEv
__ZNK7WebCore14DocumentLoader17reportMemoryUsageEPN3WTF16MemoryObjectInfoE
__ZNK7WebCore14DocumentLoader19isLoadingInAPISenseEv
__ZNK7WebCore14DocumentLoader19originalRequestCopyEv
__ZNK7WebCore14DocumentLoader21isLoadingMainResourceEv
......
......@@ -38,6 +38,7 @@
#include "ScriptObject.h"
#include "ScriptState.h"
#include <profiler/Profiler.h>
#include <wtf/Forward.h>
namespace WebCore {
......
......@@ -31,14 +31,13 @@
#include "ScriptHeapSnapshot.h"
#include "ScriptProfile.h"
#include "ScriptState.h"
#include <wtf/Forward.h>
#include <wtf/PassRefPtr.h>
namespace WebCore {
class ExternalArrayVisitor;
class ExternalStringVisitor;
class MemoryInstrumentation;
class NodeWrapperVisitor;
class Page;
class ScriptObject;
......
......@@ -47,7 +47,6 @@ namespace WebCore {
class DOMData;
class DOMDataStore;
class MemoryObjectInfo;
typedef WTF::Vector<DOMDataStore*> DOMDataList;
......
......@@ -35,6 +35,7 @@
#include "ScriptProfile.h"
#include "ScriptState.h"
#include <wtf/Forward.h>
#include <wtf/PassRefPtr.h>
#include <wtf/text/WTFString.h>
......@@ -42,7 +43,6 @@ namespace WebCore {
class ExternalArrayVisitor;
class ExternalStringVisitor;
class MemoryInstrumentation;
class NodeWrapperVisitor;
class Page;
class ScriptObject;
......
......@@ -39,7 +39,6 @@
namespace WebCore {
class DOMDataStore;
class Node;
class MemoryObjectInfo;
template <class KeyType, class ValueType> class AbstractWeakReferenceMap {
public:
......
......@@ -28,6 +28,7 @@
#include "ScopedPersistent.h"
#include <v8.h>
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/OwnPtr.h>
#include <wtf/Vector.h>
......@@ -37,7 +38,6 @@ namespace WebCore {
class DOMDataStore;
class GCEventData;
class IntegerCache;
class MemoryObjectInfo;
class StringCache;
class V8HiddenPropertyName;
struct WrapperTypeInfo;
......
......@@ -35,7 +35,6 @@
namespace WebCore {
class ExternalStringVisitor;
class MemoryObjectInfo;
class StringCache {
public:
......
......@@ -31,8 +31,6 @@
namespace WebCore {
class MemoryObjectInfo;
class CSSProperty {
public:
CSSProperty(CSSPropertyID propID, PassRefPtr<CSSValue> value, bool important = false, CSSPropertyID shorthandID = CSSPropertyInvalid, bool implicit = false)
......
......@@ -30,7 +30,6 @@
namespace WebCore {
class CSSStyleSheet;
class MemoryObjectInfo;
class StyleRuleBase;
struct CSSParserContext;
typedef int ExceptionCode;
......
......@@ -32,7 +32,6 @@
namespace WebCore {
class CSSParserSelector;
class MemoryObjectInfo;
class CSSSelectorList {
WTF_MAKE_FAST_ALLOCATED;
......
......@@ -30,7 +30,6 @@ namespace WebCore {
class CSSProperty;
class CSSStyleSheet;
class CSSValue;
class MemoryObjectInfo;
class StylePropertySet;
class StyledElement;
......
......@@ -39,7 +39,6 @@ class CSSStyleSheet;
class CachedCSSStyleSheet;
class Document;
class MediaQuerySet;
class MemoryObjectInfo;
class SecurityOrigin;
class StyleSheetContents;
......
......@@ -29,7 +29,6 @@
namespace WebCore {
class MemoryObjectInfo;
class StyleSheetContents;
// FIXME: The current CSSValue and subclasses should be turned into internal types (StyleValue).
......
......@@ -34,7 +34,6 @@ class CSSRule;
class CSSStyleSheet;
class MediaList;
class MediaQuery;
class MemoryObjectInfo;
class MediaQuerySet : public RefCounted<MediaQuerySet> {
public:
......
......@@ -36,7 +36,6 @@
namespace WebCore {
class MediaQueryExp;
class MemoryObjectInfo;
class MediaQuery {
WTF_MAKE_FAST_ALLOCATED;
......
......@@ -37,7 +37,6 @@
namespace WebCore {
class CSSParserValueList;
class MemoryObjectInfo;
class MediaQueryExp {
WTF_MAKE_FAST_ALLOCATED;
......
......@@ -34,7 +34,6 @@ namespace WebCore {
class CSSRule;
class CSSStyleDeclaration;
class KURL;
class MemoryObjectInfo;
class PropertySetCSSStyleDeclaration;
class StyledElement;
class StylePropertyShorthand;
......
......@@ -66,7 +66,6 @@ class KURL;
class KeyframeList;
class KeyframeValue;
class MediaQueryEvaluator;
class MemoryObjectInfo;
class Node;
class RenderRegion;
class RuleData;
......
......@@ -31,7 +31,6 @@ namespace WebCore {
class CSSRule;
class CSSStyleRule;
class CSSStyleSheet;
class MemoryObjectInfo;
class StylePropertySet;
class StyleRuleBase : public WTF::RefCountedBase {
......
......@@ -31,7 +31,6 @@ namespace WebCore {
class CachedCSSStyleSheet;
class MediaQuerySet;
class MemoryObjectInfo;
class StyleSheetContents;
class StyleRuleImport : public StyleRuleBase, public CachedStyleSheetClient {
......
......@@ -34,7 +34,6 @@ namespace WebCore {
class CSSStyleSheet;
class CachedCSSStyleSheet;
class Document;
class MemoryObjectInfo;
class Node;
class SecurityOrigin;
class StyleRuleBase;
......
......@@ -34,7 +34,6 @@
namespace WebCore {
class MemoryInstrumentation;
class StyleRuleCSSStyleDeclaration;
class WebKitCSSKeyframesRule;
......
......@@ -36,7 +36,6 @@
namespace WebCore {
class CSSRuleList;
class MemoryObjectInfo;
class StyleKeyframe;
class WebKitCSSKeyframeRule;
......
......@@ -37,8 +37,6 @@
namespace WebCore {
class MemoryObjectInfo;
class WebKitCSSMixFunctionValue : public CSSValueList {
public:
static PassRefPtr<WebKitCSSMixFunctionValue> create()
......
......@@ -28,6 +28,7 @@
#define DocumentEventQueue_h
#include "EventQueue.h"
#include <wtf/Forward.h>
#include <wtf/HashSet.h>
#include <wtf/ListHashSet.h>
#include <wtf/OwnPtr.h>
......@@ -38,7 +39,6 @@ namespace WebCore {
class Event;
class DocumentEventQueueTimer;
class MemoryObjectInfo;
class Node;
class ScriptExecutionContext;
......
......@@ -36,7 +36,6 @@ namespace WebCore {
class Attr;
class Element;
class ImmutableElementAttributeData;
class MemoryObjectInfo;
class MutableElementAttributeData;
enum SynchronizationOfLazyAttribute { NotInSynchronizationOfLazyAttribute, InSynchronizationOfLazyAttribute };
......
......@@ -37,8 +37,6 @@ class Clipboard;
class EventTarget;
class EventDispatcher;
class HTMLIFrameElement;
class MemoryInstrumentation;
class MemoryObjectInfo;
struct EventInit {
EventInit();
......
......@@ -66,7 +66,6 @@ class Frame;
class HTMLInputElement;
class IntRect;
class KeyboardEvent;
class MemoryObjectInfo;
class NSResolver;
class NamedNodeMap;
class NameNodeList;
......
......@@ -55,20 +55,24 @@ MemoryObjectType WebCoreMemoryTypes::CachedResourceSVG = "MemoryCache.SVG";
MemoryObjectType WebCoreMemoryTypes::CachedResourceShader = "MemoryCache.Shader";
MemoryObjectType WebCoreMemoryTypes::CachedResourceXSLT = "MemoryCache.XSLT";
template<> void MemoryInstrumentationTraits::addInstrumentedObject<KURL>(MemoryInstrumentation* instrumentation, const KURL* const& url, MemoryObjectType ownerObjectType, MemoryOwningType owningType)
} // namespace WebCore
namespace WTF {
template<> void MemoryInstrumentationTraits::addInstrumentedObject<WebCore::KURL>(MemoryInstrumentation* instrumentation, const WebCore::KURL* const& url, MemoryObjectType ownerObjectType, MemoryOwningType owningType)
{
MemoryInstrumentationTraits::addInstrumentedObject<const KURL>(instrumentation, url, ownerObjectType, owningType);
MemoryInstrumentationTraits::addInstrumentedObject<const WebCore::KURL>(instrumentation, url, ownerObjectType, owningType);
}
template<> void MemoryInstrumentationTraits::addInstrumentedObject<const KURL>(MemoryInstrumentation* instrumentation, const KURL* const& url, MemoryObjectType ownerObjectType, MemoryOwningType owningType)
template<> void MemoryInstrumentationTraits::addInstrumentedObject<const WebCore::KURL>(MemoryInstrumentation* instrumentation, const WebCore::KURL* const& url, MemoryObjectType ownerObjectType, MemoryOwningType owningType)
{
if (!url || instrumentation->visited(url))
return;
if (owningType == byPointer)
instrumentation->countObjectSize(ownerObjectType, sizeof(KURL));
instrumentation->countObjectSize(ownerObjectType, sizeof(WebCore::KURL));
instrumentation->addInstrumentedObject(url->string(), ownerObjectType);
if (url->innerURL())
instrumentation->addInstrumentedObject(url->innerURL(), ownerObjectType);
}
} // namespace WebCore
}
......@@ -36,16 +36,10 @@
namespace WebCore {
using WTF::MemoryClassInfo;
using WTF::MemoryObjectType;
class KURL;
// Explicit specializations for some types.
template<> void MemoryInstrumentationTraits::addInstrumentedObject<KURL>(MemoryInstrumentation*, const KURL* const&, MemoryObjectType, MemoryOwningType);
template<> void MemoryInstrumentationTraits::addInstrumentedObject<const KURL>(MemoryInstrumentation*, const KURL* const&, MemoryObjectType, MemoryOwningType);
// Link time guards with no body.
template<> void MemoryInstrumentationTraits::addObject<KURL>(MemoryInstrumentation*, const KURL* const&, MemoryObjectType, MemoryOwningType);
template<> void MemoryInstrumentationTraits::addObject<const KURL>(MemoryInstrumentation*, const KURL* const&, MemoryObjectType, MemoryOwningType);
class WebCoreMemoryTypes {
public:
static MemoryObjectType Page;
......@@ -69,4 +63,16 @@ public:
} // namespace WebCore
namespace WTF {
// Explicit specializations for some types.
template<> void MemoryInstrumentationTraits::addInstrumentedObject<WebCore::KURL>(MemoryInstrumentation*, const WebCore::KURL* const&, MemoryObjectType, MemoryOwningType);
template<> void MemoryInstrumentationTraits::addInstrumentedObject<const WebCore::KURL>(MemoryInstrumentation*, const WebCore::KURL* const&, MemoryObjectType, MemoryOwningType);
// Link time guards with no body.
template<> void MemoryInstrumentationTraits::addObject<WebCore::KURL>(MemoryInstrumentation*, const WebCore::KURL* const&, MemoryObjectType, MemoryOwningType);
template<> void MemoryInstrumentationTraits::addObject<const WebCore::KURL>(MemoryInstrumentation*, const WebCore::KURL* const&, MemoryObjectType, MemoryOwningType);
}
#endif // !defined(WebCoreMemoryInstrumentation_h)
......@@ -32,16 +32,19 @@
#define MemoryInstrumentationImpl_h
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/MemoryInstrumentation.h>
#include <wtf/Vector.h>
using WTF::MemoryObjectType;
namespace WebCore {
typedef HashSet<const void*> VisitedObjects;
class MemoryInstrumentationImpl : public MemoryInstrumentation {
class MemoryInstrumentationImpl : public WTF::MemoryInstrumentation {
public:
explicit MemoryInstrumentationImpl(VisitedObjects&);
......
......@@ -55,7 +55,6 @@ namespace WebCore {
class Frame;
class FrameLoader;
class MainResourceLoader;
class MemoryObjectInfo;
class Page;
class ResourceLoader;
class SchedulePair;
......
......@@ -61,7 +61,6 @@ class FormState;
class FormSubmission;
class FrameLoaderClient;
class FrameNetworkingContext;
class MemoryObjectInfo;
class NavigationAction;
class NetworkingContext;
class Page;
......
......@@ -44,7 +44,6 @@ namespace WebCore {
class Frame;
class FrameLoader;
class KURL;
class MemoryObjectInfo;
class ResourceHandle;
class SharedBuffer;
......
......@@ -33,8 +33,6 @@
namespace WebCore {
class MemoryObjectInfo;
class SubstituteData {
public:
SubstituteData() { }
......
......@@ -32,7 +32,6 @@
namespace WebCore {
class CachedResourceClient;
class MemoryObjectInfo;
class SharedBuffer;
class StyleSheetContents;
class TextResourceDecoder;
......
......@@ -29,7 +29,6 @@
namespace WebCore {
class CachedRawResourceCallback;
class CachedRawResourceClient;
class MemoryObjectInfo;
class CachedRawResource : public CachedResource {
public:
......
......@@ -47,7 +47,6 @@ class CachedResourceHandleBase;
class CachedResourceLoader;
class Frame;
class InspectorResource;
class MemoryObjectInfo;
class PurgeableBuffer;
class SecurityOrigin;
class SubresourceLoader;
......
......@@ -30,8 +30,6 @@
namespace WebCore {
class MemoryObjectInfo;
class CachedResourceHandleBase {
public:
~CachedResourceHandleBase() { if (m_resource) m_resource->unregisterHandle(this); }
......
......@@ -52,7 +52,6 @@ class Document;
class Frame;
class ImageLoader;
class KURL;
class MemoryObjectInfo;
// The CachedResourceLoader manages the loading of scripts/images/stylesheets for a single document.
class CachedResourceLoader {
......
......@@ -37,7 +37,6 @@ namespace JSC {
namespace WebCore {