зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1588241 - P1. Use move semantics with PrependEvent. r=mattwoodrow
PrepentEvent was already moving the argument passed by reference. This makes it clear that the object will be moved. Differential Revision: https://phabricator.services.mozilla.com/D52260 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
c7abcdb2c6
Коммит
801075cd07
|
@ -75,7 +75,7 @@ void ChannelEventQueue::FlushQueue() {
|
|||
// Next event needs to run on another thread. Put it back to
|
||||
// the front of the queue can try resume on that thread.
|
||||
Suspend();
|
||||
PrependEvent(event);
|
||||
PrependEvent(std::move(event));
|
||||
|
||||
needResumeOnOtherThread = true;
|
||||
{
|
||||
|
|
|
@ -102,7 +102,7 @@ class ChannelEventQueue final {
|
|||
bool aAssertionWhenNotQueued = false);
|
||||
|
||||
// Append ChannelEvent in front of the event queue.
|
||||
inline nsresult PrependEvent(UniquePtr<ChannelEvent>& aEvent);
|
||||
inline nsresult PrependEvent(UniquePtr<ChannelEvent>&& aEvent);
|
||||
inline nsresult PrependEvents(nsTArray<UniquePtr<ChannelEvent>>& aEvents);
|
||||
|
||||
// After StartForcedQueueing is called, RunOrEnqueue() will start enqueuing
|
||||
|
@ -231,7 +231,7 @@ inline void ChannelEventQueue::EndForcedQueueing() {
|
|||
}
|
||||
|
||||
inline nsresult ChannelEventQueue::PrependEvent(
|
||||
UniquePtr<ChannelEvent>& aEvent) {
|
||||
UniquePtr<ChannelEvent>&& aEvent) {
|
||||
MutexAutoLock lock(mMutex);
|
||||
|
||||
// Prepending event while no queue flush foreseen might cause the following
|
||||
|
|
|
@ -3777,8 +3777,7 @@ void HttpChannelChild::CancelOnMainThread(nsresult aRv) {
|
|||
// Cancel is expected to preempt any other channel events, thus we put this
|
||||
// event in the front of mEventQ to make sure nsIStreamListener not receiving
|
||||
// any ODA/OnStopRequest callbacks.
|
||||
UniquePtr<ChannelEvent> cancelEvent = MakeUnique<CancelEvent>(this, aRv);
|
||||
mEventQ->PrependEvent(cancelEvent);
|
||||
mEventQ->PrependEvent(MakeUnique<CancelEvent>(this, aRv));
|
||||
mEventQ->Resume();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче