Index: base/memory/discardable_memory.cc |
diff --git a/base/memory/discardable_memory.cc b/base/memory/discardable_memory.cc |
index 33f9e19cdeee523f7b99a53a8452ef23f0f569f0..ff3140a251e1d5a69baa023e22063a540398cf57 100644 |
--- a/base/memory/discardable_memory.cc |
+++ b/base/memory/discardable_memory.cc |
@@ -16,51 +16,14 @@ DiscardableMemory::DiscardableMemory() |
, fd_(-1) |
#endif // OS_ANDROID |
{ |
- DCHECK(Supported()); |
} |
void* DiscardableMemory::Memory() const { |
- DCHECK(is_locked_); |
+ if (!is_locked_) { |
+ // This is a fatal error, and we must die. |
+ CHECK(false); |
willchan no longer on Chromium
2013/06/25 21:06:50
Weird, why not just do CHECK(is_locked_);?
Ian Vollick
2013/06/26 01:10:13
Done.
|
+ } |
return memory_; |
} |
-// Stub implementations for platforms that don't support discardable memory. |
- |
-#if !defined(OS_ANDROID) && !defined(OS_MACOSX) |
- |
-DiscardableMemory::~DiscardableMemory() { |
- NOTIMPLEMENTED(); |
-} |
- |
-// static |
-bool DiscardableMemory::Supported() { |
- return false; |
-} |
- |
-bool DiscardableMemory::InitializeAndLock(size_t size) { |
- NOTIMPLEMENTED(); |
- return false; |
-} |
- |
-LockDiscardableMemoryStatus DiscardableMemory::Lock() { |
- NOTIMPLEMENTED(); |
- return DISCARDABLE_MEMORY_FAILED; |
-} |
- |
-void DiscardableMemory::Unlock() { |
- NOTIMPLEMENTED(); |
-} |
- |
-// static |
-bool DiscardableMemory::PurgeForTestingSupported() { |
- return false; |
-} |
- |
-// static |
-void DiscardableMemory::PurgeForTesting() { |
- NOTIMPLEMENTED(); |
-} |
- |
-#endif // OS_* |
- |
} // namespace base |