Ensure that on Windows 7, relaunching the browser via chrome://restart or changing...
[chromium-blink-merge.git] / base / memory / discardable_memory_malloc.h
blob7729ce5c49b9e9c38bb1bc88e51fc279d81e564f
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
3 // found in the LICENSE file.
5 #ifndef BASE_MEMORY_DISCARDABLE_MEMORY_MALLOC_H_
6 #define BASE_MEMORY_DISCARDABLE_MEMORY_MALLOC_H_
8 #include "base/memory/discardable_memory.h"
10 namespace base {
11 namespace internal {
13 class DiscardableMemoryMalloc : public DiscardableMemory {
14 public:
15 explicit DiscardableMemoryMalloc(size_t size);
16 virtual ~DiscardableMemoryMalloc();
18 bool Initialize();
20 // Overridden from DiscardableMemory:
21 virtual DiscardableMemoryLockStatus Lock() OVERRIDE;
22 virtual void Unlock() OVERRIDE;
23 virtual void* Memory() const OVERRIDE;
25 private:
26 scoped_ptr<uint8, FreeDeleter> memory_;
27 const size_t size_;
29 DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryMalloc);
32 } // namespace internal
33 } // namespace base
35 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_MALLOC_H_