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

Unified Diff: third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp

Issue 1787973002: Replace blink::WebDiscardableMemory with base::DiscardableMemory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use StringPiece::as_string Created 4 years, 9 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: third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp
diff --git a/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp b/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp
index f187bc604a60237e06b78bed35df5c8fc83bd381..d5b52cd3bd3968ed155c571d66bc0a11763681cc 100644
--- a/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp
+++ b/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp
@@ -34,45 +34,8 @@
#include "device/battery/battery_monitor_impl.h"
#endif
-#include <cstring>
-
namespace blink {
-TestingDiscardableMemory::TestingDiscardableMemory(size_t size) : m_data(size), m_isLocked(true)
-{
-}
-
-TestingDiscardableMemory::~TestingDiscardableMemory()
-{
-}
-
-bool TestingDiscardableMemory::lock()
-{
- ASSERT(!m_isLocked);
- m_isLocked = true;
- return false;
-}
-
-void* TestingDiscardableMemory::data()
-{
- ASSERT(m_isLocked);
- return m_data.data();
-}
-
-void TestingDiscardableMemory::unlock()
-{
- ASSERT(m_isLocked);
- m_isLocked = false;
- // Force eviction to catch clients not correctly checking the return value of lock().
- memset(m_data.data(), 0, m_data.size());
-}
-
-WebMemoryAllocatorDump* TestingDiscardableMemory::createMemoryAllocatorDump(const WebString& name, WebProcessMemoryDump* dump) const
-{
- ASSERT_NOT_REACHED();
- return nullptr;
-}
-
TestingPlatformSupport::TestingPlatformSupport()
: TestingPlatformSupport(TestingPlatformSupport::Config())
{
@@ -91,11 +54,6 @@ TestingPlatformSupport::~TestingPlatformSupport()
Platform::setCurrentPlatformForTesting(m_oldPlatform);
}
-WebDiscardableMemory* TestingPlatformSupport::allocateAndLockDiscardableMemory(size_t bytes)
-{
- return !m_config.hasDiscardableMemorySupport ? 0 : new TestingDiscardableMemory(bytes);
-}
-
WebString TestingPlatformSupport::defaultLocale()
{
return WebString::fromUTF8("en-US");
« no previous file with comments | « third_party/WebKit/Source/platform/testing/TestingPlatformSupport.h ('k') | third_party/WebKit/public/blink_headers.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698