Chromium Code Reviews| Index: src/heap/memory-reducer.h |
| diff --git a/src/heap/memory-reducer.h b/src/heap/memory-reducer.h |
| index b3272f868c9a49df0303ca50824ae3da674bd4ce..9213613c0762d026a10d39ffe34221151bcafc3a 100644 |
| --- a/src/heap/memory-reducer.h |
| +++ b/src/heap/memory-reducer.h |
| @@ -107,7 +107,10 @@ class MemoryReducer { |
| }; |
| explicit MemoryReducer(Heap* heap) |
| - : heap_(heap), state_(kDone, 0, 0.0, 0.0) {} |
| + : heap_(heap), |
| + state_(kDone, 0, 0.0, 0.0), |
| + js_calls_counter_(0), |
|
Hannes Payer (out of office)
2015/10/28 14:58:08
I am wondering if the js call rate live on the iso
ulan
2015/10/29 12:39:25
I think this is very specific to memory reducer so
|
| + js_calls_sample_time_ms_(0.0) {} |
| // Callbacks. |
| void NotifyMarkCompact(const Event& event); |
| void NotifyContextDisposed(const Event& event); |
| @@ -116,7 +119,7 @@ class MemoryReducer { |
| // the incoming event. |
| static State Step(const State& state, const Event& event); |
| // Posts a timer task that will call NotifyTimer after the given delay. |
| - void ScheduleTimer(double delay_ms); |
| + void ScheduleTimer(double time_ms, double delay_ms); |
| void TearDown(); |
| static const int kLongDelayMs; |
| static const int kShortDelayMs; |
| @@ -145,8 +148,16 @@ class MemoryReducer { |
| static bool WatchdogGC(const State& state, const Event& event); |
| + // Returns the rate of JS calls initiated from the API. |
| + double SampleAndGetJsCallsPerMs(double time_ms); |
| + |
| Heap* heap_; |
| State state_; |
| + unsigned int js_calls_counter_; |
| + double js_calls_sample_time_ms_; |
| + |
| + // Used in cctest. |
| + friend class HeapTester; |
| DISALLOW_COPY_AND_ASSIGN(MemoryReducer); |
| }; |