diff options
author | bryner@chromium.org <bryner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-14 18:43:58 +0000 |
---|---|---|
committer | bryner@chromium.org <bryner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-14 18:43:58 +0000 |
commit | f6fd9049914bd81b79dea8ef8a4787624e45459e (patch) | |
tree | 8a6368f2645d016b0bcdd080a598cddfa46deeed /chrome/utility | |
parent | ea530d0f531b43aa8ff9340d9c5cf5d6a85a4cf4 (diff) | |
download | chromium_src-f6fd9049914bd81b79dea8ef8a4787624e45459e.zip chromium_src-f6fd9049914bd81b79dea8ef8a4787624e45459e.tar.gz chromium_src-f6fd9049914bd81b79dea8ef8a4787624e45459e.tar.bz2 |
Move zip analysis for SafeBrowsing into a utility process.
BUG=165030
Review URL: https://chromiumcodereview.appspot.com/11775025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182500 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/utility')
-rw-r--r-- | chrome/utility/chrome_content_utility_client.cc | 19 | ||||
-rw-r--r-- | chrome/utility/chrome_content_utility_client.h | 4 |
2 files changed, 23 insertions, 0 deletions
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc index c3b4fea..2eac856 100644 --- a/chrome/utility/chrome_content_utility_client.cc +++ b/chrome/utility/chrome_content_utility_client.cc @@ -28,6 +28,7 @@ #include "chrome/common/extensions/manifest_handler.h" #include "chrome/common/extensions/unpacker.h" #include "chrome/common/extensions/update_manifest.h" +#include "chrome/common/safe_browsing/zip_analyzer.h" #include "chrome/common/web_resource/web_resource_unpacker.h" #include "chrome/common/zip.h" #include "chrome/utility/profile_import_handler.h" @@ -119,6 +120,9 @@ bool ChromeContentUtilityClient::OnMessageReceived( IPC_MESSAGE_HANDLER(ChromeUtilityMsg_ParseJSON, OnParseJSON) IPC_MESSAGE_HANDLER(ChromeUtilityMsg_GetPrinterCapsAndDefaults, OnGetPrinterCapsAndDefaults) + IPC_MESSAGE_HANDLER(ChromeUtilityMsg_StartupPing, OnStartupPing) + IPC_MESSAGE_HANDLER(ChromeUtilityMsg_AnalyzeZipFileForDownloadProtection, + OnAnalyzeZipFileForDownloadProtection) #if defined(OS_CHROMEOS) IPC_MESSAGE_HANDLER(ChromeUtilityMsg_CreateZipFile, OnCreateZipFile) @@ -479,4 +483,19 @@ void ChromeContentUtilityClient::OnGetPrinterCapsAndDefaults( content::UtilityThread::Get()->ReleaseProcessIfNeeded(); } +void ChromeContentUtilityClient::OnStartupPing() { + Send(new ChromeUtilityHostMsg_ProcessStarted); + // Don't release the process, we assume further messages are on the way. +} + +void ChromeContentUtilityClient::OnAnalyzeZipFileForDownloadProtection( + IPC::PlatformFileForTransit zip_file) { + safe_browsing::zip_analyzer::Results results; + safe_browsing::zip_analyzer::AnalyzeZipFile( + IPC::PlatformFileForTransitToPlatformFile(zip_file), &results); + Send(new ChromeUtilityHostMsg_AnalyzeZipFileForDownloadProtection_Finished( + results)); + content::UtilityThread::Get()->ReleaseProcessIfNeeded(); +} + } // namespace chrome diff --git a/chrome/utility/chrome_content_utility_client.h b/chrome/utility/chrome_content_utility_client.h index b28b86e..dc63a8f 100644 --- a/chrome/utility/chrome_content_utility_client.h +++ b/chrome/utility/chrome_content_utility_client.h @@ -9,6 +9,7 @@ #include "base/memory/scoped_ptr.h" #include "base/platform_file.h" #include "content/public/utility/content_utility_client.h" +#include "ipc/ipc_platform_file.h" #include "printing/pdf_render_settings.h" class Importer; @@ -85,6 +86,9 @@ class ChromeContentUtilityClient : public content::ContentUtilityClient { #endif // defined(OS_WIN) void OnGetPrinterCapsAndDefaults(const std::string& printer_name); + void OnStartupPing(); + void OnAnalyzeZipFileForDownloadProtection( + IPC::PlatformFileForTransit zip_file); scoped_ptr<ProfileImportHandler> import_handler_; }; |