Remove TimelineTraceEventProcessor since no current ports use it
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Sep 2013 18:59:41 +0000 (18:59 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Sep 2013 18:59:41 +0000 (18:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=121171

Reviewed by Joseph Pecoraro.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
* inspector/InspectorClient.h:
* inspector/InspectorInstrumentation.cpp:
* inspector/InspectorInstrumentation.h:
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::start):
(WebCore::InspectorTimelineAgent::stop):
* inspector/InspectorTimelineAgent.h:
* inspector/TimelineTraceEventProcessor.cpp: Removed.
* inspector/TimelineTraceEventProcessor.h: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155549 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/inspector/InspectorAllInOne.cpp
Source/WebCore/inspector/InspectorClient.h
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/InspectorTimelineAgent.cpp
Source/WebCore/inspector/InspectorTimelineAgent.h
Source/WebCore/inspector/TimelineTraceEventProcessor.cpp [deleted file]
Source/WebCore/inspector/TimelineTraceEventProcessor.h [deleted file]

index 0633c82..57e1166 100644 (file)
@@ -1622,7 +1622,6 @@ set(WebCore_SOURCES
     inspector/ScriptCallFrame.cpp
     inspector/ScriptCallStack.cpp
     inspector/TimelineRecordFactory.cpp
-    inspector/TimelineTraceEventProcessor.cpp
     inspector/WorkerConsoleAgent.cpp
     inspector/WorkerDebuggerAgent.cpp
     inspector/WorkerInspectorController.cpp
index 005b6bd..8911791 100644 (file)
@@ -1,3 +1,27 @@
+2013-09-11  Timothy Hatcher  <timothy@apple.com>
+
+        Remove TimelineTraceEventProcessor since no current ports use it
+        https://bugs.webkit.org/show_bug.cgi?id=121171
+
+        Reviewed by Joseph Pecoraro.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * inspector/InspectorAllInOne.cpp:
+        * inspector/InspectorClient.h:
+        * inspector/InspectorInstrumentation.cpp:
+        * inspector/InspectorInstrumentation.h:
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::start):
+        (WebCore::InspectorTimelineAgent::stop):
+        * inspector/InspectorTimelineAgent.h:
+        * inspector/TimelineTraceEventProcessor.cpp: Removed.
+        * inspector/TimelineTraceEventProcessor.h: Removed.
+
 2013-09-11  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r155519.
index 053446e..08e3896 100644 (file)
@@ -3930,8 +3930,6 @@ webcore_sources += \
        Source/WebCore/inspector/ScriptGCEventListener.h \
        Source/WebCore/inspector/TimelineRecordFactory.cpp \
        Source/WebCore/inspector/TimelineRecordFactory.h \
-       Source/WebCore/inspector/TimelineTraceEventProcessor.cpp \
-       Source/WebCore/inspector/TimelineTraceEventProcessor.h \
        Source/WebCore/inspector/WorkerConsoleAgent.cpp \
        Source/WebCore/inspector/WorkerConsoleAgent.h \
        Source/WebCore/inspector/WorkerDebuggerAgent.cpp \
index 639d85d..ec53d4d 100644 (file)
@@ -813,7 +813,6 @@ SOURCES += \
     inspector/ScriptCallFrame.cpp \
     inspector/ScriptCallStack.cpp \
     inspector/TimelineRecordFactory.cpp \
-    inspector/TimelineTraceEventProcessor.cpp \
     inspector/WorkerConsoleAgent.cpp \
     inspector/WorkerDebuggerAgent.cpp \
     inspector/WorkerInspectorController.cpp \
index 34dab65..8d51d95 100644 (file)
     <ClCompile Include="..\html\track\VideoTrack.cpp" />
     <ClCompile Include="..\html\track\VideoTrackList.cpp" />
     <ClCompile Include="..\html\track\WebVTTElement.cpp" />
-    <ClCompile Include="..\inspector\TimelineTraceEventProcessor.cpp">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\Modules\filesystem\DirectoryEntry.cpp" />
     <ClCompile Include="..\Modules\filesystem\DirectoryEntrySync.cpp" />
     <ClCompile Include="..\Modules\filesystem\DirectoryReader.cpp" />
     <ClInclude Include="..\html\track\VideoTrack.h" />
     <ClInclude Include="..\html\track\VideoTrackList.h" />
     <ClInclude Include="..\html\track\WebVTTElement.h" />
-    <ClInclude Include="..\inspector\TimelineTraceEventProcessor.h" />
     <ClInclude Include="..\Modules\filesystem\AsyncFileWriter.h" />
     <ClInclude Include="..\Modules\filesystem\AsyncFileWriterClient.h" />
     <ClInclude Include="..\Modules\filesystem\DirectoryEntry.h" />
index 36cddde..3af87bf 100644 (file)
     <ClCompile Include="..\svg\graphics\SVGImageForContainer.cpp">
       <Filter>rendering\svg\graphics</Filter>
     </ClCompile>
-    <ClCompile Include="..\inspector\TimelineTraceEventProcessor.cpp">
-      <Filter>inspector</Filter>
-    </ClCompile>
     <ClCompile Include="..\rendering\HitTestLocation.cpp">
       <Filter>rendering</Filter>
     </ClCompile>
     <ClInclude Include="..\svg\graphics\SVGImageForContainer.h">
       <Filter>rendering\svg\graphics</Filter>
     </ClInclude>
-    <ClInclude Include="..\inspector\TimelineTraceEventProcessor.h">
-      <Filter>inspector</Filter>
-    </ClInclude>
     <ClInclude Include="..\rendering\HitTestLocation.h">
       <Filter>rendering</Filter>
     </ClInclude>
index 23c46fa..266da66 100644 (file)
                46F9D5DF0B0D60170028EE36 /* progressCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 46F9D5DC0B0D60170028EE36 /* progressCursor.png */; };
                490707E61219C04300D90E51 /* ANGLEWebKitBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 490707E41219C04300D90E51 /* ANGLEWebKitBridge.cpp */; };
                490707E71219C04300D90E51 /* ANGLEWebKitBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 490707E51219C04300D90E51 /* ANGLEWebKitBridge.h */; };
