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

Unified Diff: webkit/child/webkitplatformsupport_child_impl.cc

Issue 24988003: Refactor DiscardableMemory for the upcoming DiscardableMemoryAllocator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add death unit test + fix Android implementation Created 7 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
Index: webkit/child/webkitplatformsupport_child_impl.cc
diff --git a/webkit/child/webkitplatformsupport_child_impl.cc b/webkit/child/webkitplatformsupport_child_impl.cc
index 1df9a12518946f5e4aa02fd877b45175230a1edc..849dcb7b0a8fb5ba854c02209a63a857fa4f1794 100644
--- a/webkit/child/webkitplatformsupport_child_impl.cc
+++ b/webkit/child/webkitplatformsupport_child_impl.cc
@@ -95,11 +95,7 @@ WebKit::WebDiscardableMemory*
WebKitPlatformSupportChildImpl::allocateAndLockDiscardableMemory(size_t bytes) {
if (!base::DiscardableMemory::Supported())
return NULL;
- scoped_ptr<WebDiscardableMemoryImpl> discardable(
- new WebDiscardableMemoryImpl());
- if (discardable->InitializeAndLock(bytes))
- return discardable.release();
- return NULL;
+ return WebDiscardableMemoryImpl::CreateLockedMemory(bytes).release();
}
// static
« base/memory/discardable_memory_unittest.cc ('K') | « webkit/child/web_discardable_memory_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698