Commit 4b7e529f authored by David Van Cleve's avatar David Van Cleve Committed by Commit Bot

net: Add a comment explaining a precondition to SetHeaderIfMissing

http://crrev.com/c/2270354 added a comment to
net::HttpRequestHeaders::SetHeader explaining that the caller needs to
guarantee that both arguments satisfy validity preconditions. This
change copies the comment to SetHeaderIfMissing, which enforces the same
preconditions.

R=mmenke

Bug: 1105745
Change-Id: I11c2c9e8329c349b3cd77c3dd673fc96ea34612e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2300603
Auto-Submit: David Van Cleve <davidvc@chromium.org>
Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Commit-Queue: David Van Cleve <davidvc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#788893}
parent 0c268908
......@@ -130,6 +130,9 @@ class NET_EXPORT HttpRequestHeaders {
// Sets the header value pair for |key| and |value|, if |key| does not exist.
// If |key| already exists, the call is a no-op.
// When comparing |key|, case is ignored.
//
// The caller must ensure that |key| passes HttpUtil::IsValidHeaderName() and
// |value| passes HttpUtil::IsValidHeaderValue().
void SetHeaderIfMissing(const base::StringPiece& key,
const base::StringPiece& value);
......
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