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

Unified Diff: components/metrics/persistent_system_profile.h

Issue 2918533003: Send metrics with embedded system profiles after system startup. (Closed)
Patch Set: fixed tests on mac Created 3 years, 6 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
Index: components/metrics/persistent_system_profile.h
diff --git a/components/metrics/persistent_system_profile.h b/components/metrics/persistent_system_profile.h
index 30d971f66ae6431728863dd9f1d307a023950c33..1775dde9cd423575fe54adca6347101f30502312 100644
--- a/components/metrics/persistent_system_profile.h
+++ b/components/metrics/persistent_system_profile.h
@@ -30,8 +30,14 @@ class PersistentSystemProfile {
void DeregisterPersistentAllocator(
base::PersistentMemoryAllocator* memory_allocator);
- // Stores a complete system profile.
+ // Stores a complete system profile. Use the version taking the serialized
+ // version if available to avoid multiple serialization actions.
void SetSystemProfile(const std::string& serialized_profile);
+ void SetSystemProfile(const SystemProfileProto& profile);
+
+ // Tests if a persistent memory allocator contains an system profile.
+ static bool HasSystemProfile(
+ const base::PersistentMemoryAllocator& memory_allocator);
// Retrieves the system profile from a persistent memory allocator. Returns
// true if a profile was successfully retrieved.
@@ -65,6 +71,7 @@ class PersistentSystemProfile {
// Read a record from the allocator. Do not mix this with "write" calls;
// it's one or the other.
+ bool HasMoreData() const;
bool Read(RecordType* type, std::string* record) const;
base::PersistentMemoryAllocator* allocator() { return allocator_; }

Powered by Google App Engine
This is Rietveld 408576698