perfetto_hprof: match iterator API change
This CL matches the typed iterator change made by aosp/1144623
and gets rid of the legacy path within the same CL topic.
No functional change is introduced by this CL.
Bug: 132880619
Test: builds
Change-Id: I0fac64db3b6b87408493b7e1d983c90b99e0060a
diff --git a/perfetto_hprof/perfetto_hprof.cc b/perfetto_hprof/perfetto_hprof.cc
index 6b3e6e4..6728ead 100644
--- a/perfetto_hprof/perfetto_hprof.cc
+++ b/perfetto_hprof/perfetto_hprof.cc
@@ -119,9 +119,8 @@
args.config->java_hprof_config_raw()));
uint64_t self_pid = static_cast<uint64_t>(getpid());
- for (auto it = cfg->pid(); it; ++it) {
- uint64_t pid = it->as_uint64();
- if (pid == self_pid) {
+ for (auto pid_it = cfg->pid(); pid_it; ++pid_it) {
+ if (*pid_it == self_pid) {
enabled_ = true;
return;
}
@@ -149,7 +148,7 @@
PLOG(ERROR) << "failed to normalize cmdline";
}
for (auto it = cfg->process_cmdline(); it; ++it) {
- std::string other = it->as_std_string();
+ std::string other = (*it).ToStdString();
// Append \0 to make this a C string.
other.resize(other.size() + 1);
char* other_ptr = &(other[0]);