Moving DEBUG_ALIAS_FOR_CSTR into //base/debug/alias.h
DEBUG_ALIAS_FOR_CSTR was introduced in r527458 as a helper macro
for implementing DEBUG_ALIAS_FOR_ORIGIN. This CL moves the
DEBUG_ALIAS_FOR_CSTR macrodefinition into //base/debug/alias.h.
Additionally, the CL:
- Uses the DEBUG_ALIAS_FOR_CSTR macro to replace some existing uses of
base::debug::Alias + strlcpu
- Introduces DEBUG_ALIAS_FOR_GURL macro (and unittests) and uses it in 5
places (where base::debug::Alias + strlcpy was used before)
Bug: 797968
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: I986ea90243f58768177a9ea68a7e2440eaa317c4
Reviewed-on: https://chromium-review.googlesource.com/857815
Commit-Queue: Ćukasz Anforowicz <[email protected]>
Reviewed-by: vmpstr <[email protected]>
Reviewed-by: Victor Costan <[email protected]>
Reviewed-by: Alex Moshchuk <[email protected]>
Reviewed-by: Finnur Thorarinsson <[email protected]>
Reviewed-by: Matt Menke <[email protected]>
Reviewed-by: Brett Wilson <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Cr-Commit-Position: refs/heads/master@{#529155}
diff --git a/url/gurl_unittest.cc b/url/gurl_unittest.cc
index 3fe78d3..cb4d165 100644
--- a/url/gurl_unittest.cc
+++ b/url/gurl_unittest.cc
@@ -886,4 +886,10 @@
}
}
+TEST(GURLTest, DebugAlias) {
+ GURL url("https://foo.com/bar");
+ DEBUG_ALIAS_FOR_GURL(url_debug_alias, url);
+ EXPECT_STREQ("https://foo.com/bar", url_debug_alias);
+}
+
} // namespace url