-               49140256168E02E8002D6C6A /* TimelineTraceEventProcessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49140254168E02B4002D6C6A /* TimelineTraceEventProcessor.cpp */; };
-               49140257168E02EC002D6C6A /* TimelineTraceEventProcessor.h in Headers */ = {isa = PBXBuildFile; fileRef = 49140255168E02B4002D6C6A /* TimelineTraceEventProcessor.h */; };
                49182B5215DCE6F000548418 /* PlatformInstrumentation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49182B5015DCE6F000548418 /* PlatformInstrumentation.cpp */; };
                49182B5315DCE6F000548418 /* PlatformInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49182B5115DCE6F000548418 /* PlatformInstrumentation.h */; };
                49291E4B134172C800E753DE /* ImageRenderingMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 49291E4A134172C800E753DE /* ImageRenderingMode.h */; };
                46F9D5DC0B0D60170028EE36 /* progressCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = progressCursor.png; sourceTree = "<group>"; };
                490707E41219C04300D90E51 /* ANGLEWebKitBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ANGLEWebKitBridge.cpp; sourceTree = "<group>"; };
                490707E51219C04300D90E51 /* ANGLEWebKitBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANGLEWebKitBridge.h; sourceTree = "<group>"; };
-               49140254168E02B4002D6C6A /* TimelineTraceEventProcessor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimelineTraceEventProcessor.cpp; sourceTree = "<group>"; };
-               49140255168E02B4002D6C6A /* TimelineTraceEventProcessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimelineTraceEventProcessor.h; sourceTree = "<group>"; };
                49182B5015DCE6F000548418 /* PlatformInstrumentation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformInstrumentation.cpp; sourceTree = "<group>"; };
                49182B5115DCE6F000548418 /* PlatformInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformInstrumentation.h; sourceTree = "<group>"; };
                49291E4A134172C800E753DE /* ImageRenderingMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageRenderingMode.h; sourceTree = "<group>"; };
                                9FA37EF01172FD4100C4CD55 /* ScriptProfileNode.idl */,
                                7553CFE7108F473F00EA281E /* TimelineRecordFactory.cpp */,
                                7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */,
-                               49140254168E02B4002D6C6A /* TimelineTraceEventProcessor.cpp */,
-                               49140255168E02B4002D6C6A /* TimelineTraceEventProcessor.h */,
                                F382088E147D35F90010BC06 /* WorkerConsoleAgent.cpp */,
                                F382088F147D35F90010BC06 /* WorkerConsoleAgent.h */,
                                F34742DE1343631F00531BC2 /* WorkerDebuggerAgent.cpp */,
                                498770F31242C535002226BA /* TilingData.h in Headers */,
                                F55B3DDC1251F12D003EF269 /* TimeInputType.h in Headers */,
                                7553CFE8108F473F00EA281E /* TimelineRecordFactory.h in Headers */,
