Chromium Code Reviews| Index: components/discardable_memory/common/discardable_shared_memory_manager.h |
| diff --git a/content/common/host_discardable_shared_memory_manager.h b/components/discardable_memory/common/discardable_shared_memory_manager.h |
| similarity index 86% |
| rename from content/common/host_discardable_shared_memory_manager.h |
| rename to components/discardable_memory/common/discardable_shared_memory_manager.h |
| index 59a939a0297718df1f44cc4455fd68a962016a4d..a55534667174bd331dccd067bfafea8882033f4e 100644 |
| --- a/content/common/host_discardable_shared_memory_manager.h |
| +++ b/components/discardable_memory/common/discardable_shared_memory_manager.h |
| @@ -2,8 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CONTENT_COMMON_HOST_DISCARDABLE_SHARED_MEMORY_MANAGER_H_ |
| -#define CONTENT_COMMON_HOST_DISCARDABLE_SHARED_MEMORY_MANAGER_H_ |
| +#ifndef COMPONENTS_DISCARDABLE_MEMORY_COMMON_HOST_DISCARDABLE_SHARED_MEMORY_MANAGER_H_ |
| +#define COMPONENTS_DISCARDABLE_MEMORY_COMMON_HOST_DISCARDABLE_SHARED_MEMORY_MANAGER_H_ |
| #include <stddef.h> |
| #include <stdint.h> |
| @@ -26,24 +26,24 @@ |
| #include "base/synchronization/lock.h" |
| #include "base/threading/thread_task_runner_handle.h" |
| #include "base/trace_event/memory_dump_provider.h" |
| -#include "content/common/content_export.h" |
| +#include "components/discardable_memory/common/discardable_memory_export.h" |
| -namespace content { |
| +namespace discardable_memory { |
| typedef int32_t DiscardableSharedMemoryId; |
| // Implementation of DiscardableMemoryAllocator that allocates and manages |
| // discardable memory segments for the browser process and child processes. |
|
reveman
2016/10/31 22:46:02
Can you update this comment to make sense in more
Peng
2016/11/01 14:26:18
Done.
|
| // This class is thread-safe and instances can safely be used on any thread. |
| -class CONTENT_EXPORT HostDiscardableSharedMemoryManager |
| +class DISCARDABLE_MEMORY_EXPORT DiscardableSharedMemoryManager |
|
reveman
2016/10/31 22:46:02
what's the reason 'Host' was removed from the name
Peng
2016/11/01 14:26:18
I just think the term Host is more like old chromi
reveman
2016/11/01 14:48:45
Sgtm. Should we change the name of child manager t
Peng
2016/11/01 16:00:23
Done.
|
| : public base::DiscardableMemoryAllocator, |
| public base::trace_event::MemoryDumpProvider, |
| public base::MemoryCoordinatorClient { |
| public: |
| - HostDiscardableSharedMemoryManager(); |
| - ~HostDiscardableSharedMemoryManager() override; |
| + DiscardableSharedMemoryManager(); |
| + ~DiscardableSharedMemoryManager() override; |
| // Returns a singleton instance. |
| - static HostDiscardableSharedMemoryManager* current(); |
| + static DiscardableSharedMemoryManager* current(); |
| // Overridden from base::DiscardableMemoryAllocator: |
| std::unique_ptr<base::DiscardableMemory> AllocateLockedDiscardableMemory( |
| @@ -129,7 +129,8 @@ class CONTENT_EXPORT HostDiscardableSharedMemoryManager |
| base::Lock lock_; |
| typedef base::hash_map<DiscardableSharedMemoryId, |
| - scoped_refptr<MemorySegment>> MemorySegmentMap; |
| + scoped_refptr<MemorySegment>> |
| + MemorySegmentMap; |
| typedef base::hash_map<int, MemorySegmentMap> ProcessMap; |
| ProcessMap processes_; |
| // Note: The elements in |segments_| are arranged in such a way that they form |
| @@ -144,11 +145,11 @@ class CONTENT_EXPORT HostDiscardableSharedMemoryManager |
| enforce_memory_policy_task_runner_; |
| base::Closure enforce_memory_policy_callback_; |
| bool enforce_memory_policy_pending_; |
| - base::WeakPtrFactory<HostDiscardableSharedMemoryManager> weak_ptr_factory_; |
| + base::WeakPtrFactory<DiscardableSharedMemoryManager> weak_ptr_factory_; |
| - DISALLOW_COPY_AND_ASSIGN(HostDiscardableSharedMemoryManager); |
| + DISALLOW_COPY_AND_ASSIGN(DiscardableSharedMemoryManager); |
| }; |
| -} // namespace content |
| +} // namespace discardable_memory |
| -#endif // CONTENT_COMMON_HOST_DISCARDABLE_SHARED_MEMORY_MANAGER_H_ |
| +#endif // COMPONENTS_DISCARDABLE_MEMORY_COMMON_HOST_DISCARDABLE_SHARED_MEMORY_MANAGER_H_ |