Files
ark_js_runtime/ecmascript/tooling/interface/stream.h
T
Riachel 557c07bb07 Descriptor: support heapprofiler domain
details:
1. add statsUpdate event
2. add lastObjectId event
issue: https://gitee.com/openharmony/ark_js_runtime/issues/I5AUJA

Signed-off-by: Riachel <caolili14@huawei.com>
2022-06-07 11:29:50 +08:00

48 lines
1.4 KiB
C++

/*
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ECMASCRIPT_TOOLING_INTERFACE_STREAM_H
#define ECMASCRIPT_TOOLING_INTERFACE_STREAM_H
namespace panda::ecmascript {
class HeapStat {
public:
HeapStat(uint32_t index, uint32_t count, uint32_t size)
: index_(index), count_(count), size_(size) {}
uint32_t index_;
uint32_t count_;
uint32_t size_;
};
class Stream {
public:
virtual ~Stream() = default;
virtual void EndOfStream() = 0;
// Get chunk's size
virtual int GetSize() = 0;
// Writes the chunk of data into the stream
virtual bool WriteChunk(char *data, int size) = 0;
virtual bool Good() = 0;
virtual void UpdateHeapStats(HeapStat* data, int count) = 0;
virtual void UpdateLastSeenObjectId(uint32_t lastSeenObjectId) = 0;
};
} // namespace panda::ecmascript
#endif // ECMASCRIPT_TOOLING_INTERFACE_STREAM_H