| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_DOWNLOAD_QUARANTINE_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_QUARANTINE_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_QUARANTINE_H_ | 6 #define CONTENT_PUBLIC_COMMON_QUARANTINE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 | 11 |
| 12 class GURL; | 12 class GURL; |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class FilePath; | 15 class FilePath; |
| 16 } | 16 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // |source_url|: URL from which the file content was downloaded. | 71 // |source_url|: URL from which the file content was downloaded. |
| 72 // |referrer_url|: Referring URL. | 72 // |referrer_url|: Referring URL. |
| 73 // |client_guid|: Only used on Windows. Identifies the client application | 73 // |client_guid|: Only used on Windows. Identifies the client application |
| 74 // that downloaded the file. | 74 // that downloaded the file. |
| 75 CONTENT_EXPORT QuarantineFileResult | 75 CONTENT_EXPORT QuarantineFileResult |
| 76 QuarantineFile(const base::FilePath& file, | 76 QuarantineFile(const base::FilePath& file, |
| 77 const GURL& source_url, | 77 const GURL& source_url, |
| 78 const GURL& referrer_url, | 78 const GURL& referrer_url, |
| 79 const std::string& client_guid); | 79 const std::string& client_guid); |
| 80 | 80 |
| 81 // Determine if a file has quarantine metadata attached to it. |
| 82 // |
| 83 // If |source_url| is non-empty, then the download source URL in |
| 84 // quarantine metadata should match |source_url| exactly. The function returns |
| 85 // |false| if there is a mismatch. If |source_url| is empty, then this function |
| 86 // only checks for the existence of a download source URL in quarantine |
| 87 // metadata. |
| 88 // |
| 89 // If |referrer_url| is valid, then the download referrer URL in quarantine |
| 90 // metadata must match |referrer_url| exactly. The function returns |false| if |
| 91 // there is a mismatch in the |referrer_url| even if the |source_url| matches. |
| 92 // No referrer URL checks are performed if |referrer_url| is empty. |
| 93 // |
| 94 // If both |source_url| and |referrer_url|, then the funciton returns true if |
| 95 // any quarantine metadata is present for the file. |
| 96 // |
| 97 // **Note**: On Windows, this function only checks if the |ZoneIdentifier| |
| 98 // metadata is present. |source_url| and |referrer_url| are ignored. Windows |
| 99 // currently doesn't store individual URLs as part of the mark-of-the-web. |
| 100 CONTENT_EXPORT bool IsFileQuarantined(const base::FilePath& file, |
| 101 const GURL& source_url, |
| 102 const GURL& referrer_url); |
| 103 |
| 81 } // namespace content | 104 } // namespace content |
| 82 | 105 |
| 83 #endif // CONTENT_BROWSER_DOWNLOAD_QUARANTINE_H_ | 106 #endif // CONTENT_PUBLIC_COMMON_QUARANTINE_H_ |
| OLD | NEW |