}
void BrailleControllerImpl::TryLoadLibBrlApi() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (libbrlapi_loader_.loaded())
return;
// These versions of libbrlapi work the same for the functions we
}
scoped_ptr<DisplayState> BrailleControllerImpl::GetDisplayState() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
StartConnecting();
scoped_ptr<DisplayState> display_state(new DisplayState);
if (connection_.get() && connection_->Connected()) {
}
void BrailleControllerImpl::WriteDots(const std::string& cells) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (connection_ && connection_->Connected()) {
size_t size;
if (!connection_->GetDisplaySize(&size)) {
}
void BrailleControllerImpl::AddObserver(BrailleObserver* observer) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(
&BrailleControllerImpl::StartConnecting,
}
void BrailleControllerImpl::RemoveObserver(BrailleObserver* observer) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
observers_.RemoveObserver(observer);
}
}
void BrailleControllerImpl::StartConnecting() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (started_connecting_)
return;
started_connecting_ = true;
}
void BrailleControllerImpl::StartWatchingSocketDirOnFileThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
base::FilePath brlapi_dir(BRLAPI_SOCKETPATH);
if (!file_path_watcher_.Watch(
brlapi_dir, false, base::Bind(
void BrailleControllerImpl::OnSocketDirChangedOnFileThread(
const base::FilePath& path, bool error) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
if (error) {
LOG(ERROR) << "Error watching brlapi directory: " << path.value();
return;
}
void BrailleControllerImpl::OnSocketDirChangedOnIOThread() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
VLOG(1) << "BrlAPI directory changed";
// Every directory change resets the max retry time to the appropriate delay
// into the future.
}
void BrailleControllerImpl::TryToConnect() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(libbrlapi_loader_.loaded());
connect_scheduled_ = false;
if (!connection_.get())
}
void BrailleControllerImpl::ResetRetryConnectHorizon() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
retry_connect_horizon_ = Time::Now() + TimeDelta::FromMilliseconds(
kConnectRetryTimeout);
}
void BrailleControllerImpl::ScheduleTryToConnect() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
TimeDelta delay(TimeDelta::FromMilliseconds(kConnectionDelayMs));
// Don't reschedule if there's already a connect scheduled or
// the next attempt would fall outside of the retry limit.
}
void BrailleControllerImpl::Disconnect() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!connection_ || !connection_->Connected())
return;
connection_->Disconnect();