Clean the callback after executed

This commit is contained in:
Cheng Zhao 2014-10-01 15:18:34 +08:00
parent ea28f518d3
commit 09678cc485
2 changed files with 6 additions and 6 deletions

View file

@ -159,7 +159,6 @@ void MediaCaptureDevicesDispatcher::OnAudioStreamStopped(
void MediaCaptureDevicesDispatcher::OnCreatingAudioStream(
int render_process_id,
int render_view_id) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
}
} // namespace brightray

View file

@ -189,11 +189,12 @@ void MediaStreamDevicesController::HandleUserMediaRequest() {
screen_id.ToString(), "Screen"));
}
callback_.Run(
devices,
devices.empty() ? content::MEDIA_DEVICE_INVALID_STATE :
content::MEDIA_DEVICE_OK,
scoped_ptr<content::MediaStreamUI>());
content::MediaResponseCallback cb = callback_;
callback_.Reset();
cb.Run(devices,
devices.empty() ? content::MEDIA_DEVICE_INVALID_STATE :
content::MEDIA_DEVICE_OK,
scoped_ptr<content::MediaStreamUI>());
}
} // namespace brightray