Shaka Player Embedded
v8_heap_tracer.h
Go to the documentation of this file.
1 // Copyright 2016 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef SHAKA_EMBEDDED_MEMORY_V8_HEAP_TRACER_H_
16 #define SHAKA_EMBEDDED_MEMORY_V8_HEAP_TRACER_H_
17 
18 #include <unordered_set>
19 #include <utility>
20 #include <vector>
21 
22 #include "src/memory/heap_tracer.h"
23 
24 namespace shaka {
25 namespace memory {
26 
61 class V8HeapTracer : public v8::EmbedderHeapTracer, public HeapTracer {
62  public:
63  V8HeapTracer();
64  ~V8HeapTracer() override;
65 
66 
68  bool IsTracingDone() override;
69 
71  void TracePrologue(TraceFlags flags) override;
72 
74  void TraceEpilogue(TraceSummary* trace_summary) override;
75 
80  void EnterFinalPause(EmbedderStackState stack_state) override;
81 
88  const std::vector<std::pair<void*, void*>>& internal_fields) override;
89 
95  bool AdvanceTracing(double deadline_ms) override;
96 
97  private:
98  std::unordered_set<const Traceable*> fields_;
99 };
100 
101 } // namespace memory
102 } // namespace shaka
103 
104 #endif // SHAKA_EMBEDDED_MEMORY_V8_HEAP_TRACER_H_
bool AdvanceTracing(double deadline_ms) override
void TracePrologue(TraceFlags flags) override
void TraceEpilogue(TraceSummary *trace_summary) override
void EnterFinalPause(EmbedderStackState stack_state) override
void RegisterV8References(const std::vector< std::pair< void *, void *>> &internal_fields) override