| Index: chrome/browser/memory_details.h
|
| diff --git a/chrome/browser/memory_details.h b/chrome/browser/memory_details.h
|
| index 568f591328a4af632411c6d058119e1e8db94596..422a09bc07e7fd88ee885bbcfb48b60ce9c39a92 100644
|
| --- a/chrome/browser/memory_details.h
|
| +++ b/chrome/browser/memory_details.h
|
| @@ -107,6 +107,11 @@ class ProcessInfoSnapshot;
|
| // }
|
| class MemoryDetails : public base::RefCountedThreadSafe<MemoryDetails> {
|
| public:
|
| + enum UserMetricsMode {
|
| + UPDATE_USER_METRICS, // Update UMA memory histograms with results.
|
| + SKIP_USER_METRICS
|
| + };
|
| +
|
| // Constructor.
|
| MemoryDetails();
|
|
|
| @@ -116,10 +121,15 @@ class MemoryDetails : public base::RefCountedThreadSafe<MemoryDetails> {
|
|
|
| // Initiate updating the current memory details. These are fetched
|
| // asynchronously because data must be collected from multiple threads.
|
| + // Updates UMA memory histograms if |mode| is UPDATE_USER_METRICS.
|
| // OnDetailsAvailable will be called when this process is complete.
|
| - void StartFetch();
|
| + void StartFetch(UserMetricsMode user_metrics_mode);
|
|
|
| - virtual void OnDetailsAvailable() {}
|
| + virtual void OnDetailsAvailable() = 0;
|
| +
|
| + // Returns a string summarizing memory usage of the Chrome browser process
|
| + // and all sub-processes, suitable for logging.
|
| + std::string ToLogString();
|
|
|
| protected:
|
| friend class base::RefCountedThreadSafe<MemoryDetails>;
|
| @@ -156,8 +166,7 @@ class MemoryDetails : public base::RefCountedThreadSafe<MemoryDetails> {
|
| // renderer processes is only available there.
|
| void CollectChildInfoOnUIThread();
|
|
|
| - // Each time we take a memory sample, we do a little work to update
|
| - // the global histograms for tracking memory usage.
|
| + // Updates the global histograms for tracking memory usage.
|
| void UpdateHistograms();
|
|
|
| // Returns a pointer to the ProcessData structure for Chrome.
|
| @@ -165,6 +174,8 @@ class MemoryDetails : public base::RefCountedThreadSafe<MemoryDetails> {
|
|
|
| std::vector<ProcessData> process_data_;
|
|
|
| + UserMetricsMode user_metrics_mode_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(MemoryDetails);
|
| };
|
|
|
|
|