Commit fc2c4fac authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

[XProto] Fix sequence_ not getting reset after calling OnResponse()

Fixes a regression introduced after [1] where Future would call
OnResponseImpl() in destruction even if it was already called.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/2220524

BUG=1066670
TBR=msisov

Change-Id: I6c42809ec3f5973c141eb76e52650aa560fda6d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2227056Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774297}
parent c079de04
......@@ -52,16 +52,16 @@ FutureBase& FutureBase::operator=(FutureBase&& future) {
}
void FutureBase::SyncImpl(Error** raw_error, uint8_t** raw_reply) {
if (!sequence_)
return;
DCHECK(sequence_);
*raw_reply = reinterpret_cast<uint8_t*>(
xcb_wait_for_reply(connection_->XcbConnection(), *sequence_, raw_error));
sequence_ = base::nullopt;
}
void FutureBase::OnResponseImpl(ResponseCallback callback) {
DCHECK(sequence_);
connection_->AddRequest(*sequence_, std::move(callback));
sequence_ = base::nullopt;
}
} // namespace x11
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment