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

Side by Side Diff: base/memory/memory_coordinator_client_registry.h

Issue 2655083003: Add OnPurgeMemory() to MemoryCoordinatorClient (Closed)
Patch Set: comment 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_MEMORY_MEMORY_CLIENT_REGISTRY_H_ 5 #ifndef BASE_MEMORY_MEMORY_CLIENT_REGISTRY_H_
6 #define BASE_MEMORY_MEMORY_CLIENT_REGISTRY_H_ 6 #define BASE_MEMORY_MEMORY_CLIENT_REGISTRY_H_
7 7
8 #include "base/base_export.h" 8 #include "base/base_export.h"
9 #include "base/memory/memory_coordinator_client.h" 9 #include "base/memory/memory_coordinator_client.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 21 matching lines...) Expand all
32 32
33 ~MemoryCoordinatorClientRegistry(); 33 ~MemoryCoordinatorClientRegistry();
34 34
35 // Registers/unregisters a client. Does not take ownership of client. 35 // Registers/unregisters a client. Does not take ownership of client.
36 void Register(MemoryCoordinatorClient* client); 36 void Register(MemoryCoordinatorClient* client);
37 void Unregister(MemoryCoordinatorClient* client); 37 void Unregister(MemoryCoordinatorClient* client);
38 38
39 // Notify clients of a memory state change. 39 // Notify clients of a memory state change.
40 void Notify(MemoryState state); 40 void Notify(MemoryState state);
41 41
42 // Requests purging memory.
43 void PurgeMemory();
44
42 private: 45 private:
43 friend struct DefaultSingletonTraits<MemoryCoordinatorClientRegistry>; 46 friend struct DefaultSingletonTraits<MemoryCoordinatorClientRegistry>;
44 47
45 MemoryCoordinatorClientRegistry(); 48 MemoryCoordinatorClientRegistry();
46 49
47 using ClientList = ObserverListThreadSafe<MemoryCoordinatorClient>; 50 using ClientList = ObserverListThreadSafe<MemoryCoordinatorClient>;
48 scoped_refptr<ClientList> clients_; 51 scoped_refptr<ClientList> clients_;
49 }; 52 };
50 53
51 } // namespace base 54 } // namespace base
52 55
53 #endif // BASE_MEMORY_MEMORY_CLIENT_REGISTRY_H_ 56 #endif // BASE_MEMORY_MEMORY_CLIENT_REGISTRY_H_
OLDNEW
« no previous file with comments | « base/memory/memory_coordinator_client.h ('k') | base/memory/memory_coordinator_client_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698