Commit bf77513a authored by gab's avatar gab Committed by Commit Bot

Deprecate NonThreadSafe in remoting in favor of SequenceChecker.

Note to crash team: This CL is a refactor and has no intended behavior change.

This change was scripted by https://crbug.com/676387#c8.

Note-worthy for the reviewer:
 * SequenceChecker enforces thread-safety but not thread-affinity!
   If the classes that were updated are thread-affine (use thread local
   storage or a third-party API that does) they should be migrated to
   ThreadChecker instead.
 * ~NonThreadSafe() used to implcitly check in its destructor
   ~Sequence/ThreadChecker() doesn't by design. To keep this CL a
   no-op, an explicit check was added to the destructor of migrated
   classes.
 * NonThreadSafe used to provide access to subclasses, as such
   the |sequence_checker_| member was made protected rather than
   private where necessary.

BUG=676387
This CL was uploaded by git cl split.

R=sergeyu@chromium.org

Review-Url: https://codereview.chromium.org/2911893003
Cr-Commit-Position: refs/heads/master@{#476279}
parent de524948
......@@ -56,12 +56,14 @@ OAuthTokenGetterImpl::OAuthTokenGetterImpl(
}
}
OAuthTokenGetterImpl::~OAuthTokenGetterImpl() {}
OAuthTokenGetterImpl::~OAuthTokenGetterImpl() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}
void OAuthTokenGetterImpl::OnGetTokensResponse(const std::string& refresh_token,
const std::string& access_token,
int expires_seconds) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(intermediate_credentials_);
VLOG(1) << "Received OAuth tokens.";
......@@ -85,7 +87,7 @@ void OAuthTokenGetterImpl::OnGetTokensResponse(const std::string& refresh_token,
void OAuthTokenGetterImpl::OnRefreshTokenResponse(
const std::string& access_token,
int expires_seconds) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(authorization_credentials_);
VLOG(1) << "Received OAuth token.";
......@@ -104,7 +106,7 @@ void OAuthTokenGetterImpl::OnRefreshTokenResponse(
void OAuthTokenGetterImpl::OnGetUserEmailResponse(
const std::string& user_email) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(authorization_credentials_);
VLOG(1) << "Received user info.";
......@@ -148,7 +150,7 @@ void OAuthTokenGetterImpl::NotifyTokenCallbacks(
Status status,
const std::string& user_email,
const std::string& access_token) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
std::queue<TokenCallback> callbacks(pending_callbacks_);
pending_callbacks_ = std::queue<TokenCallback>();
......@@ -161,14 +163,14 @@ void OAuthTokenGetterImpl::NotifyTokenCallbacks(
void OAuthTokenGetterImpl::NotifyUpdatedCallbacks(
const std::string& user_email,
const std::string& refresh_token) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (credentials_updated_callback_) {
credentials_updated_callback_.Run(user_email, refresh_token);
}
}
void OAuthTokenGetterImpl::OnOAuthError() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
LOG(ERROR) << "OAuth: invalid credentials.";
response_pending_ = false;
......@@ -182,7 +184,7 @@ void OAuthTokenGetterImpl::OnOAuthError() {
}
void OAuthTokenGetterImpl::OnNetworkError(int response_code) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
LOG(ERROR) << "Network error when trying to update OAuth token: "
<< response_code;
response_pending_ = false;
......@@ -191,7 +193,7 @@ void OAuthTokenGetterImpl::OnNetworkError(int response_code) {
}
void OAuthTokenGetterImpl::CallWithToken(const TokenCallback& on_access_token) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (intermediate_credentials_) {
pending_callbacks_.push(on_access_token);
if (!response_pending_) {
......@@ -216,12 +218,12 @@ void OAuthTokenGetterImpl::CallWithToken(const TokenCallback& on_access_token) {
}
void OAuthTokenGetterImpl::InvalidateCache() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
access_token_expiry_time_ = base::Time();
}
void OAuthTokenGetterImpl::GetOauthTokensFromAuthCode() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
VLOG(1) << "Fetching OAuth token from Auth Code.";
DCHECK(!response_pending_);
......@@ -254,7 +256,7 @@ void OAuthTokenGetterImpl::GetOauthTokensFromAuthCode() {
}
void OAuthTokenGetterImpl::RefreshAccessToken() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
VLOG(1) << "Refreshing OAuth Access token.";
DCHECK(!response_pending_);
......
......@@ -8,7 +8,7 @@
#include <queue>
#include "base/callback.h"
#include "base/threading/non_thread_safe.h"
#include "base/sequence_checker.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "google_apis/gaia/gaia_oauth_client.h"
......@@ -29,7 +29,6 @@ namespace remoting {
// On first usage it is likely an application will only have an auth code,
// from this you can get a refresh token which can be reused next app launch.
class OAuthTokenGetterImpl : public OAuthTokenGetter,
public base::NonThreadSafe,
public gaia::GaiaOAuthClient::Delegate {
public:
OAuthTokenGetterImpl(
......@@ -83,6 +82,8 @@ class OAuthTokenGetterImpl : public OAuthTokenGetter,
base::Time access_token_expiry_time_;
std::queue<OAuthTokenGetter::TokenCallback> pending_callbacks_;
std::unique_ptr<base::OneShotTimer> refresh_timer_;
SEQUENCE_CHECKER(sequence_checker_);
};
} // namespace remoting
......
......@@ -13,10 +13,12 @@ RateCounter::RateCounter(base::TimeDelta time_window)
DCHECK_GT(time_window, base::TimeDelta());
}
RateCounter::~RateCounter() {}
RateCounter::~RateCounter() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}
void RateCounter::Record(int64_t value) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
base::TimeTicks now = tick_clock_->NowTicks();
EvictOldDataPoints(now);
......@@ -25,7 +27,7 @@ void RateCounter::Record(int64_t value) {
}
double RateCounter::Rate() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
EvictOldDataPoints(tick_clock_->NowTicks());
return sum_ / time_window_.InSecondsF();
......
......@@ -11,7 +11,7 @@
#include <utility>
#include "base/macros.h"
#include "base/threading/non_thread_safe.h"
#include "base/sequence_checker.h"
#include "base/time/default_tick_clock.h"
#include "base/time/tick_clock.h"
#include "base/time/time.h"
......@@ -21,7 +21,7 @@ namespace remoting {
// Measures average rate per second of a sequence of point rate samples
// over a specified time window. This can be used to measure bandwidth, frame
// rates, etc.
class RateCounter : public base::NonThreadSafe {
class RateCounter {
public:
// Constructs a rate counter over the specified |time_window|.
explicit RateCounter(base::TimeDelta time_window);
......@@ -57,6 +57,8 @@ class RateCounter : public base::NonThreadSafe {
base::DefaultTickClock default_tick_clock_;
base::TickClock* tick_clock_ = &default_tick_clock_;
SEQUENCE_CHECKER(sequence_checker_);
DISALLOW_COPY_AND_ASSIGN(RateCounter);
};
......
......@@ -174,6 +174,7 @@ static_library("host") {
"host_status_logger.h",
"host_status_monitor.h",
"host_status_observer.h",
"host_window.cc",
"host_window.h",
"host_window_proxy.cc",
"host_window_proxy.h",
......
......@@ -83,7 +83,7 @@ ChromotingHost::ChromotingHost(
}
ChromotingHost::~ChromotingHost() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// Disconnect all of the clients.
while (!clients_.empty()) {
......@@ -102,7 +102,7 @@ ChromotingHost::~ChromotingHost() {
}
void ChromotingHost::Start(const std::string& host_owner_email) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!started_);
HOST_LOG << "Starting host";
......@@ -115,12 +115,12 @@ void ChromotingHost::Start(const std::string& host_owner_email) {
}
void ChromotingHost::AddStatusObserver(HostStatusObserver* observer) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
status_observers_.AddObserver(observer);
}
void ChromotingHost::RemoveStatusObserver(HostStatusObserver* observer) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
status_observers_.RemoveObserver(observer);
}
......@@ -130,7 +130,7 @@ void ChromotingHost::AddExtension(std::unique_ptr<HostExtension> extension) {
void ChromotingHost::SetAuthenticatorFactory(
std::unique_ptr<protocol::AuthenticatorFactory> authenticator_factory) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
session_manager_->set_authenticator_factory(std::move(authenticator_factory));
}
......@@ -156,7 +156,7 @@ void ChromotingHost::OnSessionAuthenticating(ClientSession* client) {
}
void ChromotingHost::OnSessionAuthenticated(ClientSession* client) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
login_backoff_.Reset();
......@@ -181,7 +181,7 @@ void ChromotingHost::OnSessionAuthenticated(ClientSession* client) {
}
void ChromotingHost::OnSessionChannelsConnected(ClientSession* client) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// Notify observers.
for (auto& observer : status_observers_)
......@@ -189,7 +189,7 @@ void ChromotingHost::OnSessionChannelsConnected(ClientSession* client) {
}
void ChromotingHost::OnSessionAuthenticationFailed(ClientSession* client) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// Notify observers.
for (auto& observer : status_observers_)
......@@ -197,7 +197,7 @@ void ChromotingHost::OnSessionAuthenticationFailed(ClientSession* client) {
}
void ChromotingHost::OnSessionClosed(ClientSession* client) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
ClientSessions::iterator it =
std::find_if(clients_.begin(), clients_.end(),
......@@ -220,7 +220,7 @@ void ChromotingHost::OnSessionRouteChange(
ClientSession* session,
const std::string& channel_name,
const protocol::TransportRoute& route) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
for (auto& observer : status_observers_)
observer.OnClientRouteChange(session->client_jid(), channel_name, route);
}
......@@ -228,7 +228,7 @@ void ChromotingHost::OnSessionRouteChange(
void ChromotingHost::OnIncomingSession(
protocol::Session* session,
protocol::SessionManager::IncomingSessionResponse* response) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(started_);
if (login_backoff_.ShouldRejectRequest()) {
......
......@@ -13,7 +13,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/threading/non_thread_safe.h"
#include "base/sequence_checker.h"
#include "base/threading/thread.h"
#include "net/base/backoff_entry.h"
#include "remoting/host/client_session.h"
......@@ -62,8 +62,7 @@ class DesktopEnvironmentFactory;
// all pending tasks to complete. After all of that completed we
// return to the idle state. We then go to step (2) if there a new
// incoming connection.
class ChromotingHost : public base::NonThreadSafe,
public ClientSession::EventHandler,
class ChromotingHost : public ClientSession::EventHandler,
public HostStatusMonitor {
public:
typedef std::vector<std::unique_ptr<ClientSession>> ClientSessions;
......@@ -179,6 +178,8 @@ class ChromotingHost : public base::NonThreadSafe,
// List of host extensions.
std::vector<std::unique_ptr<HostExtension>> extensions_;
SEQUENCE_CHECKER(sequence_checker_);
base::WeakPtrFactory<ChromotingHost> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(ChromotingHost);
......
......@@ -82,7 +82,7 @@ ClientSession::ClientSession(
}
ClientSession::~ClientSession() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!audio_stream_);
DCHECK(!desktop_environment_);
DCHECK(!input_injector_);
......@@ -94,7 +94,7 @@ ClientSession::~ClientSession() {
void ClientSession::NotifyClientResolution(
const protocol::ClientResolution& resolution) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(resolution.dips_width() > 0 && resolution.dips_height() > 0);
VLOG(1) << "Received ClientResolution (dips_width="
......@@ -124,7 +124,7 @@ void ClientSession::NotifyClientResolution(
}
void ClientSession::ControlVideo(const protocol::VideoControl& video_control) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// Note that |video_stream_| may be null, depending upon whether
// extensions choose to wrap or "steal" the video capturer or encoder.
......@@ -152,7 +152,7 @@ void ClientSession::ControlVideo(const protocol::VideoControl& video_control) {
}
void ClientSession::ControlAudio(const protocol::AudioControl& audio_control) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (audio_control.has_enable()) {
VLOG(1) << "Received AudioControl (enable="
......@@ -164,7 +164,7 @@ void ClientSession::ControlAudio(const protocol::AudioControl& audio_control) {
void ClientSession::SetCapabilities(
const protocol::Capabilities& capabilities) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// Ignore all the messages but the 1st one.
if (client_capabilities_) {
......@@ -223,7 +223,7 @@ void ClientSession::OnConnectionAuthenticating() {
}
void ClientSession::OnConnectionAuthenticated() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!audio_stream_);
DCHECK(!desktop_environment_);
DCHECK(!input_injector_);
......@@ -280,7 +280,7 @@ void ClientSession::OnConnectionAuthenticated() {
}
void ClientSession::CreateMediaStreams() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// Create a VideoStream to pump frames from the capturer to the client.
video_stream_ = connection_->StartVideoStream(
......@@ -307,7 +307,7 @@ void ClientSession::CreateMediaStreams() {
}
void ClientSession::OnConnectionChannelsConnected() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!channels_connected_);
channels_connected_ = true;
......@@ -337,7 +337,7 @@ void ClientSession::OnConnectionChannelsConnected() {
}
void ClientSession::OnConnectionClosed(protocol::ErrorCode error) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
HOST_LOG << "Client disconnected: " << client_jid_ << "; error = " << error;
......@@ -368,7 +368,7 @@ void ClientSession::OnConnectionClosed(protocol::ErrorCode error) {
void ClientSession::OnRouteChange(
const std::string& channel_name,
const protocol::TransportRoute& route) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
event_handler_->OnSessionRouteChange(this, channel_name, route);
}
......@@ -377,7 +377,7 @@ const std::string& ClientSession::client_jid() const {
}
void ClientSession::DisconnectSession(protocol::ErrorCode error) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(connection_.get());
max_duration_timer_.Stop();
......@@ -388,12 +388,12 @@ void ClientSession::DisconnectSession(protocol::ErrorCode error) {
}
void ClientSession::OnLocalMouseMoved(const webrtc::DesktopVector& position) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
remote_input_filter_.LocalMouseMoved(position);
}
void ClientSession::SetDisableInputs(bool disable_inputs) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (disable_inputs)
input_tracker_.ReleaseAll();
......@@ -403,27 +403,27 @@ void ClientSession::SetDisableInputs(bool disable_inputs) {
}
uint32_t ClientSession::desktop_session_id() const {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(desktop_environment_);
return desktop_environment_->GetDesktopSessionId();
}
ClientSessionControl* ClientSession::session_control() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return this;
}
void ClientSession::SetEventTimestampsSourceForTests(
scoped_refptr<protocol::InputEventTimestampsSource>
event_timestamp_source) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
event_timestamp_source_for_tests_ = event_timestamp_source;
if (video_stream_)
video_stream_->SetEventTimestampsSource(event_timestamp_source_for_tests_);
}
std::unique_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return base::MakeUnique<protocol::ClipboardThreadProxy>(
client_clipboard_factory_.GetWeakPtr(),
base::ThreadTaskRunnerHandle::Get());
......@@ -432,7 +432,7 @@ std::unique_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() {
void ClientSession::OnVideoSizeChanged(protocol::VideoStream* video_stream,
const webrtc::DesktopSize& size,
const webrtc::DesktopVector& dpi) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
mouse_clamping_filter_.set_output_size(size);
......
......@@ -12,8 +12,8 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/sequence_checker.h"
#include "base/sequenced_task_runner_helpers.h"
#include "base/threading/non_thread_safe.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "remoting/host/client_session_control.h"
......@@ -50,8 +50,7 @@ class VideoLayout;
// A ClientSession keeps a reference to a connection to a client, and maintains
// per-client state.
class ClientSession : public base::NonThreadSafe,
public protocol::HostStub,
class ClientSession : public protocol::HostStub,
public protocol::ConnectionToClient::EventHandler,
public protocol::VideoStream::Observer,
public ClientSessionControl,
......@@ -248,6 +247,8 @@ class ClientSession : public base::NonThreadSafe,
HostExperimentSessionPlugin host_experiment_session_plugin_;
SEQUENCE_CHECKER(sequence_checker_);
// Used to disable callbacks to |this| once DisconnectSession() has been
// called.
base::WeakPtrFactory<ClientSessionControl> weak_factory_;
......
......@@ -21,7 +21,7 @@ ContinueWindow::~ContinueWindow() {
void ContinueWindow::Start(
const base::WeakPtr<ClientSessionControl>& client_session_control) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!client_session_control_.get());
DCHECK(client_session_control.get());
......@@ -33,7 +33,7 @@ void ContinueWindow::Start(
}
void ContinueWindow::ContinueSession() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
disconnect_timer_.Stop();
......@@ -50,7 +50,7 @@ void ContinueWindow::ContinueSession() {
}
void ContinueWindow::DisconnectSession() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
disconnect_timer_.Stop();
if (client_session_control_.get())
......@@ -60,7 +60,7 @@ void ContinueWindow::DisconnectSession() {
ContinueWindow::ContinueWindow() {}
void ContinueWindow::OnSessionExpired() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (!client_session_control_.get())
return;
......
......@@ -49,7 +49,7 @@ ContinueWindowGtk::~ContinueWindowGtk() {
}
void ContinueWindowGtk::ShowUi() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!continue_window_);
CreateWindow();
......@@ -58,7 +58,7 @@ void ContinueWindowGtk::ShowUi() {
}
void ContinueWindowGtk::HideUi() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (continue_window_) {
gtk_widget_destroy(continue_window_);
......@@ -67,7 +67,7 @@ void ContinueWindowGtk::HideUi() {
}
void ContinueWindowGtk::CreateWindow() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!continue_window_);
GtkDialogFlags flags = GTK_DIALOG_MODAL;
......@@ -111,7 +111,7 @@ void ContinueWindowGtk::CreateWindow() {
}
void ContinueWindowGtk::OnResponse(GtkDialog* dialog, int response_id) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (response_id == GTK_RESPONSE_OK) {
ContinueSession();
......
......@@ -55,11 +55,11 @@ ContinueWindowMac::ContinueWindowMac() {
}
ContinueWindowMac::~ContinueWindowMac() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}
void ContinueWindowMac::ShowUi() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
base::mac::ScopedNSAutoreleasePool pool;
controller_.reset(
......@@ -68,7 +68,7 @@ void ContinueWindowMac::ShowUi() {
}
void ContinueWindowMac::HideUi() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
base::mac::ScopedNSAutoreleasePool pool;
[controller_ hide];
......
......@@ -54,7 +54,7 @@ ContinueWindowWin::~ContinueWindowWin() {
}
void ContinueWindowWin::ShowUi() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!hwnd_);
hwnd_ = CreateDialogParam(CURRENT_MODULE(), MAKEINTRESOURCE(IDD_CONTINUE),
......@@ -68,7 +68,7 @@ void ContinueWindowWin::ShowUi() {
}
void ContinueWindowWin::HideUi() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
EndDialog();
}
......@@ -91,7 +91,7 @@ BOOL CALLBACK ContinueWindowWin::DialogProc(HWND hwnd, UINT msg,
BOOL ContinueWindowWin::OnDialogMessage(HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
switch (msg) {
case WM_CLOSE:
......@@ -119,7 +119,7 @@ BOOL ContinueWindowWin::OnDialogMessage(HWND hwnd, UINT msg,
}
void ContinueWindowWin::EndDialog() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (hwnd_) {
::DestroyWindow(hwnd_);
......
......@@ -141,7 +141,7 @@ DisconnectWindowGtk::DisconnectWindowGtk()
}
DisconnectWindowGtk::~DisconnectWindowGtk() {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (disconnect_window_) {
gtk_widget_destroy(disconnect_window_);
......@@ -151,7 +151,7 @@ DisconnectWindowGtk::~DisconnectWindowGtk() {
void DisconnectWindowGtk::Start(
const base::WeakPtr<ClientSessionControl>& client_session_control) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!client_session_control_.get());
DCHECK(client_session_control.get());
DCHECK(!disconnect_window_);
......@@ -254,7 +254,7 @@ void DisconnectWindowGtk::Start(
}
void DisconnectWindowGtk::OnClicked(GtkButton* button) {
DCHECK(CalledOnValidThread());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (client_session_control_.get())
client_session_control_->DisconnectSession(protocol::OK);
......@@ -262,7 +262,7 @@ void DisconnectWindowGtk::OnClicked(GtkButton* button) {