Index: src/profile-generator.cc |
diff --git a/src/profile-generator.cc b/src/profile-generator.cc |
index 8316079a8d09ab427056e15e6ac7d04696182fae..1d1aa812bc09e32ab00fe37f4086250ca1dc055d 100644 |
--- a/src/profile-generator.cc |
+++ b/src/profile-generator.cc |
@@ -542,13 +542,6 @@ CpuProfile* CpuProfilesCollection::StopProfiling(int security_token_id, |
} |
-CpuProfile* CpuProfilesCollection::StopProfiling(int security_token_id, |
- String* title, |
- double actual_sampling_rate) { |
- return StopProfiling(security_token_id, GetName(title), actual_sampling_rate); |
-} |
- |
- |
CpuProfile* CpuProfilesCollection::GetProfile(int security_token_id, |
unsigned uid) { |
HashMap::Entry* entry = profiles_uids_.Lookup(reinterpret_cast<void*>(uid), |
@@ -574,6 +567,15 @@ CpuProfile* CpuProfilesCollection::GetProfile(int security_token_id, |
} |
+bool CpuProfilesCollection::IsLastProfile(const char* title) { |
+ // Called from VM thread, and only it can mutate the list, |
+ // so no locking is needed here. |
+ if (current_profiles_.length() != 1) return false; |
+ return StrLength(title) == 0 |
+ || strcmp(current_profiles_[0]->title(), title) == 0; |
+} |
+ |
+ |
int CpuProfilesCollection::TokenToIndex(int security_token_id) { |
ASSERT(TokenEnumerator::kNoSecurityToken == -1); |
return security_token_id + 1; // kNoSecurityToken -> 0, 0 -> 1, ... |