-                               49140257168E02EC002D6C6A /* TimelineTraceEventProcessor.h in Headers */,
                                9305B24D098F1B6B00C28855 /* Timer.h in Headers */,
                                E44613B00CD6331000FADA75 /* TimeRanges.h in Headers */,
                                49E912AE0EFAC906009D0CAF /* TimingFunction.h in Headers */,
                                498770F21242C535002226BA /* TilingData.cpp in Sources */,
                                F55B3DDB1251F12D003EF269 /* TimeInputType.cpp in Sources */,
                                7553CFE9108F473F00EA281E /* TimelineRecordFactory.cpp in Sources */,
-                               49140256168E02E8002D6C6A /* TimelineTraceEventProcessor.cpp in Sources */,
                                93309EA4099EB78C0056E581 /* Timer.cpp in Sources */,
                                E44613AF0CD6331000FADA75 /* TimeRanges.cpp in Sources */,
                                070334D9145A006F008D8D45 /* TrackBase.cpp in Sources */,
index 94b49f1..1398ff7 100644 (file)
@@ -81,7 +81,6 @@
 #include "ScriptCallFrame.cpp"
 #include "ScriptCallStack.cpp"
 #include "TimelineRecordFactory.cpp"
-#include "TimelineTraceEventProcessor.cpp"
 #include "WorkerConsoleAgent.cpp"
 #include "WorkerDebuggerAgent.cpp"
 #include "WorkerInspectorController.cpp"
index 6bdc2ea..895e5d9 100644 (file)
@@ -59,11 +59,6 @@ public:
     virtual void clearBrowserCookies() { }
     virtual bool canMonitorMainThread() { return false; }
 
-    typedef void (*TraceEventCallback)(char phase, const unsigned char*, const char* name, unsigned long long id,
-        int numArgs, const char* const* argNames, const unsigned char* argTypes, const unsigned long long* argValues,
-        unsigned char flags);
-    virtual void setTraceEventCallback(TraceEventCallback) { }
-
     virtual bool canOverrideDeviceMetrics() { return false; }
 
     virtual void overrideDeviceMetrics(int /*width*/, int /*height*/, float /*fontScaleFactor*/, bool /*fitWindow*/)
index 3e69c82..174cb7f 100644 (file)
@@ -1387,19 +1387,6 @@ void InspectorInstrumentation::pseudoElementDestroyedImpl(InstrumentingAgents* i
 }
 #endif
 
-namespace InstrumentationEvents {
-const char PaintLayer[] = "PaintLayer";
-const char RasterTask[] = "RasterTask";
-const char Paint[] = "Paint";
-const char Layer[] = "Layer";
-const char BeginFrame[] = "BeginFrame";
-};
-
-namespace InstrumentationEventArguments {
-const char LayerId[] = "layerId";
-const char PageId[] = "pageId";
-};
-
 } // namespace WebCore
 
 #endif // !ENABLE(INSPECTOR)
index 003cdfb..a105272 100644 (file)
@@ -512,19 +512,6 @@ private:
 #endif
 };
 
