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

Unified Diff: base/memory/discardable_memory_malloc.cc

Issue 651913003: base: Remove non-caching discardable memory implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/memory/discardable_memory_malloc.h ('k') | base/memory/discardable_memory_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/discardable_memory_malloc.cc
diff --git a/base/memory/discardable_memory_malloc.cc b/base/memory/discardable_memory_malloc.cc
deleted file mode 100644
index a72f9112d3901fedcc9505935e2ce214f1768dd7..0000000000000000000000000000000000000000
--- a/base/memory/discardable_memory_malloc.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/memory/discardable_memory_malloc.h"
-
-#include "base/logging.h"
-
-namespace base {
-namespace internal {
-
-DiscardableMemoryMalloc::DiscardableMemoryMalloc(size_t size) : size_(size) {
-}
-
-DiscardableMemoryMalloc::~DiscardableMemoryMalloc() {
-}
-
-bool DiscardableMemoryMalloc::Initialize() {
- return Lock() != DISCARDABLE_MEMORY_LOCK_STATUS_FAILED;
-}
-
-DiscardableMemoryLockStatus DiscardableMemoryMalloc::Lock() {
- DCHECK(!memory_);
-
- memory_.reset(static_cast<uint8*>(malloc(size_)));
- if (!memory_)
- return DISCARDABLE_MEMORY_LOCK_STATUS_FAILED;
-
- return DISCARDABLE_MEMORY_LOCK_STATUS_PURGED;
-}
-
-void DiscardableMemoryMalloc::Unlock() {
- DCHECK(memory_);
- memory_.reset();
-}
-
-void* DiscardableMemoryMalloc::Memory() const {
- DCHECK(memory_);
- return memory_.get();
-}
-
-} // namespace internal
-} // namespace base
« no previous file with comments | « base/memory/discardable_memory_malloc.h ('k') | base/memory/discardable_memory_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698