Add comment discouraging using SchemeHostPort::GetURL

This method shouldn't be used to get a URL just to look at its scheme / host / port.

Change-Id: I0a0b9ceca283c4c3b75145fd495e44a458d17e40
Auto-Submit: Charlie Harrison <>
Reviewed-by: Daniel Cheng <>
Commit-Queue: Charlie Harrison <>
Cr-Commit-Position: refs/heads/main@{#1002649}
GitOrigin-RevId: 69b3b9bf0aec680bb3d42945cf2d1ca41146dbd7
diff --git a/scheme_host_port.h b/scheme_host_port.h
index e588858..fbe2962 100644
--- a/scheme_host_port.h
+++ b/scheme_host_port.h
@@ -133,7 +133,10 @@
   std::string Serialize() const;
   // Efficiently returns what GURL(Serialize()) would return, without needing to
-  // re-parse the URL.
+  // re-parse the URL. Note: this still performs allocations to copy data into
+  // GURL, so please avoid using this method if you only need to work on
+  // schemes, hosts, or ports individually.
+  // For example, see
   GURL GetURL() const;
   // Two SchemeHostPort objects are "equal" iff their schemes, hosts, and ports