Commit df5263b0 authored by Florian Sattler's avatar Florian Sattler Committed by Commit Bot

[cleanup] Mark test/ methods in subclasses with override.

Fixing clang-tidy warning.

Bug: v8:8015
Change-Id: I6bd8e0c8c1965f22a3429fda12bc70ae454c39c2
Reviewed-on: https://chromium-review.googlesource.com/1226978Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Florian Sattler <sattlerf@google.com>
Cr-Commit-Position: refs/heads/master@{#55930}
parent 8e7e8459
......@@ -193,7 +193,7 @@ class ApiTestFuzzer: public v8::base::Thread {
void CallTest();
// The ApiTestFuzzer is also a Thread, so it has a Run method.
virtual void Run();
void Run() override;
enum PartOfTest {
FIRST_PART,
......@@ -220,7 +220,7 @@ class ApiTestFuzzer: public v8::base::Thread {
test_number_(num),
gate_(0),
active_(true) {}
~ApiTestFuzzer() = default;
~ApiTestFuzzer() override = default;
static bool fuzzing_;
static int tests_being_run_;
......@@ -600,9 +600,9 @@ class StaticOneByteResource : public v8::String::ExternalOneByteStringResource {
~StaticOneByteResource() = default;
const char* data() const { return data_; }
const char* data() const override { return data_; }
size_t length() const { return strlen(data_); }
size_t length() const override { return strlen(data_); }
private:
const char* data_;
......@@ -710,7 +710,7 @@ class TestPlatform : public v8::Platform {
protected:
TestPlatform() : old_platform_(i::V8::GetCurrentPlatform()) {}
~TestPlatform() { i::V8::SetPlatformForTesting(old_platform_); }
~TestPlatform() override { i::V8::SetPlatformForTesting(old_platform_); }
v8::Platform* old_platform() const { return old_platform_; }
......
......@@ -40,7 +40,7 @@ class ChunkSource : public v8::ScriptCompiler::ExternalSourceStream {
}
chunks_.push_back({nullptr, 0});
}
~ChunkSource() = default;
~ChunkSource() override = default;
bool SetBookmark() override { return false; }
void ResetToBookmark() override {}
size_t GetMoreData(const uint8_t** src) override {
......
......@@ -36,8 +36,8 @@ namespace internal {
class PrintExtension : public v8::Extension {
public:
PrintExtension() : v8::Extension("v8/print", "native function print();") { }
virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate, v8::Local<v8::String> name);
v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate, v8::Local<v8::String> name) override;
static void Print(const v8::FunctionCallbackInfo<v8::Value>& args);
};
......
......@@ -41,8 +41,8 @@ class ProfilerExtension : public v8::Extension {
public:
ProfilerExtension() : v8::Extension("v8/profiler", kSource) { }
virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate, v8::Local<v8::String> name);
v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate, v8::Local<v8::String> name) override;
static void set_profiler(v8::CpuProfiler* profiler) { profiler_ = profiler; }
static void set_profiler(CpuProfiler* profiler) {
......
......@@ -14,7 +14,7 @@ class SetupIsolateDelegateForTests : public SetupIsolateDelegate {
public:
explicit SetupIsolateDelegateForTests(bool create_heap_objects)
: SetupIsolateDelegate(create_heap_objects) {}
virtual ~SetupIsolateDelegateForTests() = default;
~SetupIsolateDelegateForTests() override = default;
void SetupBuiltins(Isolate* isolate) override;
......
......@@ -37,7 +37,7 @@ class AllocationPlatform : public TestPlatform {
// Now that it's completely constructed, make this the current platform.
i::V8::SetPlatformForTesting(this);
}
virtual ~AllocationPlatform() = default;
~AllocationPlatform() override = default;
void OnCriticalMemoryPressure() override { oom_callback_called = true; }
......
This diff is collapsed.
......@@ -113,7 +113,7 @@ class ProducerThread: public v8::base::Thread {
value_(value),
finished_(finished) {}
virtual void Run() {
void Run() override {
for (Record i = value_; i < value_ + records_per_chunk_; ++i) {
Record* rec = reinterpret_cast<Record*>(scq_->StartEnqueue());
CHECK(rec);
......
......@@ -44,7 +44,7 @@ class DateCacheMock: public DateCache {
: local_offset_(local_offset), rules_(rules), rules_count_(rules_count) {}
protected:
virtual int GetDaylightSavingsOffsetFromOS(int64_t time_sec) {
int GetDaylightSavingsOffsetFromOS(int64_t time_sec) override {
int days = DaysFromTime(time_sec * 1000);
int time_in_day_sec = TimeInDay(time_sec * 1000, days) / 1000;
int year, month, day;
......@@ -53,7 +53,7 @@ class DateCacheMock: public DateCache {
return rule == nullptr ? 0 : rule->offset_sec * 1000;
}
virtual int GetLocalOffsetFromOS(int64_t time_sec, bool is_utc) {
int GetLocalOffsetFromOS(int64_t time_sec, bool is_utc) override {
return local_offset_ + GetDaylightSavingsOffsetFromOS(time_sec);
}
......
......@@ -189,8 +189,9 @@ int break_point_hit_count = 0;
int break_point_hit_count_deoptimize = 0;
class DebugEventCounter : public v8::debug::DebugDelegate {
public:
void BreakProgramRequested(v8::Local<v8::Context>,
const std::vector<v8::debug::BreakpointId>&) {
void BreakProgramRequested(
v8::Local<v8::Context>,
const std::vector<v8::debug::BreakpointId>&) override {
break_point_hit_count++;
// Perform a full deoptimization when the specified number of
// breaks have been hit.
......@@ -211,8 +212,9 @@ class DebugEventCounter : public v8::debug::DebugDelegate {
// Debug event handler which performs a garbage collection.
class DebugEventBreakPointCollectGarbage : public v8::debug::DebugDelegate {
public:
void BreakProgramRequested(v8::Local<v8::Context>,
const std::vector<v8::debug::BreakpointId>&) {
void BreakProgramRequested(
v8::Local<v8::Context>,
const std::vector<v8::debug::BreakpointId>&) override {
// Perform a garbage collection when break point is hit and continue. Based
// on the number of break points hit either scavenge or mark compact
// collector is used.
......@@ -231,8 +233,9 @@ class DebugEventBreakPointCollectGarbage : public v8::debug::DebugDelegate {
// collector to have the heap verified.
class DebugEventBreak : public v8::debug::DebugDelegate {
public:
void BreakProgramRequested(v8::Local<v8::Context>,
const std::vector<v8::debug::BreakpointId>&) {
void BreakProgramRequested(
v8::Local<v8::Context>,
const std::vector<v8::debug::BreakpointId>&) override {
// Count the number of breaks.
break_point_hit_count++;
......@@ -255,8 +258,9 @@ int max_break_point_hit_count = 0;
bool terminate_after_max_break_point_hit = false;
class DebugEventBreakMax : public v8::debug::DebugDelegate {
public:
void BreakProgramRequested(v8::Local<v8::Context>,
const std::vector<v8::debug::BreakpointId>&) {
void BreakProgramRequested(
v8::Local<v8::Context>,
const std::vector<v8::debug::BreakpointId>&) override {
v8::Isolate* v8_isolate = CcTest::isolate();
v8::internal::Isolate* isolate = CcTest::i_isolate();
if (break_point_hit_count < max_break_point_hit_count) {
......@@ -2999,9 +3003,9 @@ int event_listener_hit_count = 0;
class EmptyExternalStringResource : public v8::String::ExternalStringResource {
public:
EmptyExternalStringResource() { empty_[0] = 0; }
virtual ~EmptyExternalStringResource() {}
virtual size_t length() const { return empty_.length(); }
virtual const uint16_t* data() const { return empty_.start(); }
~EmptyExternalStringResource() override {}
size_t length() const override { return empty_.length(); }
const uint16_t* data() const override { return empty_.start(); }
private:
::v8::internal::EmbeddedVector<uint16_t, 1> empty_;
......@@ -3677,7 +3681,7 @@ class TerminationThread : public v8::base::Thread {
explicit TerminationThread(v8::Isolate* isolate)
: Thread(Options("terminator")), isolate_(isolate) {}
virtual void Run() {
void Run() override {
terminate_requested_semaphore.Wait();
isolate_->TerminateExecution();
terminate_fired_semaphore.Signal();
......@@ -3712,7 +3716,7 @@ class ArchiveRestoreThread : public v8::base::Thread,
spawn_count_(spawn_count),
break_count_(0) {}
virtual void Run() {
void Run() override {
v8::Locker locker(isolate_);
isolate_->Enter();
......@@ -3743,8 +3747,9 @@ class ArchiveRestoreThread : public v8::base::Thread,
isolate_->Exit();
}
void BreakProgramRequested(v8::Local<v8::Context> context,
const std::vector<v8::debug::BreakpointId>&) {
void BreakProgramRequested(
v8::Local<v8::Context> context,
const std::vector<v8::debug::BreakpointId>&) override {
auto stack_traces = v8::debug::StackTraceIterator::Create(isolate_);
if (!stack_traces->Done()) {
v8::debug::Location location = stack_traces->GetSourceLocation();
......
......@@ -254,7 +254,7 @@ TEST(Unknown) {
class AbsentPropertyContext: public DeclarationContext {
protected:
virtual v8::Local<Integer> Query(Local<Name> key) {
v8::Local<Integer> Query(Local<Name> key) override {
return v8::Local<Integer>();
}
};
......@@ -304,7 +304,7 @@ class AppearingPropertyContext: public DeclarationContext {
AppearingPropertyContext() : state_(DECLARE) { }
protected:
virtual v8::Local<Integer> Query(Local<Name> key) {
v8::Local<Integer> Query(Local<Name> key) override {
switch (state_) {
case DECLARE:
// Force declaration by returning that the
......@@ -359,13 +359,13 @@ class ExistsInPrototypeContext: public DeclarationContext {
public:
ExistsInPrototypeContext() { InitializeIfNeeded(); }
protected:
virtual v8::Local<Integer> Query(Local<Name> key) {
v8::Local<Integer> Query(Local<Name> key) override {
// Let it seem that the property exists in the prototype object.
return Integer::New(isolate(), v8::None);
}
// Use the prototype as the holder for the interceptors.
virtual Local<ObjectTemplate> GetHolder(Local<FunctionTemplate> function) {
Local<ObjectTemplate> GetHolder(Local<FunctionTemplate> function) override {
return function->PrototypeTemplate();
}
};
......@@ -402,13 +402,13 @@ TEST(ExistsInPrototype) {
class AbsentInPrototypeContext: public DeclarationContext {
protected:
virtual v8::Local<Integer> Query(Local<Name> key) {
v8::Local<Integer> Query(Local<Name> key) override {
// Let it seem that the property is absent in the prototype object.
return Local<Integer>();
}
// Use the prototype as the holder for the interceptors.
virtual Local<ObjectTemplate> GetHolder(Local<FunctionTemplate> function) {
Local<ObjectTemplate> GetHolder(Local<FunctionTemplate> function) override {
return function->PrototypeTemplate();
}
};
......@@ -437,13 +437,13 @@ class ExistsInHiddenPrototypeContext: public DeclarationContext {
}
protected:
virtual v8::Local<Integer> Query(Local<Name> key) {
v8::Local<Integer> Query(Local<Name> key) override {
// Let it seem that the property exists in the hidden prototype object.
return Integer::New(isolate(), v8::None);
}
// Install the hidden prototype after the global object has been created.
virtual void PostInitializeContext(Local<Context> context) {
void PostInitializeContext(Local<Context> context) override {
Local<Object> global_object = context->Global();
Local<Object> hidden_proto = hidden_proto_->GetFunction(context)
.ToLocalChecked()
......@@ -455,7 +455,7 @@ class ExistsInHiddenPrototypeContext: public DeclarationContext {
}
// Use the hidden prototype as the holder for the interceptors.
virtual Local<ObjectTemplate> GetHolder(Local<FunctionTemplate> function) {
Local<ObjectTemplate> GetHolder(Local<FunctionTemplate> function) override {
return hidden_proto_->InstanceTemplate();
}
......
......@@ -1025,9 +1025,9 @@ class TestJSONStream : public v8::OutputStream {
TestJSONStream() : eos_signaled_(0), abort_countdown_(-1) {}
explicit TestJSONStream(int abort_countdown)
: eos_signaled_(0), abort_countdown_(abort_countdown) {}
virtual ~TestJSONStream() = default;
virtual void EndOfStream() { ++eos_signaled_; }
virtual WriteResult WriteAsciiChunk(char* buffer, int chars_written) {
~TestJSONStream() override = default;
void EndOfStream() override { ++eos_signaled_; }
WriteResult WriteAsciiChunk(char* buffer, int chars_written) override {
if (abort_countdown_ > 0) --abort_countdown_;
if (abort_countdown_ == 0) return kAbort;
CHECK_GT(chars_written, 0);
......@@ -1053,8 +1053,9 @@ class OneByteResource : public v8::String::ExternalOneByteStringResource {
explicit OneByteResource(i::Vector<char> string) : data_(string.start()) {
length_ = string.length();
}
virtual const char* data() const { return data_; }
virtual size_t length() const { return length_; }
const char* data() const override { return data_; }
size_t length() const override { return length_; }
private:
const char* data_;
size_t length_;
......@@ -1217,13 +1218,13 @@ class TestStatsStream : public v8::OutputStream {
TestStatsStream(const TestStatsStream& stream)
= default;
virtual ~TestStatsStream() = default;
virtual void EndOfStream() { ++eos_signaled_; }
virtual WriteResult WriteAsciiChunk(char* buffer, int chars_written) {
~TestStatsStream() override = default;
void EndOfStream() override { ++eos_signaled_; }
WriteResult WriteAsciiChunk(char* buffer, int chars_written) override {
UNREACHABLE();
}
virtual WriteResult WriteHeapStatsChunk(v8::HeapStatsUpdate* buffer,
int updates_written) {
WriteResult WriteHeapStatsChunk(v8::HeapStatsUpdate* buffer,
int updates_written) override {
++intervals_count_;
CHECK(updates_written);
updates_written_ += updates_written;
......@@ -1528,7 +1529,7 @@ class TestActivityControl : public v8::ActivityControl {
total_(0),
abort_count_(abort_count),
reported_finish_(false) {}
ControlOption ReportProgressValue(int done, int total) {
ControlOption ReportProgressValue(int done, int total) override {
done_ = done;
total_ = total;
CHECK_LE(done_, total_);
......@@ -1605,7 +1606,7 @@ class EmbedderGraphBuilder : public v8::PersistentHandleVisitor {
public:
explicit Group(const char* name) : Node(name, 0) {}
// v8::EmbedderGraph::EmbedderNode
bool IsRootNode() { return true; }
bool IsRootNode() override { return true; }
};
EmbedderGraphBuilder(v8::Isolate* isolate, v8::EmbedderGraph* graph)
......@@ -1779,7 +1780,7 @@ TEST(DeleteHeapSnapshot) {
class NameResolver : public v8::HeapProfiler::ObjectNameResolver {
public:
virtual const char* GetName(v8::Local<v8::Object> object) {
const char* GetName(v8::Local<v8::Object> object) override {
return "Global object name";
}
};
......@@ -3057,7 +3058,7 @@ class EmbedderRootNode : public EmbedderNode {
public:
explicit EmbedderRootNode(const char* name) : EmbedderNode(name, 0) {}
// Graph::Node override.
bool IsRootNode() { return true; }
bool IsRootNode() override { return true; }
};
// Used to pass the global object to the BuildEmbedderGraph callback.
......
......@@ -51,7 +51,7 @@ class DeoptimizeCodeThread : public v8::base::Thread {
context_(isolate, context),
source_(trigger) {}
void Run() {
void Run() override {
v8::Locker locker(isolate_);
isolate_->Enter();
v8::HandleScope handle_scope(isolate_);
......@@ -290,7 +290,7 @@ class KangarooThread : public v8::base::Thread {
isolate_(isolate),
context_(isolate, context) {}
void Run() {
void Run() override {
{
v8::Locker locker(isolate_);
v8::Isolate::Scope isolate_scope(isolate_);
......@@ -382,7 +382,7 @@ class JoinableThread {
: Thread(Options(joinable_thread->name_)),
joinable_thread_(joinable_thread) {}
virtual void Run() {
void Run() override {
joinable_thread_->Run();
joinable_thread_->semaphore_.Signal();
}
......@@ -408,7 +408,7 @@ class IsolateLockingThreadWithLocalContext : public JoinableThread {
isolate_(isolate) {
}
virtual void Run() {
void Run() override {
v8::Locker locker(isolate_);
v8::Isolate::Scope isolate_scope(isolate_);
v8::HandleScope handle_scope(isolate_);
......@@ -460,7 +460,7 @@ class IsolateNestedLockingThread : public JoinableThread {
explicit IsolateNestedLockingThread(v8::Isolate* isolate)
: JoinableThread("IsolateNestedLocking"), isolate_(isolate) {
}
virtual void Run() {
void Run() override {
v8::Locker lock(isolate_);
v8::Isolate::Scope isolate_scope(isolate_);
v8::HandleScope handle_scope(isolate_);
......@@ -508,7 +508,7 @@ class SeparateIsolatesLocksNonexclusiveThread : public JoinableThread {
isolate1_(isolate1), isolate2_(isolate2) {
}
virtual void Run() {
void Run() override {
v8::Locker lock(isolate1_);
v8::Isolate::Scope isolate_scope(isolate1_);
v8::HandleScope handle_scope(isolate1_);
......@@ -556,7 +556,7 @@ class LockIsolateAndCalculateFibSharedContextThread : public JoinableThread {
isolate_(isolate),
context_(isolate, context) {}
virtual void Run() {
void Run() override {
v8::Locker lock(isolate_);
v8::Isolate::Scope isolate_scope(isolate_);
v8::HandleScope handle_scope(isolate_);
......@@ -577,7 +577,7 @@ class LockerUnlockerThread : public JoinableThread {
isolate_(isolate) {
}
virtual void Run() {
void Run() override {
isolate_->DiscardThreadSpecificMetadata(); // No-op
{
v8::Locker lock(isolate_);
......@@ -637,7 +637,7 @@ class LockTwiceAndUnlockThread : public JoinableThread {
isolate_(isolate) {
}
virtual void Run() {
void Run() override {
v8::Locker lock(isolate_);
v8::Isolate::Scope isolate_scope(isolate_);
v8::HandleScope handle_scope(isolate_);
......@@ -697,7 +697,7 @@ class LockAndUnlockDifferentIsolatesThread : public JoinableThread {
isolate2_(isolate2) {
}
virtual void Run() {
void Run() override {
std::unique_ptr<LockIsolateAndCalculateFibSharedContextThread> thread;
v8::Locker lock1(isolate1_);
CHECK(v8::Locker::IsLocked(isolate1_));
......@@ -760,7 +760,7 @@ class LockUnlockLockThread : public JoinableThread {
isolate_(isolate),
context_(isolate, context) {}
virtual void Run() {
void Run() override {
v8::Locker lock1(isolate_);
CHECK(v8::Locker::IsLocked(isolate_));
CHECK(!v8::Locker::IsLocked(CcTest::isolate()));
......@@ -827,7 +827,7 @@ class LockUnlockLockDefaultIsolateThread : public JoinableThread {
: JoinableThread("LockUnlockLockDefaultIsolateThread"),
context_(CcTest::isolate(), context) {}
virtual void Run() {
void Run() override {
v8::Locker lock1(CcTest::isolate());
{
v8::Isolate::Scope isolate_scope(CcTest::isolate());
......@@ -914,7 +914,7 @@ class IsolateGenesisThread : public JoinableThread {
extension_names_(extension_names)
{}
virtual void Run() {
void Run() override {
v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
v8::Isolate* isolate = v8::Isolate::New(create_params);
......
......@@ -263,9 +263,9 @@ class SimpleExternalString : public v8::String::ExternalStringResource {
for (int i = 0; i < utf_source_.length(); ++i)
utf_source_[i] = source[i];
}
virtual ~SimpleExternalString() = default;
virtual size_t length() const { return utf_source_.length(); }
virtual const uint16_t* data() const { return utf_source_.start(); }
~SimpleExternalString() override = default;
size_t length() const override { return utf_source_.length(); }
const uint16_t* data() const override { return utf_source_.start(); }
private:
i::ScopedVector<uint16_t> utf_source_;
};
......
......@@ -573,8 +573,8 @@ class ScriptResource : public v8::String::ExternalOneByteStringResource {
ScriptResource(const char* data, size_t length)
: data_(data), length_(length) { }
const char* data() const { return data_; }
size_t length() const { return length_; }
const char* data() const override { return data_; }
size_t length() const override { return length_; }
private:
const char* data_;
......
......@@ -1821,9 +1821,9 @@ class SerializerOneByteResource
public:
SerializerOneByteResource(const char* data, size_t length)
: data_(data), length_(length), dispose_count_(0) {}
virtual const char* data() const { return data_; }
virtual size_t length() const { return length_; }
virtual void Dispose() { dispose_count_++; }
const char* data() const override { return data_; }
size_t length() const override { return length_; }
void Dispose() override { dispose_count_++; }
int dispose_count() { return dispose_count_; }
private:
......@@ -1837,11 +1837,11 @@ class SerializerTwoByteResource : public v8::String::ExternalStringResource {
public:
SerializerTwoByteResource(const char* data, size_t length)
: data_(AsciiToTwoByteString(data)), length_(length), dispose_count_(0) {}
~SerializerTwoByteResource() { DeleteArray<const uint16_t>(data_); }
~SerializerTwoByteResource() override { DeleteArray<const uint16_t>(data_); }
virtual const uint16_t* data() const { return data_; }
virtual size_t length() const { return length_; }
virtual void Dispose() { dispose_count_++; }
const uint16_t* data() const override { return data_; }
size_t length() const override { return length_; }
void Dispose() override { dispose_count_++; }
int dispose_count() { return dispose_count_; }
private:
......
......@@ -105,9 +105,9 @@ static const int SUPER_DEEP_DEPTH = 80 * 1024;
class Resource: public v8::String::ExternalStringResource {
public:
Resource(const uc16* data, size_t length): data_(data), length_(length) {}
~Resource() { i::DeleteArray(data_); }
virtual const uint16_t* data() const { return data_; }
virtual size_t length() const { return length_; }
~Resource() override { i::DeleteArray(data_); }
const uint16_t* data() const override { return data_; }
size_t length() const override { return length_; }
private:
const uc16* data_;
......@@ -119,9 +119,9 @@ class OneByteResource : public v8::String::ExternalOneByteStringResource {
public:
OneByteResource(const char* data, size_t length)
: data_(data), length_(length) {}
~OneByteResource() { i::DeleteArray(data_); }
virtual const char* data() const { return data_; }
virtual size_t length() const { return length_; }
~OneByteResource() override { i::DeleteArray(data_); }
const char* data() const override { return data_; }
size_t length() const override { return length_; }
private:
const char* data_;
......@@ -1186,9 +1186,9 @@ class OneByteVectorResource : public v8::String::ExternalOneByteStringResource {
public:
explicit OneByteVectorResource(i::Vector<const char> vector)
: data_(vector) {}
virtual ~OneByteVectorResource() = default;
virtual size_t length() const { return data_.length(); }
virtual const char* data() const { return data_.start(); }
~OneByteVectorResource() override = default;
size_t length() const override { return data_.length(); }
const char* data() const override { return data_.start(); }
private:
i::Vector<const char> data_;
};
......@@ -1464,15 +1464,15 @@ TEST(Latin1IgnoreCase) {
class DummyResource: public v8::String::ExternalStringResource {
public:
virtual const uint16_t* data() const { return nullptr; }
virtual size_t length() const { return 1 << 30; }
const uint16_t* data() const override { return nullptr; }
size_t length() const override { return 1 << 30; }
};
class DummyOneByteResource: public v8::String::ExternalOneByteStringResource {
public:
virtual const char* data() const { return nullptr; }
virtual size_t length() const { return 1 << 30; }
const char* data() const override { return nullptr; }
size_t length() const override { return 1 << 30; }
};
......
......@@ -166,7 +166,7 @@ class TerminatorThread : public v8::base::Thread {
explicit TerminatorThread(i::Isolate* isolate)
: Thread(Options("TerminatorThread")),
isolate_(reinterpret_cast<v8::Isolate*>(isolate)) {}
void Run() {
void Run() override {
semaphore->Wait();
CHECK(!isolate_->IsExecutionTerminating());
isolate_->TerminateExecution();
......@@ -800,7 +800,7 @@ class TerminatorSleeperThread : public v8::base::Thread {
: Thread(Options("TerminatorSlepperThread")),
isolate_(isolate),
sleep_ms_(sleep_ms) {}
void Run() {
void Run() override {
v8::base::OS::Sleep(v8::base::TimeDelta::FromMilliseconds(sleep_ms_));
CHECK(!isolate_->IsExecutionTerminating());
isolate_->TerminateExecution();
......
......@@ -43,7 +43,7 @@ class ThreadIdValidationThread : public v8::base::Thread {
thread_to_start_(thread_to_start),
semaphore_(semaphore) {}
void Run() {
void Run() override {
i::ThreadId thread_id = i::ThreadId::Current();
for (int i = 0; i < thread_no_; i++) {
CHECK(!(*refs_)[i].Equals(thread_id));
......
......@@ -39,7 +39,7 @@ typedef std::vector<MockTraceObject*> MockTraceObjectList;
class MockTracingController : public v8::TracingController {
public:
MockTracingController() = default;
~MockTracingController() {
~MockTracingController() override {
for (size_t i = 0; i < trace_object_list_.size(); ++i) {
delete trace_object_list_[i];
}
......@@ -98,7 +98,7 @@ class MockTracingPlatform : public TestPlatform {
// Now that it's completely constructed, make this the current platform.
i::V8::SetPlatformForTesting(this);
}
virtual ~MockTracingPlatform() = default;
~MockTracingPlatform() override = default;
v8::TracingController* GetTracingController() override {
return &tracing_controller_;
......
......@@ -38,8 +38,8 @@ namespace internal {
class TraceExtension : public v8::Extension {
public:
TraceExtension() : v8::Extension("v8/trace", kSource) { }
virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate, v8::Local<v8::String> name);
v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
v8::Isolate* isolate, v8::Local<v8::String> name) override;
static void Trace(const v8::FunctionCallbackInfo<v8::Value>& args);
static void JSTrace(const v8::FunctionCallbackInfo<v8::Value>& args);
static void JSEntrySP(const v8::FunctionCallbackInfo<v8::Value>& args);
......
......@@ -40,7 +40,7 @@ class MemoryAllocationPermissionsTest : public ::testing::Test {
#endif
protected:
virtual void SetUp() {
void SetUp() override {
struct sigaction action;
action.sa_sigaction = SignalHandler;
sigemptyset(&action.sa_mask);
......@@ -51,7 +51,7 @@ class MemoryAllocationPermissionsTest : public ::testing::Test {
#endif
}
virtual void TearDown() {
void TearDown() override {
// Be a good citizen and restore the old signal handler.
sigaction(SIGSEGV, &old_action_, nullptr);
#if V8_OS_MACOSX
......
......@@ -44,7 +44,7 @@ class FunctionalTest : public ::testing::Test {
public:
FunctionalTest()
: rng_(GetRandomSeedFromFlag(::v8::internal::FLAG_random_seed)) {}
virtual ~FunctionalTest() = default;
~FunctionalTest() override = default;
RandomNumberGenerator* rng() { return &rng_; }
......
......@@ -30,7 +30,7 @@ class ThreadLocalStorageTest : public Thread, public ::testing::Test {
keys_[i] = Thread::CreateThreadLocalKey();
}
}
~ThreadLocalStorageTest() {
~ThreadLocalStorageTest() override {
for (size_t i = 0; i < arraysize(keys_); ++i) {
Thread::DeleteThreadLocalKey(keys_[i]);
}
......
......@@ -71,7 +71,7 @@ class ThreadedRunner final : public base::Thread {
explicit ThreadedRunner(TestTask* task)
: Thread(Options("runner thread")), task_(task) {}
virtual void Run() {
void Run() override {
task_->Run();
delete task_;
}
......
......@@ -34,7 +34,7 @@ class MockHistogram : public Histogram {
class AggregatedMemoryHistogramTest : public ::testing::Test {
public:
AggregatedMemoryHistogramTest() : aggregated_(&mock_) {}
virtual ~AggregatedMemoryHistogramTest() = default;
~AggregatedMemoryHistogramTest() override = default;
void AddSample(double current_ms, double current_value) {
aggregated_.AddSample(current_ms, current_value);
......@@ -66,7 +66,7 @@ class RuntimeCallStatsTest : public TestWithNativeContext {
stats()->Reset();
}
~RuntimeCallStatsTest() {
~RuntimeCallStatsTest() override {
// Disable RuntimeCallStats before tearing down the isolate to prevent
// printing the tests table. Comment the following line for debugging
// purposes.
......
......@@ -15,7 +15,7 @@ const MachineRepresentation kSimd128 = MachineRepresentation::kSimd128;
class RegisterConfigurationUnitTest : public ::testing::Test {
public:
RegisterConfigurationUnitTest() = default;
virtual ~RegisterConfigurationUnitTest() = default;
~RegisterConfigurationUnitTest() override = default;
};
TEST_F(RegisterConfigurationUnitTest, BasicProperties) {
......
......@@ -26,7 +26,7 @@ class ArrayBufferAllocator;
class TestWithIsolate : public virtual ::testing::Test {
public:
TestWithIsolate();
virtual ~TestWithIsolate();
~TestWithIsolate() override;
v8::Isolate* isolate() const { return v8_isolate(); }
......@@ -55,7 +55,7 @@ class TestWithIsolate : public virtual ::testing::Test {
class TestWithContext : public virtual v8::TestWithIsolate {
public:
TestWithContext();
virtual ~TestWithContext();
~TestWithContext() override;
const Local<Context>& context() const { return v8_context(); }
const Local<Context>& v8_context() const { return context_; }
......@@ -79,7 +79,7 @@ class Factory;
class TestWithIsolate : public virtual ::v8::TestWithIsolate {
public:
TestWithIsolate() = default;
virtual ~TestWithIsolate();
~TestWithIsolate() override;
Factory* factory() const;
Isolate* isolate() const { return i_isolate(); }
......@@ -97,7 +97,7 @@ class TestWithIsolate : public virtual ::v8::TestWithIsolate {
class TestWithZone : public virtual ::testing::Test {
public:
TestWithZone() : zone_(&allocator_, ZONE_NAME) {}
virtual ~TestWithZone();
~TestWithZone() override;
Zone* zone() { return &zone_; }
......@@ -111,7 +111,7 @@ class TestWithZone : public virtual ::testing::Test {
class TestWithIsolateAndZone : public virtual TestWithIsolate {
public:
TestWithIsolateAndZone() : zone_(&allocator_, ZONE_NAME) {}
virtual ~TestWithIsolateAndZone();
~TestWithIsolateAndZone() override;
Zone* zone() { return &zone_; }
......@@ -126,7 +126,7 @@ class TestWithNativeContext : public virtual ::v8::TestWithContext,
public virtual TestWithIsolate {
public:
TestWithNativeContext() = default;
virtual ~TestWithNativeContext();
~TestWithNativeContext() override;
Handle<Context> native_context() const;
......
......@@ -58,7 +58,7 @@ class ValueSerializerTest : public TestWithIsolate {
isolate_ = reinterpret_cast<i::Isolate*>(isolate());
}
~ValueSerializerTest() {
~ValueSerializerTest() override {
// In some cases unhandled scheduled exceptions from current test produce
// that Context::New(isolate()) from next test's constructor returns NULL.
// In order to prevent that, we added destructor which will clear scheduled
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment