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

Unified Diff: chrome/browser/sync/profile_sync_service.h

Issue 1136763004: Add UMA data for memory pressure warning received for sync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service.h
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index 1ad2cb76e87988752835fe9bb76c4cd7d0b29a60..ff2e2b0144422a02b01e490d36619ef6592ac4d6 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -14,6 +14,7 @@
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
#include "base/location.h"
+#include "base/memory/memory_pressure_listener.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
@@ -891,6 +892,13 @@ class ProfileSyncService : public sync_driver::SyncService,
// Tell the sync server that this client has disabled sync.
void RemoveClientFromServer() const;
+ // Called when the system is under memory pressure.
+ void OnMemoryPressure(
+ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
+
+ // Check if previous shutdown is shutdown cleanly.
+ void ReportPreviousSessionMemoryWarningCount();
+
// Factory used to create various dependent objects.
scoped_ptr<ProfileSyncComponentsFactory> factory_;
@@ -1070,6 +1078,9 @@ class ProfileSyncService : public sync_driver::SyncService,
scoped_ptr<browser_sync::SyncStoppedReporter> sync_stopped_reporter_;
+ // Listens for the system being under memory pressure.
+ scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_;
+
base::WeakPtrFactory<ProfileSyncService> weak_factory_;
// We don't use |weak_factory_| for the StartupController because the weak
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698