Web Inspector: enable instrumentation of platform code
authorcaseq@chromium.org <caseq@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Aug 2012 12:06:20 +0000 (12:06 +0000)
committercaseq@chromium.org <caseq@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Aug 2012 12:06:20 +0000 (12:06 +0000)
commitbfee6532efc57a20f0cf53505118a85032fcca12
tree89ce6a4a928208e3085b3109c4be9df505619382
parentbbc2ef3ecf756dcb1852ae888864cca07eee6af7
Web Inspector: enable instrumentation of platform code
https://bugs.webkit.org/show_bug.cgi?id=94125

Reviewed by Pavel Feldman.

- add PlatformInstrumentation class that exposes instrumentation methods that may be used by code under WebCore/platform;
- move TRACE_EVENT_XXX() macros into PlatformInstrumentation.h to minimize instrumentation hassle in the client code;
- implement PlatformInstrumentationClient by InspectorTimelineAgent;
- only install PlatformInstrumentationClient when we have outer events for which we expect low-level details

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::willDecodeImage): to be implemented by subsequent change;
(WebCore::InspectorTimelineAgent::didDecodeImage): to be implemented by subsequent change;
(WebCore::InspectorTimelineAgent::willResizeImage): to be implemented by subsequent change;
(WebCore::InspectorTimelineAgent::didResizeImage): to be implemented by subsequent change;
(WebCore::InspectorTimelineAgent::didCompleteCurrentRecord):
(WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
(WebCore::InspectorTimelineAgent::pushCurrentRecord):
(WebCore::InspectorTimelineAgent::clearRecordStack):
* inspector/InspectorTimelineAgent.h:
(InspectorTimelineAgent):
* platform/PlatformInstrumentation.cpp: Added.
(WebCore):
(WebCore::PlatformInstrumentation::setClient):
* platform/PlatformInstrumentation.h: Added.
(WebCore):
(PlatformInstrumentationClient):
(PlatformInstrumentation):
(WebCore::PlatformInstrumentation::hasClient):
(WebCore::PlatformInstrumentation::willDecodeImage):
(WebCore::PlatformInstrumentation::didDecodeImage):
(WebCore::PlatformInstrumentation::willResizeImage):
(WebCore::PlatformInstrumentation::didResizeImage):
* platform/graphics/skia/NativeImageSkia.cpp:
(WebCore::NativeImageSkia::resizedBitmap): added calls to PlatformInstrumentation, removed TRACE_EVENT();
* platform/image-decoders/bmp/BMPImageDecoder.cpp:
(WebCore::BMPImageDecoder::frameBufferAtIndex): added calls to PlatformInstrumentation;
(WebCore::BMPImageDecoder::decode): removed TRACE_EVENT()
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::frameBufferAtIndex): added calls to PlatformInstrumentation;
(WebCore::GIFImageDecoder::decode): removed TRACE_EVENT()
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::frameBufferAtIndex): added calls to PlatformInstrumentation;
(WebCore::ICOImageDecoder::decode): removed TRACE_EVENT()
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::JPEGImageDecoder::frameBufferAtIndex): added calls to PlatformInstrumentation;
(WebCore::JPEGImageDecoder::decode): removed TRACE_EVENT()
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::frameBufferAtIndex): added calls to PlatformInstrumentation;
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::frameBufferAtIndex): added calls to PlatformInstrumentation;
(WebCore::WEBPImageDecoder::decode): removed TRACE_EVENT();
* inspector/InspectorInstrumentation.cpp: removed orphan event support;
(WebCore):
* inspector/InspectorInstrumentation.h: ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125769 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/InspectorTimelineAgent.cpp
Source/WebCore/inspector/InspectorTimelineAgent.h
Source/WebCore/platform/PlatformInstrumentation.cpp [new file with mode: 0644]
Source/WebCore/platform/PlatformInstrumentation.h [new file with mode: 0644]
Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp
Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp
Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
Source/WebCore/platform/image-decoders/webp/WEBPImageDecoder.cpp