Commit 8de5a82d authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Remove variable shadowing in blink/modules/credentialmanager

In an effort to reduce or even ban variable shadowing, this renames
a variable to avoid such shadowing. I'm interested in prohibiting
shadowing because I think it might prevent potential jumbo problems.

The exact error this avoids is:
third_party/blink/renderer/modules/credentialmanager/credentials_container.cc:180:23: error: declaration shadows a local variable [-Werror,-Wshadow]
    OriginAccessEntry access_entry(
                      ^
third_party/blink/renderer/modules/credentialmanager/credentials_container.cc:166:21: note: previous declaration is here
  OriginAccessEntry access_entry(
                    ^

Bug: 923510
Change-Id: I61b11ecd489ed9842e1a9ebee9293050f7f1cde5
Reviewed-on: https://chromium-review.googlesource.com/c/1478890Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#633742}
parent 19b3d662
......@@ -163,10 +163,14 @@ bool CheckPublicKeySecurityRequirements(ScriptPromiseResolver* resolver,
// TODO(crbug.com/803077): Avoid constructing an OriginAccessEntry just
// for the IP address check.
OriginAccessEntry access_entry(
origin->Protocol(), effective_domain,
network::mojom::CorsOriginAccessMatchMode::kAllowSubdomains);
if (effective_domain.IsEmpty() || access_entry.HostIsIPAddress()) {
bool reject_because_invalid_domain = effective_domain.IsEmpty();
if (!reject_because_invalid_domain) {
OriginAccessEntry access_entry(
origin->Protocol(), effective_domain,
network::mojom::CorsOriginAccessMatchMode::kAllowSubdomains);
reject_because_invalid_domain = access_entry.HostIsIPAddress();
}
if (reject_because_invalid_domain) {
resolver->Reject(
DOMException::Create(DOMExceptionCode::kSecurityError,
"Effective domain is not a valid domain."));
......
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