diff --git a/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.cpp index c5efa99e513a0..1c1d178ed3852 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.cpp @@ -53,18 +53,6 @@ class InspectorHeapProfilerAgent::HeapStatsUpdateTask final { Timer m_timer; }; -class InspectorHeapProfilerAgent::HeapXDKUpdateTask final { -public: - explicit HeapXDKUpdateTask(V8HeapProfilerAgent*); - void startTimer(float sav); - void resetTimer() { m_timer.stop(); } - void onTimer(Timer*); - -private: - V8HeapProfilerAgent* m_heapProfilerAgent; - Timer m_timer; -}; - InspectorHeapProfilerAgent::HeapStatsUpdateTask::HeapStatsUpdateTask(V8HeapProfilerAgent* heapProfilerAgent) : m_heapProfilerAgent(heapProfilerAgent) , m_timer(this, &HeapStatsUpdateTask::onTimer) @@ -243,46 +231,4 @@ void InspectorHeapProfilerAgent::stopSampling(ErrorString* errorString, OwnPtr

stopSampling(errorString, profile); } -InspectorHeapProfilerAgent::HeapXDKUpdateTask::HeapXDKUpdateTask(V8HeapProfilerAgent* heapProfilerAgent) - : m_heapProfilerAgent(heapProfilerAgent) - , m_timer(this, &HeapXDKUpdateTask::onTimer) -{ -} - -void InspectorHeapProfilerAgent::HeapXDKUpdateTask::onTimer(Timer*) -{ - // The timer is stopped on m_heapProfilerAgent destruction, - // so this method will never be called after m_heapProfilerAgent has been destroyed. - m_heapProfilerAgent->requestHeapXDKUpdate(); -} - -void InspectorHeapProfilerAgent::HeapXDKUpdateTask::startTimer(float sav) -{ - ASSERT(!m_timer.isActive()); - m_timer.startRepeating(sav, BLINK_FROM_HERE); -} - -void InspectorHeapProfilerAgent::startTrackingHeapXDK(ErrorString* error, const protocol::Maybe& depth, const protocol::Maybe& sav, const protocol::Maybe& retentions) -{ - if (m_heapXDKUpdateTask) - return; - - m_v8HeapProfilerAgent->startTrackingHeapXDK(error, depth, sav, retentions); - float savTimer = (float) sav.fromMaybe(1000) / 1000.; - m_heapXDKUpdateTask = adoptPtr(new HeapXDKUpdateTask(m_v8HeapProfilerAgent)); - m_heapXDKUpdateTask->startTimer(savTimer); -} - -void InspectorHeapProfilerAgent::stopTrackingHeapXDK(ErrorString* error, OwnPtr* profile) -{ - if (!m_heapXDKUpdateTask) { - *error = "Heap object tracking is not started."; - return; - } - - m_v8HeapProfilerAgent->stopTrackingHeapXDK(error, profile); - m_heapXDKUpdateTask->resetTimer(); - m_heapXDKUpdateTask.clear(); -} - } // namespace blink diff --git a/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.h b/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.h index 5a4748c84f6a5..6c553827d087f 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.h +++ b/third_party/WebKit/Source/core/inspector/InspectorHeapProfilerAgent.h @@ -37,7 +37,6 @@ #include "wtf/Noncopyable.h" #include "wtf/OwnPtr.h" #include "wtf/PassOwnPtr.h" -#include namespace v8 { class Isolate; @@ -70,13 +69,9 @@ class CORE_EXPORT InspectorHeapProfilerAgent final : public InspectorBaseAgent*) override; - void startTrackingHeapXDK(ErrorString*, const Maybe& stack_depth, const Maybe& sav, const Maybe& retentions) override; - void stopTrackingHeapXDK(ErrorString*, OwnPtr*) override; private: class HeapStatsUpdateTask; - class HeapXDKStream; - class HeapXDKUpdateTask; InspectorHeapProfilerAgent(v8::Isolate*, V8HeapProfilerAgent*); @@ -86,7 +81,6 @@ class CORE_EXPORT InspectorHeapProfilerAgent final : public InspectorBaseAgent m_heapStatsUpdateTask; - OwnPtr m_heapXDKUpdateTask; v8::Isolate* m_isolate; }; diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/HeapProfilerModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/HeapProfilerModel.js index 5e54ffeb5f4d1..8b689694e95f0 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/HeapProfilerModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/HeapProfilerModel.js @@ -16,8 +16,7 @@ WebInspector.HeapProfilerModel.Events = { LastSeenObjectId: "LastSeenObjectId", AddHeapSnapshotChunk: "AddHeapSnapshotChunk", ReportHeapSnapshotProgress: "ReportHeapSnapshotProgress", - ResetProfiles: "ResetProfiles", - HeapXDKUpdate: "HeapXDKUpdate" + ResetProfiles: "ResetProfiles" } WebInspector.HeapProfilerModel.prototype = { @@ -71,14 +70,6 @@ WebInspector.HeapProfilerModel.prototype = { this.dispatchEventToListeners(WebInspector.HeapProfilerModel.Events.ResetProfiles); }, - /** - * @param {string} message - */ - heapXDKUpdate: function (message) - { - this.dispatchEventToListeners(WebInspector.HeapProfilerModel.Events.HeapXDKUpdate, message); - }, - __proto__: WebInspector.SDKModel.prototype } @@ -138,14 +129,5 @@ WebInspector.HeapProfilerDispatcher.prototype = { resetProfiles: function() { this._heapProfilerModel.resetProfiles(); - }, - - /** - * @override - * @param {string} message - */ - heapXDKUpdate: function(message) - { - this._heapProfilerModel.heapXDKUpdate(message); } } \ No newline at end of file diff --git a/third_party/WebKit/Source/devtools/protocol.json b/third_party/WebKit/Source/devtools/protocol.json index b0e6e0fc72562..211e420f162c1 100644 --- a/third_party/WebKit/Source/devtools/protocol.json +++ b/third_party/WebKit/Source/devtools/protocol.json @@ -3886,7 +3886,6 @@ { "name": "columnNumber", "type": "integer", "description": "1-based column number of the function start position." }, { "name": "hitCount", "type": "integer", "description": "Number of samples where this node was on top of the call stack." }, { "name": "callUID", "type": "number", "description": "Call UID." }, - { "name": "stackEntryLine", "type": "integer", "description": "Hit line for entry in stack." }, { "name": "children", "type": "array", "items": { "$ref": "CPUProfileNode" }, "description": "Child nodes." }, { "name": "deoptReason", "type": "string", "description": "The reason of being not optimized. The function may be deoptimized or marked as don't optimize."}, { "name": "id", "type": "integer", "description": "Unique id of the node." }, @@ -3991,19 +3990,6 @@ "properties": [ { "name": "head", "$ref": "SamplingHeapProfileNode" } ] - }, - { - "id": "HeapEventXDK", - "type": "object", - "description": "", - "properties": [ - { "name": "duration", "type": "integer" }, - { "name": "symbols", "type": "string" }, - { "name": "frames", "type": "string" }, - { "name": "types", "type": "string" }, - { "name": "chunks", "type": "string" }, - { "name": "retentions", "type": "string" } - ] } ], "commands": [ @@ -4026,20 +4012,6 @@ ] }, - { - "name": "startTrackingHeapXDK", - "parameters": [ - { "name": "stack_depth", "type": "integer", "optional": true }, - { "name": "sav", "type": "integer", "optional": true }, - { "name": "retentions", "type": "boolean", "optional": true } - ] - }, - { - "name": "stopTrackingHeapXDK", - "returns": [ - { "name": "profileXDK", "$ref": "HeapEventXDK", "description": "Recorded profile." } - ] - }, { "name": "takeHeapSnapshot", "parameters": [ @@ -4117,16 +4089,6 @@ "parameters": [ { "name": "statsUpdate", "type": "array", "items": { "type": "integer" }, "description": "An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment."} ] - }, - { - "name": "heapXDKUpdate", - "parameters": [ - { "name": "symbols", "type": "string" }, - { "name": "frames", "type": "string" }, - { "name": "types", "type": "string" }, - { "name": "chunks", "type": "string" }, - { "name": "retentions", "type": "string" } - ] } ] }, diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp index cd12d6ea5e2be..58440f7d18cc5 100644 --- a/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp +++ b/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.cpp @@ -362,113 +362,4 @@ void V8HeapProfilerAgentImpl::stopSampling(ErrorString* errorString, OwnPtrheapXDKUpdate(String(symbols, symbolsSize), String(frames, framesSize), String(types, typesSize), String(chunks, chunksSize), String(retentions, retentionSize)); - return kContinue; - } - -private: - protocol::Frontend::HeapProfiler* m_frontend; -}; - -static PassOwnPtr createHeapProfileXDK(const HeapProfileXDK& heapProfileXDK) -{ - OwnPtr profile = protocol::HeapProfiler::HeapEventXDK::create() - .setDuration(heapProfileXDK.getDuration()) - .setSymbols(heapProfileXDK.getSymbols()) - .setFrames(heapProfileXDK.getFrames()) - .setTypes(heapProfileXDK.getTypes()) - .setChunks(heapProfileXDK.getChunks()) - .setRetentions(heapProfileXDK.getRetentions()).build(); - return profile.release(); -} - -void V8HeapProfilerAgentImpl::startTrackingHeapXDK(ErrorString* error, const protocol::Maybe& depth, const protocol::Maybe& sav, const protocol::Maybe& retentions) -{ - v8::HeapProfiler* profiler = m_isolate->GetHeapProfiler(); - if (!profiler) { - *error = "Cannot access v8 heap profiler"; - return; - } - - m_state->setBoolean(HeapProfilerAgentState::heapObjectsTrackingEnabled, true); - int stackDepth = depth.fromMaybe(8); - bool needRetentions = retentions.fromMaybe(false); - profiler->StartTrackingHeapObjectsXDK(stackDepth, needRetentions); -} - -void V8HeapProfilerAgentImpl::stopTrackingHeapXDK(ErrorString* error, OwnPtr* profile) -{ - v8::HeapProfiler* profiler = m_isolate->GetHeapProfiler(); - if (!profiler) { - *error = "Cannot access v8 heap profiler"; - return; - } - - OwnPtr heapProfileXDK = HeapProfileXDK::create( - profiler->StopTrackingHeapObjectsXDK(), m_isolate); - *profile = createHeapProfileXDK(*heapProfileXDK); - m_state->setBoolean(HeapProfilerAgentState::heapObjectsTrackingEnabled, false); -} - -void V8HeapProfilerAgentImpl::requestHeapXDKUpdate() -{ - if (!m_frontend) - return; - HeapXDKStream heapXDKStream(m_frontend); - m_isolate->GetHeapProfiler()->GetHeapXDKStats( - &heapXDKStream); -} - -String HeapProfileXDK::getSymbols() const -{ - v8::HandleScope handleScope(m_isolate); - return String(m_event->getSymbols()); -} - -String HeapProfileXDK::getFrames() const -{ - v8::HandleScope handleScope(m_isolate); - return String(m_event->getFrames()); -} - -String HeapProfileXDK::getTypes() const -{ - v8::HandleScope handleScope(m_isolate); - return String(m_event->getTypes()); -} - -String HeapProfileXDK::getChunks() const -{ - v8::HandleScope handleScope(m_isolate); - return String(m_event->getChunks()); -} - -int HeapProfileXDK::getDuration() const -{ - return (int)m_event->getDuration(); -} - -String HeapProfileXDK::getRetentions() const -{ - v8::HandleScope handleScope(m_isolate); - return String(m_event->getRetentions()); -} - } // namespace blink diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.h b/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.h index 371f81c820bf5..86a4976158ed9 100644 --- a/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.h +++ b/third_party/WebKit/Source/platform/v8_inspector/V8HeapProfilerAgentImpl.h @@ -7,7 +7,6 @@ #include "platform/inspector_protocol/Allocator.h" #include "platform/v8_inspector/public/V8HeapProfilerAgent.h" -#include namespace blink { @@ -15,31 +14,6 @@ class V8InspectorSessionImpl; using protocol::Maybe; -class HeapProfileXDK final { -public: - static PassOwnPtr create(v8::HeapEventXDK* event, v8::Isolate* isolate) - { - return adoptPtr(new HeapProfileXDK(event, isolate)); - } - - String getSymbols() const; - String getFrames() const; - String getTypes() const; - String getChunks() const; - String getRetentions() const; - int getDuration() const; - -private: - HeapProfileXDK(v8::HeapEventXDK* event, v8::Isolate* isolate) - : m_event(event), - m_isolate(isolate) - { - } - - v8::HeapEventXDK* m_event; - v8::Isolate* m_isolate; -}; - class V8HeapProfilerAgentImpl : public V8HeapProfilerAgent { PROTOCOL_DISALLOW_COPY(V8HeapProfilerAgentImpl); public: @@ -65,14 +39,10 @@ class V8HeapProfilerAgentImpl : public V8HeapProfilerAgent { void addInspectedHeapObject(ErrorString*, const String16& inspectedHeapObjectId) override; void getHeapObjectId(ErrorString*, const String16& objectId, String16* heapSnapshotObjectId) override; - void startTrackingHeapXDK(ErrorString*, const Maybe& depth, const Maybe& sav, const Maybe& retentions) override; - void stopTrackingHeapXDK(ErrorString*, OwnPtr*) override; - void startSampling(ErrorString*) override; void stopSampling(ErrorString*, OwnPtr*) override; void requestHeapStatsUpdate() override; - void requestHeapXDKUpdate() override; private: void startTrackingHeapObjectsInternal(bool trackAllocations); diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8ProfilerAgentImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8ProfilerAgentImpl.cpp index b4041200fbe49..c1604f8fb8a85 100644 --- a/third_party/WebKit/Source/platform/v8_inspector/V8ProfilerAgentImpl.cpp +++ b/third_party/WebKit/Source/platform/v8_inspector/V8ProfilerAgentImpl.cpp @@ -61,7 +61,6 @@ PassOwnPtr buildInspectorObjectFor(v8::Isola .setColumnNumber(node->GetColumnNumber()) .setHitCount(node->GetHitCount()) .setCallUID(node->GetCallUid()) - .setStackEntryLine(node->GetSrcLine()) .setChildren(children.release()) .setPositionTicks(positionTicks.release()) .setDeoptReason(node->GetBailoutReason()) diff --git a/third_party/WebKit/Source/platform/v8_inspector/public/V8HeapProfilerAgent.h b/third_party/WebKit/Source/platform/v8_inspector/public/V8HeapProfilerAgent.h index 3b2fa91d1fcf2..523e0489675ba 100644 --- a/third_party/WebKit/Source/platform/v8_inspector/public/V8HeapProfilerAgent.h +++ b/third_party/WebKit/Source/platform/v8_inspector/public/V8HeapProfilerAgent.h @@ -18,7 +18,6 @@ class PLATFORM_EXPORT V8HeapProfilerAgent : public protocol::Backend::HeapProfil virtual ~V8HeapProfilerAgent() { } virtual void requestHeapStatsUpdate() = 0; - virtual void requestHeapXDKUpdate() = 0; }; } // namespace blink