Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1349)

Unified Diff: chrome/browser/devtools/device/port_forwarding_controller.cc

Issue 1030263002: favor DCHECK_CURRENTLY_ON for better logs in chrome/browser/devtools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/devtools/device/port_forwarding_controller.cc
diff --git a/chrome/browser/devtools/device/port_forwarding_controller.cc b/chrome/browser/devtools/device/port_forwarding_controller.cc
index 25bdc39263671f7cac4e075430b2406670bb7a7e..35f0ebbfcd37fb7b14f7afbba883d84c53056c33 100644
--- a/chrome/browser/devtools/device/port_forwarding_controller.cc
+++ b/chrome/browser/devtools/device/port_forwarding_controller.cc
@@ -323,7 +323,7 @@ PortForwardingController::Connection::Connection(
connected_(false),
forwarding_map_(forwarding_map),
weak_factory_(this) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
controller_->registry_[browser->serial()] = this;
scoped_refptr<AndroidDeviceManager::Device> device(
controller_->bridge_->FindDevice(browser->serial()));
@@ -334,7 +334,7 @@ PortForwardingController::Connection::Connection(
}
PortForwardingController::Connection::~Connection() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(controller_->registry_.find(browser_->serial()) !=
controller_->registry_.end());
controller_->registry_.erase(browser_->serial());
@@ -342,7 +342,7 @@ PortForwardingController::Connection::~Connection() {
void PortForwardingController::Connection::UpdateForwardingMap(
const ForwardingMap& new_forwarding_map) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (connected_) {
SerializeChanges(tethering::unbind::kName,
new_forwarding_map, forwarding_map_);
@@ -356,7 +356,7 @@ void PortForwardingController::Connection::SerializeChanges(
const std::string& method,
const ForwardingMap& old_map,
const ForwardingMap& new_map) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
for (ForwardingMap::const_iterator new_it(new_map.begin());
new_it != new_map.end(); ++new_it) {
int port = new_it->first;
@@ -371,7 +371,7 @@ void PortForwardingController::Connection::SerializeChanges(
void PortForwardingController::Connection::SendCommand(
const std::string& method, int port) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
scoped_ptr<base::DictionaryValue> params(new base::DictionaryValue);
if (method == tethering::bind::kName) {
params->SetInteger(tethering::bind::kParamPort, port);
@@ -451,7 +451,7 @@ void PortForwardingController::Connection::UpdateSocketCountOnHandlerThread(
void PortForwardingController::Connection::UpdateSocketCount(
int port, int increment) {
#if defined(DEBUG_DEVTOOLS)
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
PortStatusMap::iterator it = port_status_.find(port);
if (it == port_status_.end())
return;
@@ -463,12 +463,12 @@ void PortForwardingController::Connection::UpdateSocketCount(
const PortForwardingController::PortStatusMap&
PortForwardingController::Connection::GetPortStatusMap() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
return port_status_;
}
void PortForwardingController::Connection::OnSocketOpened() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
connected_ = true;
SerializeChanges(tethering::bind::kName, ForwardingMap(), forwarding_map_);
}
@@ -479,7 +479,7 @@ void PortForwardingController::Connection::OnSocketClosed() {
void PortForwardingController::Connection::OnFrameRead(
const std::string& message) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (ProcessResponse(message))
return;

Powered by Google App Engine
This is Rietveld 408576698