summaryrefslogtreecommitdiffstats
path: root/components/copresence
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2014-10-21 04:24:56 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-21 11:25:34 +0000
commit00ea022b81af00857b352bae68d4ba2eb3e1493b (patch)
treeb5e3e536a25f154ab5410d611736832c11b2cfad /components/copresence
parent0b0885ca539071e7864061fde54c7345a0fd2aae (diff)
downloadchromium_src-00ea022b81af00857b352bae68d4ba2eb3e1493b.zip
chromium_src-00ea022b81af00857b352bae68d4ba2eb3e1493b.tar.gz
chromium_src-00ea022b81af00857b352bae68d4ba2eb3e1493b.tar.bz2
Standardize usage of virtual/override/final in components/
BUG=417463 TBR=blundell@chromium.org Review URL: https://codereview.chromium.org/666133002 Cr-Commit-Position: refs/heads/master@{#300456}
Diffstat (limited to 'components/copresence')
-rw-r--r--components/copresence/copresence_manager_impl.h8
-rw-r--r--components/copresence/handlers/audio/audio_directive_handler_unittest.cc20
-rw-r--r--components/copresence/mediums/audio/audio_player.h7
-rw-r--r--components/copresence/mediums/audio/audio_player_unittest.cc14
-rw-r--r--components/copresence/mediums/audio/audio_recorder.h16
-rw-r--r--components/copresence/mediums/audio/audio_recorder_unittest.cc22
-rw-r--r--components/copresence/rpc/http_post.h4
-rw-r--r--components/copresence/rpc/rpc_handler_unittest.cc27
8 files changed, 56 insertions, 62 deletions
diff --git a/components/copresence/copresence_manager_impl.h b/components/copresence/copresence_manager_impl.h
index 7f14cbc..035f462 100644
--- a/components/copresence/copresence_manager_impl.h
+++ b/components/copresence/copresence_manager_impl.h
@@ -37,10 +37,10 @@ struct PendingRequest {
// The implementation for CopresenceManager.
class CopresenceManagerImpl : public CopresenceManager {
public:
- virtual ~CopresenceManagerImpl();
- virtual void ExecuteReportRequest(ReportRequest request,
- const std::string& app_id,
- const StatusCallback& callback) override;
+ ~CopresenceManagerImpl() override;
+ void ExecuteReportRequest(ReportRequest request,
+ const std::string& app_id,
+ const StatusCallback& callback) override;
private:
// Create managers with the CopresenceManager::Create() method.
diff --git a/components/copresence/handlers/audio/audio_directive_handler_unittest.cc b/components/copresence/handlers/audio/audio_directive_handler_unittest.cc
index 31c5f58..56dd49d 100644
--- a/components/copresence/handlers/audio/audio_directive_handler_unittest.cc
+++ b/components/copresence/handlers/audio/audio_directive_handler_unittest.cc
@@ -21,16 +21,16 @@ namespace copresence {
class TestAudioPlayer : public AudioPlayer {
public:
TestAudioPlayer() {}
- virtual ~TestAudioPlayer() {}
+ ~TestAudioPlayer() override {}
// AudioPlayer overrides:
- virtual void Initialize() override {}
- virtual void Play(
+ void Initialize() override {}
+ void Play(
const scoped_refptr<media::AudioBusRefCounted>& /* samples */) override {
set_is_playing(true);
}
- virtual void Stop() override { set_is_playing(false); }
- virtual void Finalize() override { delete this; }
+ void Stop() override { set_is_playing(false); }
+ void Finalize() override { delete this; }
private:
DISALLOW_COPY_AND_ASSIGN(TestAudioPlayer);
@@ -39,13 +39,13 @@ class TestAudioPlayer : public AudioPlayer {
class TestAudioRecorder : public AudioRecorder {
public:
TestAudioRecorder() : AudioRecorder(AudioRecorder::DecodeSamplesCallback()) {}
- virtual ~TestAudioRecorder() {}
+ ~TestAudioRecorder() override {}
// AudioRecorder overrides:
- virtual void Initialize() override {}
- virtual void Record() override { set_is_recording(true); }
- virtual void Stop() override { set_is_recording(false); }
- virtual void Finalize() override { delete this; }
+ void Initialize() override {}
+ void Record() override { set_is_recording(true); }
+ void Stop() override { set_is_recording(false); }
+ void Finalize() override { delete this; }
private:
DISALLOW_COPY_AND_ASSIGN(TestAudioRecorder);
diff --git a/components/copresence/mediums/audio/audio_player.h b/components/copresence/mediums/audio/audio_player.h
index 96c1f0f..e2bb64d 100644
--- a/components/copresence/mediums/audio/audio_player.h
+++ b/components/copresence/mediums/audio/audio_player.h
@@ -47,7 +47,7 @@ class AudioPlayer : public media::AudioOutputStream::AudioSourceCallback {
}
protected:
- virtual ~AudioPlayer();
+ ~AudioPlayer() override;
void set_is_playing(bool is_playing) { is_playing_ = is_playing; }
private:
@@ -66,9 +66,8 @@ class AudioPlayer : public media::AudioOutputStream::AudioSourceCallback {
// AudioOutputStream::AudioSourceCallback overrides:
// Following methods could be called from *ANY* thread.
- virtual int OnMoreData(media::AudioBus* dest,
- uint32 total_bytes_delay) override;
- virtual void OnError(media::AudioOutputStream* stream) override;
+ int OnMoreData(media::AudioBus* dest, uint32 total_bytes_delay) override;
+ void OnError(media::AudioOutputStream* stream) override;
// Flushes the audio loop, making sure that any queued operations are
// performed.
diff --git a/components/copresence/mediums/audio/audio_player_unittest.cc b/components/copresence/mediums/audio/audio_player_unittest.cc
index b978b99..97d58e5 100644
--- a/components/copresence/mediums/audio/audio_player_unittest.cc
+++ b/components/copresence/mediums/audio/audio_player_unittest.cc
@@ -29,17 +29,17 @@ class TestAudioOutputStream : public media::AudioOutputStream {
caller_loop_ = base::MessageLoop::current();
}
- virtual ~TestAudioOutputStream() {}
+ ~TestAudioOutputStream() override {}
- virtual bool Open() override { return true; }
- virtual void Start(AudioSourceCallback* callback) override {
+ bool Open() override { return true; }
+ void Start(AudioSourceCallback* callback) override {
callback_ = callback;
GatherPlayedSamples();
}
- virtual void Stop() override {}
- virtual void SetVolume(double volume) override {}
- virtual void GetVolume(double* volume) override {}
- virtual void Close() override {}
+ void Stop() override {}
+ void SetVolume(double volume) override {}
+ void GetVolume(double* volume) override {}
+ void Close() override {}
private:
void GatherPlayedSamples() {
diff --git a/components/copresence/mediums/audio/audio_recorder.h b/components/copresence/mediums/audio/audio_recorder.h
index 5c68eca..e554f01 100644
--- a/components/copresence/mediums/audio/audio_recorder.h
+++ b/components/copresence/mediums/audio/audio_recorder.h
@@ -55,7 +55,7 @@ class AudioRecorder : public media::AudioInputStream::AudioInputCallback,
}
protected:
- virtual ~AudioRecorder();
+ ~AudioRecorder() override;
void set_is_recording(bool is_recording) { is_recording_ = is_recording; }
private:
@@ -75,15 +75,15 @@ class AudioRecorder : public media::AudioInputStream::AudioInputCallback,
// Called by the audio recorder when a full packet of audio data is
// available. This is called from a special audio thread and the
// implementation should return as soon as possible.
- virtual void OnData(media::AudioInputStream* stream,
- const media::AudioBus* source,
- uint32 hardware_delay_bytes,
- double volume) override;
- virtual void OnError(media::AudioInputStream* stream) override;
+ void OnData(media::AudioInputStream* stream,
+ const media::AudioBus* source,
+ uint32 hardware_delay_bytes,
+ double volume) override;
+ void OnError(media::AudioInputStream* stream) override;
// AudioConverter::InputCallback overrides:
- virtual double ProvideInput(media::AudioBus* dest,
- base::TimeDelta buffer_delay) override;
+ double ProvideInput(media::AudioBus* dest,
+ base::TimeDelta buffer_delay) override;
// Flushes the audio loop, making sure that any queued operations are
// performed.
diff --git a/components/copresence/mediums/audio/audio_recorder_unittest.cc b/components/copresence/mediums/audio/audio_recorder_unittest.cc
index 2c81213..1e01c94 100644
--- a/components/copresence/mediums/audio/audio_recorder_unittest.cc
+++ b/components/copresence/mediums/audio/audio_recorder_unittest.cc
@@ -29,10 +29,10 @@ class TestAudioInputStream : public media::AudioInputStream {
buffer_->set_frames(samples);
}
- virtual ~TestAudioInputStream() {}
+ ~TestAudioInputStream() override {}
- virtual bool Open() override { return true; }
- virtual void Start(AudioInputCallback* callback) override {
+ bool Open() override { return true; }
+ void Start(AudioInputCallback* callback) override {
DCHECK(callback);
callback_ = callback;
media::AudioManager::Get()->GetTaskRunner()->PostTask(
@@ -40,14 +40,14 @@ class TestAudioInputStream : public media::AudioInputStream {
base::Bind(&TestAudioInputStream::SimulateRecording,
base::Unretained(this)));
}
- virtual void Stop() override {}
- virtual void Close() override {}
- virtual double GetMaxVolume() override { return 1.0; }
- virtual void SetVolume(double volume) override {}
- virtual double GetVolume() override { return 1.0; }
- virtual void SetAutomaticGainControl(bool enabled) override {}
- virtual bool GetAutomaticGainControl() override { return true; }
- virtual bool IsMuted() override { return false; }
+ void Stop() override {}
+ void Close() override {}
+ double GetMaxVolume() override { return 1.0; }
+ void SetVolume(double volume) override {}
+ double GetVolume() override { return 1.0; }
+ void SetAutomaticGainControl(bool enabled) override {}
+ bool GetAutomaticGainControl() override { return true; }
+ bool IsMuted() override { return false; }
private:
void SimulateRecording() {
diff --git a/components/copresence/rpc/http_post.h b/components/copresence/rpc/http_post.h
index f324b69..83a39c0 100644
--- a/components/copresence/rpc/http_post.h
+++ b/components/copresence/rpc/http_post.h
@@ -47,7 +47,7 @@ class HttpPost : public net::URLFetcherDelegate {
const google::protobuf::MessageLite& request_proto);
// HTTP requests are cancelled on delete.
- virtual ~HttpPost();
+ ~HttpPost() override;
// Send an HttpPost request.
void Start(const ResponseCallback& response_callback);
@@ -60,7 +60,7 @@ class HttpPost : public net::URLFetcherDelegate {
friend class HttpPostTest;
// Overridden from net::URLFetcherDelegate.
- virtual void OnURLFetchComplete(const net::URLFetcher* source) override;
+ void OnURLFetchComplete(const net::URLFetcher* source) override;
ResponseCallback response_callback_;
diff --git a/components/copresence/rpc/rpc_handler_unittest.cc b/components/copresence/rpc/rpc_handler_unittest.cc
index 77d61cb..aad39e3 100644
--- a/components/copresence/rpc/rpc_handler_unittest.cc
+++ b/components/copresence/rpc/rpc_handler_unittest.cc
@@ -40,21 +40,21 @@ void CreateSubscribedMessage(const std::vector<std::string>& subscription_ids,
class FakeDirectiveHandler : public DirectiveHandler {
public:
FakeDirectiveHandler() {}
- virtual ~FakeDirectiveHandler() {}
+ ~FakeDirectiveHandler() override {}
const std::vector<Directive>& added_directives() const {
return added_directives_;
}
- virtual void Initialize(
+ void Initialize(
const AudioRecorder::DecodeSamplesCallback& decode_cb,
const AudioDirectiveHandler::EncodeTokenCallback& encode_cb) override {}
- virtual void AddDirective(const Directive& directive) override {
+ void AddDirective(const Directive& directive) override {
added_directives_.push_back(directive);
}
- virtual void RemoveDirectives(const std::string& op_id) override {
+ void RemoveDirectives(const std::string& op_id) override {
// TODO(ckehoe): Add a parallel implementation when prod has one.
}
@@ -137,29 +137,24 @@ class RpcHandlerTest : public testing::Test, public CopresenceDelegate {
// CopresenceDelegate implementation
- virtual void HandleMessages(
- const std::string& app_id,
- const std::string& subscription_id,
- const std::vector<Message>& messages) override {
+ void HandleMessages(const std::string& app_id,
+ const std::string& subscription_id,
+ const std::vector<Message>& messages) override {
// app_id is unused for now, pending a server fix.
messages_by_subscription_[subscription_id] = messages;
}
- virtual net::URLRequestContextGetter* GetRequestContext() const override {
+ net::URLRequestContextGetter* GetRequestContext() const override {
return NULL;
}
- virtual const std::string GetPlatformVersionString() const override {
+ const std::string GetPlatformVersionString() const override {
return kChromeVersion;
}
- virtual const std::string GetAPIKey() const override {
- return api_key_;
- }
+ const std::string GetAPIKey() const override { return api_key_; }
- virtual WhispernetClient* GetWhispernetClient() override {
- return NULL;
- }
+ WhispernetClient* GetWhispernetClient() override { return NULL; }
protected:
// For rpc_handler_.invalid_audio_token_cache_