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

Side by Side Diff: components/discardable_memory/service/discardable_shared_memory_manager.h

Issue 2589253002: Remove discardable_memory::DSMM::{Create,Get}Instance() (Closed)
Patch Set: Fix trybot Created 4 years 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
« no previous file with comments | « no previous file | components/discardable_memory/service/discardable_shared_memory_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_DISCARDABLE_MEMORY_SERVICE_DISCARDABLE_SHARED_MEMORY_MANAGER_ H_ 5 #ifndef COMPONENTS_DISCARDABLE_MEMORY_SERVICE_DISCARDABLE_SHARED_MEMORY_MANAGER_ H_
6 #define COMPONENTS_DISCARDABLE_MEMORY_SERVICE_DISCARDABLE_SHARED_MEMORY_MANAGER_ H_ 6 #define COMPONENTS_DISCARDABLE_MEMORY_SERVICE_DISCARDABLE_SHARED_MEMORY_MANAGER_ H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 26 matching lines...) Expand all
37 // IPC. 37 // IPC.
38 // This class is thread-safe and instances can safely be used on any thread. 38 // This class is thread-safe and instances can safely be used on any thread.
39 class DISCARDABLE_MEMORY_EXPORT DiscardableSharedMemoryManager 39 class DISCARDABLE_MEMORY_EXPORT DiscardableSharedMemoryManager
40 : public base::DiscardableMemoryAllocator, 40 : public base::DiscardableMemoryAllocator,
41 public base::trace_event::MemoryDumpProvider, 41 public base::trace_event::MemoryDumpProvider,
42 public base::MemoryCoordinatorClient { 42 public base::MemoryCoordinatorClient {
43 public: 43 public:
44 DiscardableSharedMemoryManager(); 44 DiscardableSharedMemoryManager();
45 ~DiscardableSharedMemoryManager() override; 45 ~DiscardableSharedMemoryManager() override;
46 46
47 // Create a sigleton instance.
48 static DiscardableSharedMemoryManager* CreateInstance();
49
50 // Returns a singleton instance.
51 static DiscardableSharedMemoryManager* GetInstance();
52
53 // Bind the manager to a mojo interface request. 47 // Bind the manager to a mojo interface request.
54 void Bind(mojom::DiscardableSharedMemoryManagerRequest request); 48 void Bind(mojom::DiscardableSharedMemoryManagerRequest request);
55 49
56 // Overridden from base::DiscardableMemoryAllocator: 50 // Overridden from base::DiscardableMemoryAllocator:
57 std::unique_ptr<base::DiscardableMemory> AllocateLockedDiscardableMemory( 51 std::unique_ptr<base::DiscardableMemory> AllocateLockedDiscardableMemory(
58 size_t size) override; 52 size_t size) override;
59 53
60 // Overridden from base::trace_event::MemoryDumpProvider: 54 // Overridden from base::trace_event::MemoryDumpProvider:
61 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, 55 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
62 base::trace_event::ProcessMemoryDump* pmd) override; 56 base::trace_event::ProcessMemoryDump* pmd) override;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 base::Closure enforce_memory_policy_callback_; 145 base::Closure enforce_memory_policy_callback_;
152 bool enforce_memory_policy_pending_; 146 bool enforce_memory_policy_pending_;
153 base::WeakPtrFactory<DiscardableSharedMemoryManager> weak_ptr_factory_; 147 base::WeakPtrFactory<DiscardableSharedMemoryManager> weak_ptr_factory_;
154 148
155 DISALLOW_COPY_AND_ASSIGN(DiscardableSharedMemoryManager); 149 DISALLOW_COPY_AND_ASSIGN(DiscardableSharedMemoryManager);
156 }; 150 };
157 151
158 } // namespace discardable_memory 152 } // namespace discardable_memory
159 153
160 #endif // COMPONENTS_DISCARDABLE_MEMORY_SERVICE_DISCARDABLE_SHARED_MEMORY_MANAG ER_H_ 154 #endif // COMPONENTS_DISCARDABLE_MEMORY_SERVICE_DISCARDABLE_SHARED_MEMORY_MANAG ER_H_
OLDNEW
« no previous file with comments | « no previous file | components/discardable_memory/service/discardable_shared_memory_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698