Fix [Memory] Add OnCriticalMemoryPressure overload to v8::Platform.

Fix 29bb707e9b

Compilation on GYP fails due to missing OnCriticalMemoryPressure
overload that accepts size_t parameter. In this case the compiler
complains about hiding virtual function.

This patch reintroduces the missing functions.

Bug: 
Change-Id: I493891f6908987a6f27c669a16f6c3772339333d
Reviewed-on: https://chromium-review.googlesource.com/844077
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Cr-Commit-Position: refs/heads/master@{#50306}
This commit is contained in:
Ivica Bogosavljevic 2017-12-25 15:43:43 +01:00 committed by Commit Bot
parent 538e584ab4
commit 4c490296df
2 changed files with 9 additions and 0 deletions

View File

@ -688,6 +688,10 @@ class TestPlatform : public v8::Platform {
old_platform_->OnCriticalMemoryPressure();
}
bool OnCriticalMemoryPressure(size_t length) override {
return old_platform_->OnCriticalMemoryPressure(length);
}
std::shared_ptr<v8::TaskRunner> GetForegroundTaskRunner(
v8::Isolate* isolate) override {
return old_platform_->GetForegroundTaskRunner(isolate);

View File

@ -41,6 +41,11 @@ class AllocationPlatform : public TestPlatform {
void OnCriticalMemoryPressure() override { oom_callback_called = true; }
bool OnCriticalMemoryPressure(size_t length) override {
oom_callback_called = true;
return true;
}
static AllocationPlatform* current_platform;
bool oom_callback_called = false;
};