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

Unified Diff: third_party/WebKit/Source/platform/MemoryCoordinator.h

Issue 2475293003: [RemotePlayback] No monitoring on low-end devices (Closed)
Patch Set: Moved to Platform::initialize() Created 4 years, 1 month 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: third_party/WebKit/Source/platform/MemoryCoordinator.h
diff --git a/third_party/WebKit/Source/platform/MemoryCoordinator.h b/third_party/WebKit/Source/platform/MemoryCoordinator.h
index c5d7579ee18f6c33994ae162d0f7fa58e52d47dd..bb2ab3fa3c758757875fe409c239372aaaaec73e 100644
--- a/third_party/WebKit/Source/platform/MemoryCoordinator.h
+++ b/third_party/WebKit/Source/platform/MemoryCoordinator.h
@@ -32,8 +32,16 @@ class PLATFORM_EXPORT MemoryCoordinator final
public:
static MemoryCoordinator& instance();
+
+ // Whether the device Blink runs on is a low-end device.
+ // Can be overridden in layout tests via internals.
static bool isLowEndDevice();
+ // Caches whether this device is a low-end device in a static member.
+ // instance() is not used as it's a heap allocated object - meaning it's not
+ // thread-safe as well as might break tests counting the heap size.
+ static void initialize();
+
void registerClient(MemoryCoordinatorClient*);
void unregisterClient(MemoryCoordinatorClient*);
@@ -46,10 +54,16 @@ class PLATFORM_EXPORT MemoryCoordinator final
DECLARE_TRACE();
private:
+ friend class Internals;
+
+ static void setIsLowEndDeviceForTesting(bool);
+
MemoryCoordinator();
void clearMemory();
+ static bool s_isLowEndDevice;
+
HeapHashSet<WeakMember<MemoryCoordinatorClient>> m_clients;
};

Powered by Google App Engine
This is Rietveld 408576698