Skip to content

Commit

Permalink
Update {virtual,override} to follow C++11 style in ppapi.
Browse files Browse the repository at this point in the history
The Google style guide states that only one of {virtual,override,final} should be used for each declaration, since override implies virtual and final implies both virtual and override.

This patch was manually generated using a regex and a text editor.

BUG=417463

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

Cr-Commit-Position: refs/heads/master@{#326505}
  • Loading branch information
nick-chromium authored and Commit bot committed Apr 23, 2015
1 parent b05b81d commit e478443
Show file tree
Hide file tree
Showing 107 changed files with 1,140 additions and 1,202 deletions.
6 changes: 3 additions & 3 deletions ppapi/host/ppapi_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ class PPAPI_HOST_EXPORT PpapiHost : public IPC::Sender, public IPC::Listener {
// (AddHostFactoryFilter) and instance messages (AddInstanceMessageFilter)
// after construction.
PpapiHost(IPC::Sender* sender, const PpapiPermissions& perms);
virtual ~PpapiHost();
~PpapiHost() override;

const PpapiPermissions& permissions() const { return permissions_; }

// Sender implementation. Forwards to the sender_.
virtual bool Send(IPC::Message* msg) override;
bool Send(IPC::Message* msg) override;

// Listener implementation.
virtual bool OnMessageReceived(const IPC::Message& msg) override;
bool OnMessageReceived(const IPC::Message& msg) override;

// Sends the given reply message to the plugin.
void SendReply(const ReplyMessageContext& context,
Expand Down
10 changes: 5 additions & 5 deletions ppapi/host/resource_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ResourceMessageFilter;
class PPAPI_HOST_EXPORT ResourceHost : public ResourceMessageHandler {
public:
ResourceHost(PpapiHost* host, PP_Instance instance, PP_Resource resource);
virtual ~ResourceHost();
~ResourceHost() override;

PpapiHost* host() { return host_; }
PP_Instance pp_instance() const { return pp_instance_; }
Expand All @@ -40,8 +40,8 @@ class PPAPI_HOST_EXPORT ResourceHost : public ResourceMessageHandler {
// This runs any message filters in |message_filters_|. If the message is not
// handled by these filters then the host's own message handler is run. True
// is always returned (the message will always be handled in some way).
virtual bool HandleMessage(const IPC::Message& msg,
HostMessageContext* context) override;
bool HandleMessage(const IPC::Message& msg,
HostMessageContext* context) override;

// Sets the PP_Resource ID when the plugin attaches to a pending resource
// host. This will notify subclasses by calling
Expand All @@ -51,8 +51,8 @@ class PPAPI_HOST_EXPORT ResourceHost : public ResourceMessageHandler {
// PpapiHostMsg_AttachToPendingHost.
void SetPPResourceForPendingHost(PP_Resource pp_resource);

virtual void SendReply(const ReplyMessageContext& context,
const IPC::Message& msg) override;
void SendReply(const ReplyMessageContext& context,
const IPC::Message& msg) override;

// Simple RTTI. A subclass that is a host for one of these APIs will override
// the appropriate function and return true.
Expand Down
17 changes: 8 additions & 9 deletions ppapi/host/resource_message_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,15 @@ struct PPAPI_HOST_EXPORT ResourceMessageFilterDeleteTraits {
// subclass as follows:
// class MyMessageFilter : public ResourceMessageFilter {
// protected:
// virtual scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage(
// scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage(
// const IPC::Message& message) override {
// if (message.type() == MyMessage::ID)
// return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI);
// return NULL;
// }
//
// virtual int32_t OnResourceMessageReceived(
// const IPC::Message& msg,
// HostMessageContext* context) override {
// int32_t OnResourceMessageReceived(const IPC::Message& msg,
// HostMessageContext* context) override {
// IPC_BEGIN_MESSAGE_MAP(MyMessageFilter, msg)
// PPAPI_DISPATCH_HOST_RESOURCE_CALL(MyMessage, OnMyMessage)
// IPC_END_MESSAGE_MAP()
Expand Down Expand Up @@ -96,15 +95,15 @@ class PPAPI_HOST_EXPORT ResourceMessageFilter

// This will dispatch the message handler on the target thread. It returns
// true if the message was handled by this filter and false otherwise.
virtual bool HandleMessage(const IPC::Message& msg,
HostMessageContext* context) override;
bool HandleMessage(const IPC::Message& msg,
HostMessageContext* context) override;

// This can be called from any thread.
virtual void SendReply(const ReplyMessageContext& context,
const IPC::Message& msg) override;
void SendReply(const ReplyMessageContext& context,
const IPC::Message& msg) override;

protected:
virtual ~ResourceMessageFilter();
~ResourceMessageFilter() override;

// Please see the comments of |resource_host_| for on which thread it can be
// used and when it is NULL.
Expand Down
13 changes: 6 additions & 7 deletions ppapi/host/resource_message_filter_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ class MyResourceHost : public ResourceHost {
AddFilter(filter);
}

virtual int32_t OnResourceMessageReceived(
const IPC::Message& msg,
HostMessageContext* context) override {
int32_t OnResourceMessageReceived(const IPC::Message& msg,
HostMessageContext* context) override {
last_handled_msg_ = msg;
if (msg.type() == msg_type_) {
context->reply_msg = IPC::Message(0, reply_msg_type_,
Expand All @@ -71,8 +70,8 @@ class MyResourceHost : public ResourceHost {
return PP_ERROR_FAILED;
}

virtual void SendReply(const ReplyMessageContext& context,
const IPC::Message& msg) override {
void SendReply(const ReplyMessageContext& context,
const IPC::Message& msg) override {
last_reply_msg_ = msg;
last_reply_message_loop_ = base::MessageLoop::current();
g_handler_completion.Signal();
Expand Down Expand Up @@ -110,14 +109,14 @@ class MyResourceFilter : public ResourceMessageFilter {
const IPC::Message& last_handled_msg() const { return last_handled_msg_; }
base::MessageLoop* last_message_loop() const { return last_message_loop_; }

virtual scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage(
scoped_refptr<base::TaskRunner> OverrideTaskRunnerForMessage(
const IPC::Message& msg) override {
if (msg.type() == msg_type_)
return message_loop_proxy_;
return NULL;
}

virtual int32_t OnResourceMessageReceived(
int32_t OnResourceMessageReceived(
const IPC::Message& msg,
HostMessageContext* context) override {
last_handled_msg_ = msg;
Expand Down
8 changes: 4 additions & 4 deletions ppapi/nacl_irt/manifest_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,27 @@ class ManifestMessageFilter : public IPC::SyncMessageFilter {
true /* manual_reset */, false /* initially_signaled */) {
}

virtual bool Send(IPC::Message* message) override {
bool Send(IPC::Message* message) override {
// Wait until set up is actually done.
connected_event_.Wait();
return SyncMessageFilter::Send(message);
}

// When set up is done, OnFilterAdded is called on IO thread. Unblocks the
// Send().
virtual void OnFilterAdded(IPC::Sender* sender) override {
void OnFilterAdded(IPC::Sender* sender) override {
SyncMessageFilter::OnFilterAdded(sender);
connected_event_.Signal();
}

// If an error is found, unblocks the Send(), too, to return an error.
virtual void OnChannelError() override {
void OnChannelError() override {
SyncMessageFilter::OnChannelError();
connected_event_.Signal();
}

// Similar to OnChannelError, unblocks the Send() on the channel closing.
virtual void OnChannelClosing() override {
void OnChannelClosing() override {
SyncMessageFilter::OnChannelClosing();
connected_event_.Signal();
}
Expand Down
36 changes: 17 additions & 19 deletions ppapi/nacl_irt/ppapi_dispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,34 +52,32 @@ class PpapiDispatcher : public proxy::PluginDispatcher::PluginDelegate,
int renderer_ipc_fd);

// PluginDispatcher::PluginDelegate implementation.
virtual base::MessageLoopProxy* GetIPCMessageLoop() override;
virtual base::WaitableEvent* GetShutdownEvent() override;
virtual IPC::PlatformFileForTransit ShareHandleWithRemote(
base::MessageLoopProxy* GetIPCMessageLoop() override;
base::WaitableEvent* GetShutdownEvent() override;
IPC::PlatformFileForTransit ShareHandleWithRemote(
base::PlatformFile handle,
base::ProcessId peer_pid,
bool should_close_source) override;
virtual std::set<PP_Instance>* GetGloballySeenInstanceIDSet() override;
virtual uint32 Register(
proxy::PluginDispatcher* plugin_dispatcher) override;
virtual void Unregister(uint32 plugin_dispatcher_id) override;
std::set<PP_Instance>* GetGloballySeenInstanceIDSet() override;
uint32 Register(proxy::PluginDispatcher* plugin_dispatcher) override;
void Unregister(uint32 plugin_dispatcher_id) override;

// PluginProxyDelegate implementation.
virtual IPC::Sender* GetBrowserSender() override;
virtual std::string GetUILanguage() override;
virtual void PreCacheFont(const void* logfontw) override;
virtual void SetActiveURL(const std::string& url) override;
virtual PP_Resource CreateBrowserFont(
proxy::Connection connection,
PP_Instance instance,
const PP_BrowserFont_Trusted_Description& desc,
const Preferences& prefs) override;
IPC::Sender* GetBrowserSender() override;
std::string GetUILanguage() override;
void PreCacheFont(const void* logfontw) override;
void SetActiveURL(const std::string& url) override;
PP_Resource CreateBrowserFont(proxy::Connection connection,
PP_Instance instance,
const PP_BrowserFont_Trusted_Description& desc,
const Preferences& prefs) override;

// IPC::Listener implementation.
virtual bool OnMessageReceived(const IPC::Message& message) override;
virtual void OnChannelError() override;
bool OnMessageReceived(const IPC::Message& message) override;
void OnChannelError() override;

// IPC::Sender implementation
virtual bool Send(IPC::Message* message) override;
bool Send(IPC::Message* message) override;

private:
void OnMsgInitializeNaClDispatcher(const PpapiNaClPluginArgs& args);
Expand Down
26 changes: 13 additions & 13 deletions ppapi/proxy/audio_buffer_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@ class PPAPI_PROXY_EXPORT AudioBufferResource
int32_t index,
MediaStreamBuffer* buffer);

virtual ~AudioBufferResource();
~AudioBufferResource() override;

// PluginResource overrides:
virtual thunk::PPB_AudioBuffer_API* AsPPB_AudioBuffer_API() override;
thunk::PPB_AudioBuffer_API* AsPPB_AudioBuffer_API() override;

// PPB_AudioBuffer_API overrides:
virtual PP_TimeDelta GetTimestamp() override;
virtual void SetTimestamp(PP_TimeDelta timestamp) override;
virtual PP_AudioBuffer_SampleRate GetSampleRate() override;
virtual PP_AudioBuffer_SampleSize GetSampleSize() override;
virtual uint32_t GetNumberOfChannels() override;
virtual uint32_t GetNumberOfSamples() override;
virtual void* GetDataBuffer() override;
virtual uint32_t GetDataBufferSize() override;
virtual MediaStreamBuffer* GetBuffer() override;
virtual int32_t GetBufferIndex() override;
virtual void Invalidate() override;
PP_TimeDelta GetTimestamp() override;
void SetTimestamp(PP_TimeDelta timestamp) override;
PP_AudioBuffer_SampleRate GetSampleRate() override;
PP_AudioBuffer_SampleSize GetSampleSize() override;
uint32_t GetNumberOfChannels() override;
uint32_t GetNumberOfSamples() override;
void* GetDataBuffer() override;
uint32_t GetDataBufferSize() override;
MediaStreamBuffer* GetBuffer() override;
int32_t GetBufferIndex() override;
void Invalidate() override;

// Buffer index
int32_t index_;
Expand Down
50 changes: 24 additions & 26 deletions ppapi/proxy/audio_input_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,38 +31,36 @@ class AudioInputResource : public PluginResource,
public base::DelegateSimpleThread::Delegate {
public:
AudioInputResource(Connection connection, PP_Instance instance);
virtual ~AudioInputResource();
~AudioInputResource() override;

// Resource overrides.
virtual thunk::PPB_AudioInput_API* AsPPB_AudioInput_API() override;
virtual void OnReplyReceived(const ResourceMessageReplyParams& params,
const IPC::Message& msg) override;
thunk::PPB_AudioInput_API* AsPPB_AudioInput_API() override;
void OnReplyReceived(const ResourceMessageReplyParams& params,
const IPC::Message& msg) override;

// PPB_AudioInput_API implementation.
virtual int32_t EnumerateDevices(
const PP_ArrayOutput& output,
scoped_refptr<TrackedCallback> callback) override;
virtual int32_t MonitorDeviceChange(
PP_MonitorDeviceChangeCallback callback,
void* user_data) override;
virtual int32_t Open0_3(PP_Resource device_ref,
PP_Resource config,
PPB_AudioInput_Callback_0_3 audio_input_callback_0_3,
void* user_data,
scoped_refptr<TrackedCallback> callback) override;
virtual int32_t Open(PP_Resource device_ref,
PP_Resource config,
PPB_AudioInput_Callback audio_input_callback,
void* user_data,
scoped_refptr<TrackedCallback> callback) override;
virtual PP_Resource GetCurrentConfig() override;
virtual PP_Bool StartCapture() override;
virtual PP_Bool StopCapture() override;
virtual void Close() override;
int32_t EnumerateDevices(const PP_ArrayOutput& output,
scoped_refptr<TrackedCallback> callback) override;
int32_t MonitorDeviceChange(PP_MonitorDeviceChangeCallback callback,
void* user_data) override;
int32_t Open0_3(PP_Resource device_ref,
PP_Resource config,
PPB_AudioInput_Callback_0_3 audio_input_callback_0_3,
void* user_data,
scoped_refptr<TrackedCallback> callback) override;
int32_t Open(PP_Resource device_ref,
PP_Resource config,
PPB_AudioInput_Callback audio_input_callback,
void* user_data,
scoped_refptr<TrackedCallback> callback) override;
PP_Resource GetCurrentConfig() override;
PP_Bool StartCapture() override;
PP_Bool StopCapture() override;
void Close() override;

protected:
// Resource override.
virtual void LastPluginRefWasDeleted() override;
void LastPluginRefWasDeleted() override;

private:
enum OpenState {
Expand All @@ -87,7 +85,7 @@ class AudioInputResource : public PluginResource,

// DelegateSimpleThread::Delegate implementation.
// Run on the audio input thread.
virtual void Run() override;
void Run() override;

int32_t CommonOpen(PP_Resource device_ref,
PP_Resource config,
Expand Down
8 changes: 4 additions & 4 deletions ppapi/proxy/broker_dispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace proxy {

class PPAPI_PROXY_EXPORT BrokerDispatcher : public ProxyChannel {
public:
virtual ~BrokerDispatcher();
~BrokerDispatcher() override;

// You must call this function before anything else. Returns true on success.
// The delegate pointer must outlive this class, ownership is not
Expand All @@ -25,7 +25,7 @@ class PPAPI_PROXY_EXPORT BrokerDispatcher : public ProxyChannel {
bool is_client);

// IPC::Listener implementation.
virtual bool OnMessageReceived(const IPC::Message& msg) override;
bool OnMessageReceived(const IPC::Message& msg) override;

protected:
// You must call InitBrokerWithChannel after the constructor.
Expand All @@ -47,7 +47,7 @@ class PPAPI_PROXY_EXPORT BrokerHostDispatcher : public BrokerDispatcher {
BrokerHostDispatcher();

// IPC::Listener implementation.
virtual void OnChannelError() override;
void OnChannelError() override;
};

// The dispatcher for the broker side of the broker channel.
Expand All @@ -56,7 +56,7 @@ class PPAPI_PROXY_EXPORT BrokerSideDispatcher : public BrokerDispatcher {
explicit BrokerSideDispatcher(PP_ConnectInstance_Func connect_instance);

// IPC::Listener implementation.
virtual void OnChannelError() override;
void OnChannelError() override;
};

} // namespace proxy
Expand Down
6 changes: 3 additions & 3 deletions ppapi/proxy/broker_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ class BrokerResource
public thunk::PPB_Broker_Instance_API {
public:
BrokerResource(Connection connection, PP_Instance instance);
virtual ~BrokerResource();
~BrokerResource() override;

// Resource override.
virtual thunk::PPB_Broker_Instance_API* AsPPB_Broker_Instance_API() override;
thunk::PPB_Broker_Instance_API* AsPPB_Broker_Instance_API() override;

// thunk::PPB_Broker_Instance_API implementation.
virtual PP_Bool IsAllowed() override;
PP_Bool IsAllowed() override;

private:
DISALLOW_COPY_AND_ASSIGN(BrokerResource);
Expand Down
6 changes: 3 additions & 3 deletions ppapi/proxy/browser_font_singleton_resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ class BrowserFontSingletonResource
public thunk::PPB_BrowserFont_Singleton_API {
public:
BrowserFontSingletonResource(Connection connection, PP_Instance instance);
virtual ~BrowserFontSingletonResource();
~BrowserFontSingletonResource() override;

// Resource override.
virtual thunk::PPB_BrowserFont_Singleton_API*
thunk::PPB_BrowserFont_Singleton_API*
AsPPB_BrowserFont_Singleton_API() override;

// thunk::PPB_BrowserFontSingleton_API implementation.
virtual PP_Var GetFontFamilies(PP_Instance instance) override;
PP_Var GetFontFamilies(PP_Instance instance) override;

private:
// Lazily-filled-in list of font families.
Expand Down
Loading

0 comments on commit e478443

Please sign in to comment.