diff options
author | Andreas Gampe <agampe@google.com> | 2017-01-19 17:23:17 -0800 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2017-01-19 19:35:49 -0800 |
commit | 4886411a81077e893a6e38c56938a252888ddd0e (patch) | |
tree | 62f6effd04ae42206c76510ab64b5000b9c45a96 /runtime/runtime_callbacks.cc | |
parent | 2c19ea93088d7cd187524f49137417279e99096d (diff) | |
download | art-4886411a81077e893a6e38c56938a252888ddd0e.tar.gz art-4886411a81077e893a6e38c56938a252888ddd0e.tar.bz2 art-4886411a81077e893a6e38c56938a252888ddd0e.zip |
ART: Add runtime phase callback
Add callback that describes the current runtime phase, one of
starting, initialized and death. Add test.
Bug: 31684920
Test: m test-art-host-gtest-runtime_callbacks_test
Change-Id: I08ae7c45851572f8b3e446c07f0498f66bb032d3
Diffstat (limited to 'runtime/runtime_callbacks.cc')
-rw-r--r-- | runtime/runtime_callbacks.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/runtime/runtime_callbacks.cc b/runtime/runtime_callbacks.cc index cd38ead2c3..7b15a4f1b5 100644 --- a/runtime/runtime_callbacks.cc +++ b/runtime/runtime_callbacks.cc @@ -87,4 +87,18 @@ void RuntimeCallbacks::SigQuit() { } } +void RuntimeCallbacks::AddRuntimePhaseCallback(RuntimePhaseCallback* cb) { + phase_callbacks_.push_back(cb); +} + +void RuntimeCallbacks::RemoveRuntimePhaseCallback(RuntimePhaseCallback* cb) { + Remove(cb, &phase_callbacks_); +} + +void RuntimeCallbacks::NextRuntimePhase(RuntimePhaseCallback::RuntimePhase phase) { + for (RuntimePhaseCallback* cb : phase_callbacks_) { + cb->NextRuntimePhase(phase); + } +} + } // namespace art |