Skip to content

Commit

Permalink
Bug 1293603 (part 2) - Make Run() declarations consistent. r=erahm.
Browse files Browse the repository at this point in the history
This patch makes most Run() declarations in subclasses of nsIRunnable have the
same form: |NS_IMETHOD Run() override|.

As a result of these changes, I had to add |override| to a couple of other
functions to satisfy clang's -Winconsistent-missing-override warning.

--HG--
extra : rebase_source : 815d0018b0b13329bb5698c410f500dddcc3ee12
  • Loading branch information
nnethercote committed Aug 8, 2016
1 parent 9dc11c1 commit e7f10a0
Show file tree
Hide file tree
Showing 255 changed files with 443 additions and 445 deletions.
4 changes: 2 additions & 2 deletions docshell/base/nsDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9605,7 +9605,7 @@ class InternalLoadEvent : public Runnable
}

NS_IMETHOD
Run()
Run() override
{
return mDocShell->InternalLoad(mURI, mOriginalURI,
mLoadReplace,
Expand Down Expand Up @@ -13684,7 +13684,7 @@ class OnLinkClickEvent : public Runnable
nsIInputStream* aHeadersDataStream,
bool aIsTrusted);

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsAutoPopupStatePusher popupStatePusher(mPopupState);

Expand Down
2 changes: 1 addition & 1 deletion docshell/shistory/nsSHEntryShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class DestroyViewerEvent : public mozilla::Runnable
{
}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
if (mViewer) {
mViewer->Destroy();
Expand Down
2 changes: 1 addition & 1 deletion dom/audiochannel/AudioChannelService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class AudioPlaybackRunnable final : public Runnable
, mReason(aReason)
{}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsCOMPtr<nsIObserverService> observerService =
services::GetObserverService();
Expand Down
8 changes: 4 additions & 4 deletions dom/base/DOMRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ class FireSuccessAsyncTask : public mozilla::Runnable
return NS_OK;
}

NS_IMETHODIMP
Run()
NS_IMETHOD
Run() override
{
mReq->FireSuccess(JS::Handle<JS::Value>::fromMarkedLocation(mResult.address()));
return NS_OK;
Expand All @@ -343,8 +343,8 @@ class FireErrorAsyncTask : public mozilla::Runnable
{
}

NS_IMETHODIMP
Run()
NS_IMETHOD
Run() override
{
mReq->FireError(mError);
return NS_OK;
Expand Down
2 changes: 1 addition & 1 deletion dom/base/FragmentOrElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ class ContentUnbinder : public Runnable
}
}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsAutoScriptBlocker scriptBlocker;
uint32_t len = mSubtreeRoots.Length();
Expand Down
2 changes: 1 addition & 1 deletion dom/base/ImageEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class SurfaceHelper : public Runnable {

// It retrieves a SourceSurface reference and convert color format on main
// thread and passes DataSourceSurface to caller thread.
NS_IMETHOD Run() {
NS_IMETHOD Run() override {
// It guarantees the reference will be released on main thread.
nsCountedRef<nsMainThreadSourceSurfaceRef> surface;
surface.own(mImage->GetAsSourceSurface().take());
Expand Down
2 changes: 1 addition & 1 deletion dom/base/ImportManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ class AsyncEvent : public Runnable {
MOZ_ASSERT(mNode);
}

NS_IMETHOD Run() {
NS_IMETHOD Run() override {
return nsContentUtils::DispatchTrustedEvent(mNode->OwnerDoc(),
mNode,
mSuccess ? NS_LITERAL_STRING("load")
Expand Down
2 changes: 1 addition & 1 deletion dom/base/WebSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class CallDispatchConnectionCloseEvents final : public CancelableRunnable
aWebSocketImpl->AssertIsOnTargetThread();
}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
mWebSocketImpl->AssertIsOnTargetThread();
mWebSocketImpl->DispatchConnectionCloseEvents();
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsContentUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4858,7 +4858,7 @@ class AnonymousContentDestroyer : public Runnable {
mParent = mContent->GetParent();
mDoc = mContent->OwnerDoc();
}
NS_IMETHOD Run() {
NS_IMETHOD Run() override {
mContent->UnbindFromTree();
return NS_OK;
}
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsDOMMutationObserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ nsDOMMutationObserver::HandleMutation()
class AsyncMutationHandler : public mozilla::Runnable
{
public:
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsDOMMutationObserver::HandleMutations();
return NS_OK;
Expand Down
8 changes: 4 additions & 4 deletions dom/base/nsDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ class nsIDocument::SelectorCacheKeyDeleter final : public Runnable
}

public:
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
return NS_OK;
}
Expand Down Expand Up @@ -9105,7 +9105,7 @@ nsDocument::UnblockOnload(bool aFireSync)
class nsUnblockOnloadEvent : public Runnable {
public:
explicit nsUnblockOnloadEvent(nsDocument* aDoc) : mDoc(aDoc) {}
NS_IMETHOD Run() {
NS_IMETHOD Run() override {
mDoc->DoUnblockOnload();
return NS_OK;
}
Expand Down Expand Up @@ -9990,7 +9990,7 @@ class nsDelayedEventDispatcher : public Runnable
}
virtual ~nsDelayedEventDispatcher() {}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
FireOrClearDelayedEvents(mDocuments, true);
return NS_OK;
Expand Down Expand Up @@ -11445,7 +11445,7 @@ class nsCallRequestFullScreen : public Runnable
explicit nsCallRequestFullScreen(UniquePtr<FullscreenRequest>&& aRequest)
: mRequest(Move(aRequest)) { }

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
mRequest->GetDocument()->RequestFullScreen(Move(mRequest));
return NS_OK;
Expand Down
4 changes: 2 additions & 2 deletions dom/base/nsFocusManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1995,7 +1995,7 @@ class FocusBlurEvent : public Runnable
{
}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
InternalFocusEvent event(true, mEventMessage);
event.mFlags.mBubbles = false;
Expand Down Expand Up @@ -3490,7 +3490,7 @@ class PointerUnlocker : public Runnable
}
}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
if (PointerUnlocker::sActiveUnlocker == this) {
PointerUnlocker::sActiveUnlocker = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsFrameLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2741,7 +2741,7 @@ class nsAsyncMessageToChild : public nsSameProcessAsyncMessageBase,
{
}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsInProcessTabChildGlobal* tabChild =
static_cast<nsInProcessTabChildGlobal*>(mFrameLoader->mChildMessageManager.get());
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsFrameMessageManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,7 @@ class nsAsyncMessageToSameProcessChild : public nsSameProcessAsyncMessageBase,
nsAsyncMessageToSameProcessChild(JSContext* aCx, JS::Handle<JSObject*> aCpows)
: nsSameProcessAsyncMessageBase(aCx, aCpows)
{ }
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsFrameMessageManager* ppm = nsFrameMessageManager::GetChildProcessManager();
ReceiveMessage(static_cast<nsIContentFrameMessageManager*>(ppm), nullptr, ppm);
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsFrameMessageManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class nsFrameMessageManager final : public nsIContentFrameMessageManager,

class MyAsyncMessage : public nsSameProcessAsyncMessageBase, public Runnable
{
NS_IMETHOD Run() {
NS_IMETHOD Run() override {
ReceiveMessage(..., ...);
return NS_OK;
}
Expand Down
14 changes: 7 additions & 7 deletions dom/base/nsGlobalWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8481,7 +8481,7 @@ class nsCloseEvent : public Runnable {
return rv;
}

NS_IMETHOD Run() {
NS_IMETHOD Run() override {
if (mWindow) {
if (mIndirect) {
return PostCloseEvent(mWindow, false);
Expand Down Expand Up @@ -8851,7 +8851,7 @@ class nsPendingTimeoutRunner : public Runnable
NS_ASSERTION(mWindow, "mWindow is null.");
}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsGlobalWindow::RunPendingTimeoutsRecursive(mWindow, mWindow);

Expand Down Expand Up @@ -8952,7 +8952,7 @@ class WindowDestroyedEvent : public Runnable
mWindow = do_GetWeakReference(aWindow);
}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsCOMPtr<nsIObserverService> observerService =
services::GetObserverService();
Expand Down Expand Up @@ -9378,7 +9378,7 @@ class ChildCommandDispatcher : public Runnable
const nsAString& aAction)
: mWindow(aWindow), mTabChild(aTabChild), mAction(aAction) {}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsCOMPtr<nsPIWindowRoot> root = mWindow->GetTopWindowRoot();
if (!root) {
Expand Down Expand Up @@ -9407,7 +9407,7 @@ class CommandDispatcher : public Runnable
const nsAString& aAction)
: mDispatcher(aDispatcher), mAction(aAction) {}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
return mDispatcher->UpdateCommands(mAction);
}
Expand Down Expand Up @@ -10199,7 +10199,7 @@ class HashchangeCallback : public Runnable
mNewURL.Assign(aNewURL);
}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
NS_PRECONDITION(NS_IsMainThread(), "Should be called on the main thread.");
return mWindow->FireHashchange(mOldURL, mNewURL);
Expand Down Expand Up @@ -10804,7 +10804,7 @@ class NotifyIdleObserverRunnable : public Runnable
mCallOnidle(aCallOnidle)
{ }

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
if (mIdleWindow->ContainsIdleObserver(mIdleObserver, mTimeInS)) {
return mCallOnidle ? mIdleObserver->Onidle() : mIdleObserver->Onactive();
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsInProcessTabChildGlobal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class nsAsyncScriptLoad : public Runnable
bool aRunInGlobalScope)
: mTabChild(aTabChild), mURL(aURL), mRunInGlobalScope(aRunInGlobalScope) {}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
mTabChild->LoadFrameScript(mURL, mRunInGlobalScope);
return NS_OK;
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsJSEnvironment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ class ScriptErrorEvent : public Runnable
, mError(aRuntime, aError)
{}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
nsEventStatus status = nsEventStatus_eIgnore;
nsPIDOMWindowInner* win = mWindow;
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsScriptLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ class nsScriptRequestProcessor : public Runnable
: mLoader(aLoader)
, mRequest(aRequest)
{}
NS_IMETHODIMP Run()
NS_IMETHOD Run() override
{
return mLoader->ProcessRequest(mRequest);
}
Expand Down
4 changes: 2 additions & 2 deletions dom/bluetooth/bluedroid/BluetoothOppManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class BluetoothOppManager::SendSocketDataTask final : public Runnable
MOZ_ASSERT(!NS_IsMainThread());
}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
MOZ_ASSERT(NS_IsMainThread());

Expand All @@ -137,7 +137,7 @@ class BluetoothOppManager::ReadFileTask final : public Runnable
mAvailablePacketSize = aRemoteMaxPacketSize - kPutRequestHeaderSize;
}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
MOZ_ASSERT(!NS_IsMainThread());

Expand Down
18 changes: 9 additions & 9 deletions dom/bluetooth/bluez/BluetoothDBusService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ class SinkPropertyChangedHandler : public Runnable
}

NS_IMETHOD
Run()
Run() override
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(mSignal.name().EqualsLiteral("PropertyChanged"));
Expand Down Expand Up @@ -607,7 +607,7 @@ class InputPropertyChangedHandler : public Runnable
}

NS_IMETHOD
Run()
Run() override
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(mSignal.name().EqualsLiteral("PropertyChanged"));
Expand Down Expand Up @@ -1736,7 +1736,7 @@ class PrepareAdapterRunnable : public Runnable
PrepareAdapterRunnable()
{ }

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
MOZ_ASSERT(NS_IsMainThread());

Expand Down Expand Up @@ -2149,7 +2149,7 @@ class StartDBusConnectionTask : public Runnable
class StartBluetoothRunnable final : public Runnable
{
public:
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
// This could block. It should never be run on the main thread.
MOZ_ASSERT(!NS_IsMainThread()); // BT thread
Expand Down Expand Up @@ -2216,7 +2216,7 @@ BluetoothDBusService::StartInternal(BluetoothReplyRunnable* aRunnable)
class DisableBluetoothRunnable final : public Runnable
{
public:
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
if (NS_IsMainThread()) {
// Clear |sControllerArray| here while we're on the main thread
Expand Down Expand Up @@ -2309,7 +2309,7 @@ class DeleteDBusConnectionTask final : public Runnable
class StopBluetoothRunnable final : public Runnable
{
public:
NS_IMETHOD Run()
NS_IMETHOD Run() override
{
MOZ_ASSERT(!NS_IsMainThread()); // BT thread

Expand Down Expand Up @@ -3551,8 +3551,8 @@ class OnUpdateSdpRecordsRunnable : public Runnable
MOZ_ASSERT(mManager);
}

nsresult
Run()
NS_IMETHOD
Run() override
{
MOZ_ASSERT(NS_IsMainThread());

Expand Down Expand Up @@ -3583,7 +3583,7 @@ class OnGetServiceChannelRunnable : public Runnable
MOZ_ASSERT(aManager);
}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
MOZ_ASSERT(NS_IsMainThread());

Expand Down
4 changes: 2 additions & 2 deletions dom/bluetooth/bluez/BluetoothOppManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class SendSocketDataTask : public Runnable
MOZ_ASSERT(!NS_IsMainThread());
}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
MOZ_ASSERT(NS_IsMainThread());

Expand All @@ -132,7 +132,7 @@ class ReadFileTask : public Runnable
mAvailablePacketSize = aRemoteMaxPacketSize - kPutRequestHeaderSize;
}

NS_IMETHOD Run()
NS_IMETHOD Run() override
{
MOZ_ASSERT(!NS_IsMainThread());

Expand Down
Loading

0 comments on commit e7f10a0

Please sign in to comment.