diff options
author | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-29 13:24:06 +0000 |
---|---|---|
committer | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-29 13:24:06 +0000 |
commit | 0e13f5c5de07a1a1339bd7776272b971e3604cfe (patch) | |
tree | c8d26637e1f9ef4f4993ffa78ed9622968e205c8 /content/browser/safe_util_win.h | |
parent | 532ae392e589f397b2c2ec702afdeac46cc38f77 (diff) | |
download | chromium_src-0e13f5c5de07a1a1339bd7776272b971e3604cfe.zip chromium_src-0e13f5c5de07a1a1339bd7776272b971e3604cfe.tar.gz chromium_src-0e13f5c5de07a1a1339bd7776272b971e3604cfe.tar.bz2 |
Handle the case where IAttachmentExecute::Save() deletes a downloaded file.
As a first step, mark the download as interrupted due to the file being blocked or due to the file being infected by a virus. The interrupt reason will be shown to the user in the downloads shelf and the downloads page.
BUG=155957
Review URL: https://chromiumcodereview.appspot.com/11150027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164632 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/safe_util_win.h')
-rw-r--r-- | content/browser/safe_util_win.h | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/content/browser/safe_util_win.h b/content/browser/safe_util_win.h index 8b21f7f..41acfd5 100644 --- a/content/browser/safe_util_win.h +++ b/content/browser/safe_util_win.h @@ -9,6 +9,7 @@ #include <windows.h> class FilePath; +class GURL; namespace win_util { @@ -40,16 +41,33 @@ bool SaferOpenItemViaShell(HWND hwnd, const std::wstring& window_title, const FilePath& full_path, const std::wstring& source_url); -// Sets the Zone Identifier on the file to "Internet" (3). Returns true if the -// function succeeds, false otherwise. A failure is expected on system where -// the Zone Identifier is not supported, like a machine with a FAT32 filesystem. -// It should not be considered fatal. -// -// |full_path| is the path to save the file to, and -// |source_url| is the URL where the file was downloaded from. -bool SetInternetZoneIdentifier(const FilePath& full_path, - const std::wstring& source_url); - +// Invokes IAttachmentExecute::Save to validate the downloaded file. The call +// may scan the file for viruses and if necessary, annotate it with evidence. As +// a result of the validation, the file may be deleted. See: +// http://msdn.microsoft.com/en-us/bb776299 +// +// If Attachment Execution Services is unavailable, then this function will +// attempt to manually annotate the file with security zone information. A +// failure code will be returned in this case even if the file is sucessfully +// annotated. +// +// IAE::Save() will delete the file if it was found to be blocked by local +// security policy or if it was found to be infected. The call may also delete +// the file due to other failures (http://crbug.com/153212). A failure code will +// be returned in these cases. +// +// Typical return values: +// S_OK : The file was okay. If any viruses were found, they were cleaned. +// E_FAIL : Virus infected. +// INET_E_SECURITY_PROBLEM : The file was blocked due to security policy. +// +// Any other return value indicates an unexpected error during the scan. +// +// |full_path| : is the path to the downloaded file. This should be the final +// path of the download. +// |source_url|: the source URL for the download. +HRESULT ScanAndSaveDownloadedFile(const FilePath& full_path, + const GURL& source_url); } // namespace win_util #endif // CONTENT_COMMON_SAFE_UTIL_WIN_H_ |