-namespace InstrumentationEvents {
-extern const char PaintLayer[];
-extern const char RasterTask[];
-extern const char Paint[];
-extern const char Layer[];
-extern const char BeginFrame[];
-};
-
-namespace InstrumentationEventArguments {
-extern const char LayerId[];
-extern const char PageId[];
-};
-
 inline void InspectorInstrumentation::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld* world)
 {
 #if ENABLE(INSPECTOR)
index d892ae8..8b7d9cd 100644 (file)
@@ -52,7 +52,6 @@
 #include "ResourceRequest.h"
 #include "ResourceResponse.h"
 #include "TimelineRecordFactory.h"
-#include "TimelineTraceEventProcessor.h"
 
 #include <wtf/CurrentTime.h>
 
@@ -191,8 +190,6 @@ void InspectorTimelineAgent::start(ErrorString*, const int* maxCallStackDepth, c
     m_instrumentingAgents->setInspectorTimelineAgent(this);
     ScriptGCEvent::addEventListener(this);
     m_state->setBoolean(TimelineAgentState::timelineAgentEnabled, true);
-    if (m_client && m_pageAgent)
-        m_traceEventProcessor = adoptRef(new TimelineTraceEventProcessor(m_weakFactory.createWeakPtr(), m_client));
 }
 
 void InspectorTimelineAgent::stop(ErrorString*)
@@ -200,8 +197,6 @@ void InspectorTimelineAgent::stop(ErrorString*)
     if (!m_state->getBoolean(TimelineAgentState::timelineAgentEnabled))
         return;
 
-    m_traceEventProcessor->shutdown();
-    m_traceEventProcessor.clear();
     m_weakFactory.revokeAll();
     m_instrumentingAgents->setInspectorTimelineAgent(0);
     ScriptGCEvent::removeEventListener(this);
index 118d70d..201e148 100644 (file)
@@ -60,7 +60,6 @@ class Page;
 class RenderObject;
 class ResourceRequest;
 class ResourceResponse;
-class TimelineTraceEventProcessor;
 
 typedef String ErrorString;
 
@@ -195,7 +194,6 @@ public:
 
 private:
     friend class TimelineRecordStack;
-    friend class TimelineTraceEventProcessor;
 
     struct TimelineRecordEntry {
         TimelineRecordEntry(PassRefPtr<InspectorObject> record, PassRefPtr<InspectorObject> data, PassRefPtr<InspectorArray> children, const String& type, size_t usedHeapSizeAtStart)
@@ -261,7 +259,6 @@ private:
     InspectorType m_inspectorType;
     InspectorClient* m_client;
     WeakPtrFactory<InspectorTimelineAgent> m_weakFactory;
-    RefPtr<TimelineTraceEventProcessor> m_traceEventProcessor;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/inspector/TimelineTraceEventProcessor.cpp b/Source/WebCore/inspector/TimelineTraceEventProcessor.cpp
deleted file mode 100644 (file)
index 5d11508..0000000
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
-* Copyright (C) 2013 Google Inc. All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are
-* met:
-*
-*     * Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-*     * Redistributions in binary form must reproduce the above
-* copyright notice, this list of conditions and the following disclaimer
-* in the documentation and/or other materials provided with the
-* distribution.
-*     * Neither the name of Google Inc. nor the names of its
-* contributors may be used to endorse or promote products derived from
-* this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "config.h"
-
-#if ENABLE(INSPECTOR)
-
-#include "TimelineTraceEventProcessor.h"
-
-#include "InspectorClient.h"
-#include "InspectorInstrumentation.h"
-#include "TimelineRecordFactory.h"
-
-#include <wtf/CurrentTime.h>
-#include <wtf/MainThread.h>
-#include <wtf/ThreadSpecific.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
-namespace {
-
-class TraceEventDispatcher {
-    WTF_MAKE_NONCOPYABLE(TraceEventDispatcher);
-public:
-    static TraceEventDispatcher* instance()
-    {
-        DEFINE_STATIC_LOCAL(TraceEventDispatcher, instance, ());
-        return &instance;
-    }
-
-    void addProcessor(TimelineTraceEventProcessor* processor, InspectorClient* client)
-    {
-        MutexLocker locker(m_mutex);
-
-        m_processors.append(processor);
-        if (m_processors.size() == 1)
-            client->setTraceEventCallback(dispatchEventOnAnyThread);
-    }
-
-    void removeProcessor(TimelineTraceEventProcessor* processor, InspectorClient* client)
-    {
-        MutexLocker locker(m_mutex);
-
-        size_t index = m_processors.find(processor);
-        if (index == notFound) {
-            ASSERT_NOT_REACHED();
-            return;
-        }
-        m_processors.remove(index);
-        if (m_processors.isEmpty())
-            client->setTraceEventCallback(0);
-    }
-
-private:
-    TraceEventDispatcher() { }
-
-    static void dispatchEventOnAnyThread(char phase, const unsigned char*, const char* name, unsigned long long id,
-        int numArgs, const char* const* argNames, const unsigned char* argTypes, const unsigned long long* argValues,
-        unsigned char flags)
-    {
-        TraceEventDispatcher* self = instance();
-        Vector<RefPtr<TimelineTraceEventProcessor> > processors;
-        {
-            MutexLocker locker(self->m_mutex);
-            processors = self->m_processors;
-        }
-        for (int i = 0, size = processors.size(); i < size; ++i) {
-            processors[i]->processEventOnAnyThread(static_cast<TimelineTraceEventProcessor::TraceEventPhase>(phase),
-                name, id, numArgs, argNames, argTypes, argValues, flags);
-        }
-    }
-
-    Mutex m_mutex;
-    Vector<RefPtr<TimelineTraceEventProcessor> > m_processors;
-};
-
-} // namespce
-
-
-TimelineRecordStack::TimelineRecordStack(WeakPtr<InspectorTimelineAgent> timelineAgent)
-    : m_timelineAgent(timelineAgent)
-{
-}
-
-void TimelineRecordStack::addScopedRecord(PassRefPtr<InspectorObject> record)
-{
-    m_stack.append(Entry(record));
-}
-
-void TimelineRecordStack::closeScopedRecord(double endTime)
-{
-    if (m_stack.isEmpty())
-        return;
-    Entry last = m_stack.last();
-    m_stack.removeLast();
-    last.record->setNumber("endTime", endTime);
-    if (last.children->length())
-        last.record->setArray("children", last.children);
-    addInstantRecord(last.record);
-}
-
-void TimelineRecordStack::addInstantRecord(PassRefPtr<InspectorObject> record)
-{
-    if (m_stack.isEmpty())
-        send(record);
-    else
-        m_stack.last().children->pushObject(record);
-}
-
-#ifndef NDEBUG
-bool TimelineRecordStack::isOpenRecordOfType(const String& type)
-{
-    String lastRecordType;
-    return m_stack.isEmpty() || (m_stack.last().record->getString("type", &lastRecordType) && type == lastRecordType);
-}
-#endif
-
-void TimelineRecordStack::send(PassRefPtr<InspectorObject> record)
-{
-    InspectorTimelineAgent* timelineAgent = m_timelineAgent.get();
-    if (!timelineAgent)
-        return;
-    timelineAgent->sendEvent(record);
-}
-
-TimelineTraceEventProcessor::TimelineTraceEventProcessor(WeakPtr<InspectorTimelineAgent> timelineAgent, InspectorClient *client)
-    : m_timelineAgent(timelineAgent)
-    , m_timeConverter(timelineAgent.get()->timeConverter())
-    , m_inspectorClient(client)
-    , m_pageId(reinterpret_cast<unsigned long long>(m_timelineAgent.get()->page()))
-    , m_layerId(0)
-{
-    registerHandler(InstrumentationEvents::BeginFrame, TracePhaseInstant, &TimelineTraceEventProcessor::onBeginFrame);
-    registerHandler(InstrumentationEvents::PaintLayer, TracePhaseBegin, &TimelineTraceEventProcessor::onPaintLayerBegin);
-    registerHandler(InstrumentationEvents::PaintLayer, TracePhaseEnd, &TimelineTraceEventProcessor::onPaintLayerEnd);
-    registerHandler(InstrumentationEvents::RasterTask, TracePhaseBegin, &TimelineTraceEventProcessor::onRasterTaskBegin);
-    registerHandler(InstrumentationEvents::RasterTask, TracePhaseEnd, &TimelineTraceEventProcessor::onRasterTaskEnd);
-    registerHandler(InstrumentationEvents::Layer, TracePhaseDeleteObject, &TimelineTraceEventProcessor::onLayerDeleted);
-    registerHandler(InstrumentationEvents::Paint, TracePhaseInstant, &TimelineTraceEventProcessor::onPaint);
-    registerHandler(PlatformInstrumentation::ImageDecodeEvent, TracePhaseBegin, &TimelineTraceEventProcessor::onImageDecodeBegin);
-    registerHandler(PlatformInstrumentation::ImageDecodeEvent, TracePhaseEnd, &TimelineTraceEventProcessor::onImageDecodeEnd);
-
-    TraceEventDispatcher::instance()->addProcessor(this, m_inspectorClient);
-}
-
-TimelineTraceEventProcessor::~TimelineTraceEventProcessor()
-{
-}
-
-void TimelineTraceEventProcessor::registerHandler(const char* name, TraceEventPhase phase, TraceEventHandler handler)
-{
-    m_handlersByType.set(std::make_pair(name, phase), handler);
-}
-
-void TimelineTraceEventProcessor::shutdown()
-{
-    TraceEventDispatcher::instance()->removeProcessor(this, m_inspectorClient);
-}
-
-size_t TimelineTraceEventProcessor::TraceEvent::findParameter(const char* name) const
-{
-    for (int i = 0; i < m_argumentCount; ++i) {
-        if (!strcmp(name, m_argumentNames[i]))
-            return i;
-    }
-    return notFound;
-}
-
-const TimelineTraceEventProcessor::TraceValueUnion& TimelineTraceEventProcessor::TraceEvent::parameter(const char* name, TraceValueTypes expectedType) const
-{
-    static TraceValueUnion missingValue;
-    size_t index = findParameter(name);
-    if (index == notFound || m_argumentTypes[index] != expectedType) {
-        ASSERT_NOT_REACHED();
-        return missingValue;
-    }
-    return *reinterpret_cast<const TraceValueUnion*>(m_argumentValues + index);
-}
-
-void TimelineTraceEventProcessor::processEventOnAnyThread(TraceEventPhase phase, const char* name, unsigned long long id,
-    int numArgs, const char* const* argNames, const unsigned char* argTypes, const unsigned long long* argValues,
-    unsigned char)
-{
-    HandlersMap::iterator it = m_handlersByType.find(std::make_pair(name, phase));
-    if (it == m_handlersByType.end())
-        return;
-
-    TraceEvent event(monotonicallyIncreasingTime(), phase, name, id, currentThread(), numArgs, argNames, argTypes, argValues);
-
-    if (!isMainThread()) {
-        MutexLocker locker(m_backgroundEventsMutex);
-        m_backgroundEvents.append(event);
-        return;
-    }
-    (this->*(it->value))(event);
-}
-
-void TimelineTraceEventProcessor::onBeginFrame(const TraceEvent&)
-{
-    processBackgroundEvents();
-}
-
-void TimelineTraceEventProcessor::onPaintLayerBegin(const TraceEvent& event)
-{
-    m_layerId = event.asUInt(InstrumentationEventArguments::LayerId);
-    ASSERT(m_layerId);
-}
-
-void TimelineTraceEventProcessor::onPaintLayerEnd(const TraceEvent&)
-{
-    m_layerId = 0;
-}
-
-void TimelineTraceEventProcessor::onRasterTaskBegin(const TraceEvent& event)
-{
-    unsigned long long layerId = event.asUInt(InstrumentationEventArguments::LayerId);
-    if (!m_knownLayers.contains(layerId))
-        return;
-    TimelineThreadState& state = threadState(event.threadIdentifier());
-    ASSERT(!state.inRasterizeEvent);
-    state.inRasterizeEvent = true;
-    RefPtr<InspectorObject> record = createRecord(event, TimelineRecordType::Rasterize);
-    state.recordStack.addScopedRecord(record.release());
-}
-
-void TimelineTraceEventProcessor::onRasterTaskEnd(const TraceEvent& event)
-{
-    TimelineThreadState& state = threadState(event.threadIdentifier());
-    if (!state.inRasterizeEvent)
-        return;
-    ASSERT(state.recordStack.isOpenRecordOfType(TimelineRecordType::Rasterize));
-    state.recordStack.closeScopedRecord(m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp()));
-    state.inRasterizeEvent = false;
-}
-
-void TimelineTraceEventProcessor::onImageDecodeBegin(const TraceEvent& event)
-{
-    TimelineThreadState& state = threadState(event.threadIdentifier());
-    if (!state.inRasterizeEvent)
-        return;
-    state.recordStack.addScopedRecord(createRecord(event, TimelineRecordType::DecodeImage));
-}
-
-void TimelineTraceEventProcessor::onImageDecodeEnd(const TraceEvent& event)
-{
-    TimelineThreadState& state = threadState(event.threadIdentifier());
-    if (!state.inRasterizeEvent)
-        return;
-    ASSERT(state.recordStack.isOpenRecordOfType(TimelineRecordType::DecodeImage));
-    state.recordStack.closeScopedRecord(m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp()));
-}
-
-void TimelineTraceEventProcessor::onLayerDeleted(const TraceEvent& event)
-{
-    unsigned long long id = event.id();
-    ASSERT(id);
-    processBackgroundEvents();
-    m_knownLayers.remove(id);
-}
-
-void TimelineTraceEventProcessor::onPaint(const TraceEvent& event)
-{
-    if (!m_layerId)
-        return;
-
-    unsigned long long pageId = event.asUInt(InstrumentationEventArguments::PageId);
-    if (pageId == m_pageId)
-        m_knownLayers.add(m_layerId);
-}
-
-PassRefPtr<InspectorObject> TimelineTraceEventProcessor::createRecord(const TraceEvent& event, const String& recordType, PassRefPtr<InspectorObject> data)
-{
-    double startTime = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
-    RefPtr<InspectorObject> record = TimelineRecordFactory::createBackgroundRecord(startTime, String::number(event.threadIdentifier()));
-    record->setString("type", recordType);
-    record->setObject("data", data ? data : InspectorObject::create());
-    return record.release();
-}
-
-void TimelineTraceEventProcessor::processBackgroundEvents()
-{
-    ASSERT(isMainThread());
-    Vector<TraceEvent> events;
-    {
-        MutexLocker locker(m_backgroundEventsMutex);
-        events.reserveCapacity(m_backgroundEvents.capacity());
-        m_backgroundEvents.swap(events);
-    }
-    for (size_t i = 0, size = events.size(); i < size; ++i) {
-        const TraceEvent& event = events[i];
-        HandlersMap::iterator it = m_handlersByType.find(std::make_pair(event.name(), event.phase()));
-        ASSERT(it != m_handlersByType.end() && it->value);
-        (this->*(it->value))(event);
-    }
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INSPECTOR)
diff --git a/Source/WebCore/inspector/TimelineTraceEventProcessor.h b/Source/WebCore/inspector/TimelineTraceEventProcessor.h
deleted file mode 100644 (file)
index acb8b38..0000000
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
-* Copyright (C) 2013 Google Inc. All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are
-* met:
-*
-*     * Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-*     * Redistributions in binary form must reproduce the above
-* copyright notice, this list of conditions and the following disclaimer
-* in the documentation and/or other materials provided with the
-* distribution.
-*     * Neither the name of Google Inc. nor the names of its
-* contributors may be used to endorse or promote products derived from
-* this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef TimelineTraceEventProcessor_h
-#define TimelineTraceEventProcessor_h
-
-#if ENABLE(INSPECTOR)
-
-#include "InspectorTimelineAgent.h"
-#include "InspectorValues.h"
-
-#include <wtf/HashMap.h>
-#include <wtf/HashSet.h>
-#include <wtf/Noncopyable.h>
-#include <wtf/Threading.h>
-#include <wtf/Vector.h>
-#include <wtf/WeakPtr.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class InspectorClient;
-class InspectorTimelineAgent;
-class Page;
-
-class TimelineRecordStack {
-private:
-    struct Entry {
-        Entry(PassRefPtr<InspectorObject> record)
-            : record(record)
-            , children(InspectorArray::create())
-        {
-        }
-
-        RefPtr<InspectorObject> record;
-        RefPtr<InspectorArray> children;
-    };
-
-public:
-    TimelineRecordStack() { }
-    TimelineRecordStack(WeakPtr<InspectorTimelineAgent>);
-
-    void addScopedRecord(PassRefPtr<InspectorObject> record);
-    void closeScopedRecord(double endTime);
-    void addInstantRecord(PassRefPtr<InspectorObject> record);
-
-#ifndef NDEBUG
-    bool isOpenRecordOfType(const String& type);
-#endif
-
-private:
-    void send(PassRefPtr<InspectorObject>);
-
-    WeakPtr<InspectorTimelineAgent> m_timelineAgent;
-    Vector<Entry> m_stack;
-};
-
-class TimelineTraceEventProcessor : public ThreadSafeRefCounted<TimelineTraceEventProcessor> {
-public:
-    // FIXME: re-use definitions in TraceEvent.h once it's promoted to all platforms.
-    enum TraceEventPhase {
-        TracePhaseBegin = 'B',
-        TracePhaseEnd = 'E',
-        TracePhaseInstant = 'I',
-        TracePhaseCreateObject = 'N',
-        TracePhaseDeleteObject = 'D'
-    };
-
-    TimelineTraceEventProcessor(WeakPtr<InspectorTimelineAgent>, InspectorClient*);
-    ~TimelineTraceEventProcessor();
-
-    void shutdown();
-    void processEventOnAnyThread(TraceEventPhase, const char* name, unsigned long long id,
-        int numArgs, const char* const* argNames, const unsigned char* argTypes, const unsigned long long* argValues,
-        unsigned char flags);
-
-private:
-    // FIXME: use the definition in TraceEvent.h once we expose the latter to all plaforms.
-    union TraceValueUnion {
-        bool m_bool;
-        unsigned long long m_uint;
-        long long m_int;
-        double m_double;
-        const void* m_pointer;
-        const char* m_string;
-    };
-
-    enum TraceValueTypes {
-        TypeBool = 1,
-        TypeUInt = 2,
-        TypeInt = 3,
-        TypeDouble = 4,
-        TypePointer = 5,
-        TypeString = 6,
-        TypeCopyString = 7
-    };
-
-    struct TimelineThreadState {
-        TimelineThreadState() { }
-
-        TimelineThreadState(WeakPtr<InspectorTimelineAgent> timelineAgent)
-            : recordStack(timelineAgent)
-            , inRasterizeEvent(false)
-        {
-        }
-
-        TimelineRecordStack recordStack;
-        bool inRasterizeEvent;
-    };
-
-    class TraceEvent {
-    public:
-        TraceEvent()
-            : m_name(0)
-            , m_argumentCount(0)
-        {
-        }
-
-        TraceEvent(double timestamp, TraceEventPhase phase, const char* name, unsigned long long id, ThreadIdentifier threadIdentifier,
-            int argumentCount, const char* const* argumentNames, const unsigned char* argumentTypes, const unsigned long long* argumentValues)
-            : m_timestamp(timestamp)
-            , m_phase(phase)
-            , m_name(name)
-            , m_id(id)
-            , m_threadIdentifier(threadIdentifier)
-            , m_argumentCount(argumentCount)
-        {
-            if (m_argumentCount > MaxArguments) {
-                ASSERT_NOT_REACHED();
-                m_argumentCount = MaxArguments;
-            }
-            for (int i = 0; i < m_argumentCount; ++i) {
-                m_argumentNames[i] = argumentNames[i];
-                m_argumentTypes[i] = argumentTypes[i];
-                m_argumentValues[i] = argumentValues[i];
-            }
-        }
-
-        double timestamp() const { return m_timestamp; }
-        TraceEventPhase phase() const { return m_phase; }
-        const char* name() const { return m_name; }
-        unsigned long long id() const { return m_id; }
-        ThreadIdentifier threadIdentifier() const { return m_threadIdentifier; }
-        int argumentCount() const { return m_argumentCount; }
-        bool isNull() const { return !m_name; }
-
-        bool asBool(const char* name) const
-        {
-            return parameter(name, TypeBool).m_bool;
-        }
-        long long asInt(const char* name) const
-        {
-            size_t index = findParameter(name);
-            if (index == notFound || (m_argumentTypes[index] != TypeInt && m_argumentTypes[index] != TypeUInt)) {
-                ASSERT_NOT_REACHED();
-                return 0;
-            }
-            return reinterpret_cast<const TraceValueUnion*>(m_argumentValues + index)->m_int;
-        }
-        unsigned long long asUInt(const char* name) const
-        {
-            return asInt(name);
-        }
-        double asDouble(const char* name) const
-        {
-            return parameter(name, TypeDouble).m_double;
-        }
-        const char* asString(const char* name) const
-        {
-            return parameter(name, TypeString).m_string;
-        }
-
-    private:
-        enum { MaxArguments = 2 };
-
-        size_t findParameter(const char*) const;
-        const TraceValueUnion& parameter(const char* name, TraceValueTypes expectedType) const;
-
-        double m_timestamp;
-        TraceEventPhase m_phase;
-        const char* m_name;
-        unsigned long long m_id;
-        ThreadIdentifier m_threadIdentifier;
-        int m_argumentCount;
-        const char* m_argumentNames[MaxArguments];
-        unsigned char m_argumentTypes[MaxArguments];
-        unsigned long long m_argumentValues[MaxArguments];
-    };
-
-    typedef void (TimelineTraceEventProcessor::*TraceEventHandler)(const TraceEvent&);
-
-    TimelineThreadState& threadState(ThreadIdentifier thread)
-    {
-        ThreadStateMap::iterator it = m_threadStates.find(thread);
-        if (it != m_threadStates.end())
-            return it->value;
-        return m_threadStates.add(thread, TimelineThreadState(m_timelineAgent)).iterator->value;
-    }
-
-    void processBackgroundEvents();
-    PassRefPtr<InspectorObject> createRecord(const TraceEvent&, const String& recordType, PassRefPtr<InspectorObject> data = 0);
-
-    void registerHandler(const char* name, TraceEventPhase, TraceEventHandler);
-
-    void onBeginFrame(const TraceEvent&);
-    void onPaintLayerBegin(const TraceEvent&);
-    void onPaintLayerEnd(const TraceEvent&);
-    void onRasterTaskBegin(const TraceEvent&);
-    void onRasterTaskEnd(const TraceEvent&);
-    void onImageDecodeBegin(const TraceEvent&);
-    void onImageDecodeEnd(const TraceEvent&);
-    void onLayerDeleted(const TraceEvent&);
-    void onPaint(const TraceEvent&);
-
-    WeakPtr<InspectorTimelineAgent> m_timelineAgent;
-    TimelineTimeConverter m_timeConverter;
-    InspectorClient* m_inspectorClient;
-    unsigned long long m_pageId;
-
-    typedef HashMap<std::pair<String, int>, TraceEventHandler> HandlersMap;
-    HandlersMap m_handlersByType;
-    Mutex m_backgroundEventsMutex;
-    Vector<TraceEvent> m_backgroundEvents;
-
-    typedef HashMap<ThreadIdentifier, TimelineThreadState> ThreadStateMap;
-    ThreadStateMap m_threadStates;
-
-    HashSet<unsigned long long> m_knownLayers;
-    unsigned long long m_layerId;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INSPECTOR)
-#endif // !defined(TimelineTraceEventProcessor_h)