Commit a7789369 authored by Tal Pressman's avatar Tal Pressman Committed by Commit Bot

Add GlobalRoutingID::operator<<.

This allows the use of, e.g.: CHECK_EQ(), making error messages clearer.

Change-Id: I0d087117e3da0cafc792ea7baa78c89febcec4ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2463281Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Commit-Queue: Tal Pressman <talp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816354}
parent 58073465
......@@ -8,6 +8,8 @@
#include <tuple>
#include "base/hash/hash.h"
#include "base/i18n/number_formatting.h"
#include "base/strings/stringprintf.h"
#include "ipc/ipc_message.h"
namespace content {
......@@ -38,6 +40,11 @@ struct GlobalRoutingID {
}
};
inline std::ostream& operator<<(std::ostream& os, const GlobalRoutingID& id) {
os << "GlobalRoutingID(" << id.child_id << ", " << id.route_id << ")";
return os;
}
// Same as GlobalRoutingID except the route_id must be a RenderFrameHost routing
// id.
struct GlobalFrameRoutingId {
......
......@@ -391,7 +391,7 @@ void WebContentsObserverConsistencyChecker::EnsureStableParentValue(
parent_ids_.insert(std::make_pair(routing_pair, parent_routing_pair));
} else {
GlobalRoutingID former_parent_routing_pair = it->second;
CHECK(former_parent_routing_pair == parent_routing_pair)
CHECK_EQ(former_parent_routing_pair, parent_routing_pair)
<< "RFH's parent value changed over time! That is really not good!";
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment