Commit 4bbb4bdb authored by tfarina's avatar tfarina Committed by Commit bot

drive: Do not rely on argument-dependent lookup when calling MD5DigestToBase16().

Looks like C++ compiler is able to figure out that this function is on
base namespace by deducing this from the dependent type base::MD5Digest.

For more reference on ADL:
http://en.wikipedia.org/wiki/Argument-dependent_name_lookup
http://stackoverflow.com/questions/8111677/what-is-argument-dependent-lookup-aka-adl-or-koenig-lookup

I found this while doing https://codereview.chromium.org/1099453002/.

The error is like the following:

../../chrome/browser/drive/drive_api_util.cc:171:10: error: use of
undeclared identifier 'MD5DigestToBase16'; did you mean
'base::MD5DigestToBase16'?
  return MD5DigestToBase16(digest);
           ^~~~~~~~~~~~~~~~~
           base::MD5DigestToBase16

Log:
http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_rel/builds/81070/steps/compile/logs/stdio

BUG=None
R=hashimoto@chromium.org

Review URL: https://codereview.chromium.org/1088593005

Cr-Commit-Position: refs/heads/master@{#326949}
parent a5319cfb
......@@ -168,7 +168,7 @@ std::string GetMd5Digest(const base::FilePath& file_path,
base::MD5Digest digest;
base::MD5Final(&digest, &context);
return MD5DigestToBase16(digest);
return base::MD5DigestToBase16(digest);
}
FileStreamMd5Digester::FileStreamMd5Digester()
......@@ -207,7 +207,7 @@ void FileStreamMd5Digester::OnChunkRead(const ResultCallback& callback,
// EOF.
base::MD5Digest digest;
base::MD5Final(&digest, &md5_context_);
std::string result = MD5DigestToBase16(digest);
std::string result = base::MD5DigestToBase16(digest);
callback.Run(result);
return;
}
......
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