Chromium Code Reviews| Index: content/public/common/quarantine.h |
| diff --git a/content/browser/download/quarantine.h b/content/public/common/quarantine.h |
| similarity index 70% |
| rename from content/browser/download/quarantine.h |
| rename to content/public/common/quarantine.h |
| index 6d6e492dbefcb2cdc6d44661c401ad6f3a173886..6afd135c9655843e1969f4c176a95fd29c40d6eb 100644 |
| --- a/content/browser/download/quarantine.h |
| +++ b/content/public/common/quarantine.h |
| @@ -2,8 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CONTENT_BROWSER_DOWNLOAD_QUARANTINE_H_ |
| -#define CONTENT_BROWSER_DOWNLOAD_QUARANTINE_H_ |
| +#ifndef CONTENT_PUBLIC_COMMON_QUARANTINE_H_ |
| +#define CONTENT_PUBLIC_COMMON_QUARANTINE_H_ |
| #include <string> |
| @@ -78,6 +78,29 @@ QuarantineFile(const base::FilePath& file, |
| const GURL& referrer_url, |
| const std::string& client_guid); |
| +// Determine if a file has quarantine metadata attached to it. |
| +// |
| +// If |source_url| is non-empty, then the download source URL in |
| +// quarantine metadata should match |source_url| exactly. The function returns |
| +// |false| if there is a mismatch. If |source_url| is empty, then this function |
| +// only checks for the existence of a download source URL in quarantine |
| +// metadata. |
| +// |
| +// If |referrer_url| is valid, then the download referrer URL in quarantine |
| +// metadata must match |referrer_url| exactly. The function returns |false| if |
| +// there is a mismatch in the |referrer_url| even if the |source_url| matches. |
| +// No referrer URL checks are performed if |referrer_url| is empty. |
| +// |
| +// If both |source_url| and |referrer_url|, then the funciton returns true if |
| +// any quarantine metadata is prsent for the file. |
|
brettw
2016/12/06 22:48:42
prsent -> present
asanka
2016/12/08 15:13:29
Done.
|
| +// |
| +// **Note**: On Windows, this function only checks if the |ZoneIdentifier| |
| +// metadata is present. |source_url| and |referrer_url| are ignored. Windows |
| +// currently doesn't store individual URLs as part of the mark-of-the-web. |
| +CONTENT_EXPORT bool IsFileQuarantined(const base::FilePath& file, |
| + const GURL& source_url, |
| + const GURL& referrer_url); |
| + |
| } // namespace content |
| -#endif // CONTENT_BROWSER_DOWNLOAD_QUARANTINE_H_ |
| +#endif // CONTENT_PUBLIC_COMMON_QUARANTINE_H_ |