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

Unified Diff: services/ui/ws/server_window.cc

Issue 2257503002: Improve some debug tools for mus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_mash
Patch Set: . Created 4 years, 4 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: services/ui/ws/server_window.cc
diff --git a/services/ui/ws/server_window.cc b/services/ui/ws/server_window.cc
index ad93327070e5dbf753b81401ef548a98ee115f0f..a87a027243e755ff15c7b0132998c1e7c30c483f 100644
--- a/services/ui/ws/server_window.cc
+++ b/services/ui/ws/server_window.cc
@@ -381,21 +381,25 @@ void ServerWindow::SetUnderlayOffset(const gfx::Vector2d& offset) {
delegate_->OnScheduleWindowPaint(this);
}
-#if !defined(NDEBUG)
+#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
std::string ServerWindow::GetDebugWindowHierarchy() const {
std::string result;
BuildDebugInfo(std::string(), &result);
return result;
}
-void ServerWindow::BuildDebugInfo(const std::string& depth,
- std::string* result) const {
+std::string ServerWindow::GetDebugWindowInfo() const {
std::string name = GetName();
- *result += base::StringPrintf(
- "%sid=%d,%d visible=%s bounds=%d,%d %dx%d %s\n", depth.c_str(),
- static_cast<int>(id_.client_id), static_cast<int>(id_.window_id),
+ return base::StringPrintf(
+ "id=%u:%u visible=%s bounds=%d,%d %dx%d %s", id_.client_id, id_.window_id,
sky 2016/08/17 19:01:05 id_.ToString() ?
kylechar 2016/08/17 19:10:12 Done.
visible_ ? "true" : "false", bounds_.x(), bounds_.y(), bounds_.width(),
bounds_.height(), !name.empty() ? name.c_str() : "(no name)");
+}
+
+void ServerWindow::BuildDebugInfo(const std::string& depth,
+ std::string* result) const {
+ *result +=
+ base::StringPrintf("%s%s\n", depth.c_str(), GetDebugWindowInfo().c_str());
for (const ServerWindow* child : children_)
child->BuildDebugInfo(depth + " ", result);
}

Powered by Google App Engine
This is Rietveld 408576698