Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4145)

Unified Diff: base/debug/activity_tracker.h

Issue 2695813011: Updates for improved PMA 'object' interface. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/activity_tracker.h
diff --git a/base/debug/activity_tracker.h b/base/debug/activity_tracker.h
index 9ffcfaa844ba22ee9edee16dcade2481f5a4f011..114e2daeda65f633cd550d6d224610a148dbd14d 100644
--- a/base/debug/activity_tracker.h
+++ b/base/debug/activity_tracker.h
@@ -61,6 +61,11 @@ enum : int {
// sized types to ensure no interoperability problems between 32-bit and
// 64-bit systems.
union ActivityData {
+ // SHA1(base::debug::ActivityData): Increment this if structure changes!
+ static constexpr uint32_t kPersistentTypeId = 0x72DC176D + 1;
+ // Expected size for 32/64-bit check. Update this if structure changes!
+ static constexpr size_t kExpectedInstanceSize = 8;
manzagop (departed) 2017/02/17 15:50:55 static_assert for this? Same below.
bcwhite 2017/02/17 15:52:11 These sizes are asserted by the PMA when using the
+
// Generic activities don't have any defined structure.
struct {
uint32_t id; // An arbitrary identifier used for association.
@@ -162,7 +167,7 @@ class BASE_EXPORT ActivityTrackerMemoryAllocator {
// Helper function to access an object allocated using this instance.
template <typename T>
T* GetAsObject(Reference ref) {
- return allocator_->GetAsObject<T>(ref, object_type_);
+ return allocator_->GetAsObject<T>(ref);
}
// Similar to GetAsObject() but converts references to arrays of objects.
@@ -198,6 +203,12 @@ class BASE_EXPORT ActivityTrackerMemoryAllocator {
// the |data| field. All fields must be explicitly sized types to ensure no
// interoperability problems between 32-bit and 64-bit systems.
struct Activity {
+ // SHA1(base::debug::Activity): Increment this if structure changes!
+ static constexpr uint32_t kPersistentTypeId = 0x99425159 + 1;
+ // Expected size for 32/64-bit check. Update this if structure changes!
+ static constexpr size_t kExpectedInstanceSize =
+ 48 + ActivityData::kExpectedInstanceSize;
+
// The type of an activity on the stack. Activities are broken into
// categories with the category ID taking the top 4 bits and the lower
// bits representing an action within that category. This combination
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698