Add some missing virtual destructors to base classes.

I started by adding virtual destructors to the following
classes:

    base::FileTracing::Provider
    base::internal::PostTaskAndReplyImpl
    base::PostTaskAndReplyWorkerPool
    base::TraceLog::EnabledStateObserver

But then that triggered a bunch of other errors in
downstream classes that are missing 'override', so I'm
updating those too.

BUG=none

Review URL: https://codereview.chromium.org/1223393002

Cr-Commit-Position: refs/heads/master@{#338509}


CrOS-Libchrome-Original-Commit: 99c5d9fb18a5f8dd987605e25859631fa0492dc1
diff --git a/base/files/file_tracing.h b/base/files/file_tracing.h
index 92324c9..d37c21d 100644
--- a/base/files/file_tracing.h
+++ b/base/files/file_tracing.h
@@ -30,6 +30,8 @@
 
   class Provider {
    public:
+    virtual ~Provider() = default;
+
     // Whether the file tracing category is currently enabled.
     virtual bool FileTracingCategoryIsEnabled() const = 0;
 
diff --git a/base/threading/post_task_and_reply_impl.h b/base/threading/post_task_and_reply_impl.h
index a5b9580..d21ab78 100644
--- a/base/threading/post_task_and_reply_impl.h
+++ b/base/threading/post_task_and_reply_impl.h
@@ -25,6 +25,8 @@
 // may want base::WorkerPool.
 class PostTaskAndReplyImpl {
  public:
+  virtual ~PostTaskAndReplyImpl() = default;
+
   // Implementation for TaskRunner::PostTaskAndReply and
   // WorkerPool::PostTaskAndReply.
   bool PostTaskAndReply(const tracked_objects::Location& from_here,
diff --git a/base/threading/worker_pool.cc b/base/threading/worker_pool.cc
index bc016ce..71b1a2b 100644
--- a/base/threading/worker_pool.cc
+++ b/base/threading/worker_pool.cc
@@ -21,6 +21,7 @@
   explicit PostTaskAndReplyWorkerPool(bool task_is_slow)
       : task_is_slow_(task_is_slow) {
   }
+  ~PostTaskAndReplyWorkerPool() override = default;
 
  private:
   bool PostTask(const tracked_objects::Location& from_here,
diff --git a/base/trace_event/memory_dump_manager.h b/base/trace_event/memory_dump_manager.h
index 92c5cb8..f9ece6e 100644
--- a/base/trace_event/memory_dump_manager.h
+++ b/base/trace_event/memory_dump_manager.h
@@ -161,7 +161,7 @@
   static const int kMaxConsecutiveFailuresCount;
 
   MemoryDumpManager();
-  virtual ~MemoryDumpManager();
+  ~MemoryDumpManager() override;
 
   static void SetInstanceForTesting(MemoryDumpManager* instance);
   static void FinalizeDumpAndAddToTrace(
diff --git a/base/trace_event/trace_event_impl.h b/base/trace_event/trace_event_impl.h
index ccb8500..108ae8b 100644
--- a/base/trace_event/trace_event_impl.h
+++ b/base/trace_event/trace_event_impl.h
@@ -367,6 +367,8 @@
   // on-demand.
   class BASE_EXPORT EnabledStateObserver {
    public:
+    virtual ~EnabledStateObserver() = default;
+
     // Called just after the tracing system becomes enabled, outside of the
     // |lock_|. TraceLog::IsEnabled() is true at this point.
     virtual void OnTraceLogEnabled() = 0;
diff --git a/base/trace_event/trace_event_memory.h b/base/trace_event/trace_event_memory.h
index e2b3ae9..5b63db0 100644
--- a/base/trace_event/trace_event_memory.h
+++ b/base/trace_event/trace_event_memory.h
@@ -43,7 +43,7 @@
                         HeapProfilerStartFunction heap_profiler_start_function,
                         HeapProfilerStopFunction heap_profiler_stop_function,
                         GetHeapProfileFunction get_heap_profile_function);
-  virtual ~TraceMemoryController();
+  ~TraceMemoryController() override;
 
   // base::trace_event::TraceLog::EnabledStateChangedObserver overrides:
   void OnTraceLogEnabled() override;
diff --git a/base/trace_event/trace_event_system_stats_monitor.h b/base/trace_event/trace_event_system_stats_monitor.h
index 051669a..7a63a14 100644
--- a/base/trace_event/trace_event_system_stats_monitor.h
+++ b/base/trace_event/trace_event_system_stats_monitor.h
@@ -33,7 +33,7 @@
   explicit TraceEventSystemStatsMonitor(
       scoped_refptr<SingleThreadTaskRunner> task_runner);
 
-  virtual ~TraceEventSystemStatsMonitor();
+  ~TraceEventSystemStatsMonitor() override;
 
   // base::trace_event::TraceLog::EnabledStateChangedObserver overrides:
   void OnTraceLogEnabled() override;
diff --git a/base/trace_event/trace_event_unittest.cc b/base/trace_event/trace_event_unittest.cc
index bb9f689..774dbff 100644
--- a/base/trace_event/trace_event_unittest.cc
+++ b/base/trace_event/trace_event_unittest.cc
@@ -1021,7 +1021,7 @@
     : public TraceLog::EnabledStateObserver {
  public:
   AfterStateChangeEnabledStateObserver() {}
-  virtual ~AfterStateChangeEnabledStateObserver() {}
+  ~AfterStateChangeEnabledStateObserver() override {}
 
   // TraceLog::EnabledStateObserver overrides:
   void OnTraceLogEnabled() override {
@@ -1052,7 +1052,7 @@
     : public TraceLog::EnabledStateObserver {
  public:
   SelfRemovingEnabledStateObserver() {}
-  virtual ~SelfRemovingEnabledStateObserver() {}
+  ~SelfRemovingEnabledStateObserver() override {}
 
   // TraceLog::EnabledStateObserver overrides:
   void OnTraceLogEnabled() override {}