| Index: third_party/WebKit/Source/platform/wtf/allocator/Partitions.cpp
|
| diff --git a/third_party/WebKit/Source/platform/wtf/allocator/Partitions.cpp b/third_party/WebKit/Source/platform/wtf/allocator/Partitions.cpp
|
| index b96cc6e8a005290b0454c61cd11a3dd12e4bb188..3dae2e353d87f3e947ac64635c981cf2924010cf 100644
|
| --- a/third_party/WebKit/Source/platform/wtf/allocator/Partitions.cpp
|
| +++ b/third_party/WebKit/Source/platform/wtf/allocator/Partitions.cpp
|
| @@ -117,6 +117,36 @@ void Partitions::DumpMemoryStats(
|
| partition_stats_dumper);
|
| }
|
|
|
| +namespace {
|
| +
|
| +class LightPartitionStatsDumperImpl : public WTF::PartitionStatsDumper {
|
| + public:
|
| + LightPartitionStatsDumperImpl() : total_active_bytes_(0) {}
|
| +
|
| + void PartitionDumpTotals(
|
| + const char* partition_name,
|
| + const WTF::PartitionMemoryStats* memory_stats) override {
|
| + total_active_bytes_ += memory_stats->total_active_bytes;
|
| + }
|
| +
|
| + void PartitionsDumpBucketStats(
|
| + const char* partition_name,
|
| + const WTF::PartitionBucketMemoryStats*) override {}
|
| +
|
| + size_t TotalActiveBytes() const { return total_active_bytes_; }
|
| +
|
| + private:
|
| + size_t total_active_bytes_;
|
| +};
|
| +
|
| +} // namespace
|
| +
|
| +size_t Partitions::TotalActiveBytes() {
|
| + LightPartitionStatsDumperImpl dumper;
|
| + WTF::Partitions::DumpMemoryStats(true, &dumper);
|
| + return dumper.TotalActiveBytes();
|
| +}
|
| +
|
| static NEVER_INLINE void PartitionsOutOfMemoryUsing2G() {
|
| size_t signature = 2UL * 1024 * 1024 * 1024;
|
| base::debug::Alias(&signature);
|
|
|