summaryrefslogtreecommitdiffstats
path: root/chrome/utility
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-08 10:54:24 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-08 10:54:24 +0000
commit1e8205e8dfbe4815dcf2d7094e0a676369b0b5ed (patch)
treed5206e42369310d8be496f4e3090b3214010a64b /chrome/utility
parent2561c0292448489063f9b583ac5d187126b66a5c (diff)
downloadchromium_src-1e8205e8dfbe4815dcf2d7094e0a676369b0b5ed.zip
chromium_src-1e8205e8dfbe4815dcf2d7094e0a676369b0b5ed.tar.gz
chromium_src-1e8205e8dfbe4815dcf2d7094e0a676369b0b5ed.tar.bz2
Only use safe browsing IPC messages when safe browsing is enabled.
Review URL: https://codereview.chromium.org/360893002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281713 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/utility')
-rw-r--r--chrome/utility/BUILD.gn5
-rw-r--r--chrome/utility/chrome_content_utility_client.cc4
-rw-r--r--chrome/utility/chrome_content_utility_client.h2
3 files changed, 11 insertions, 0 deletions
diff --git a/chrome/utility/BUILD.gn b/chrome/utility/BUILD.gn
index 76c73df7..4c79e8c5 100644
--- a/chrome/utility/BUILD.gn
+++ b/chrome/utility/BUILD.gn
@@ -13,6 +13,7 @@ gypi_values = exec_script(
static_library("utility") {
sources = rebase_path(gypi_values.chrome_utility_sources, ".", "..")
+ defines = []
deps = [
"//base",
@@ -89,4 +90,8 @@ static_library("utility") {
"local_discovery/service_discovery_message_handler.h",
]
}
+
+ if (safe_browsing_mode == 1) {
+ defines += [ "FULL_SAFE_BROWSING" ]
+ }
}
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc
index 327d38e..c7d189f 100644
--- a/chrome/utility/chrome_content_utility_client.cc
+++ b/chrome/utility/chrome_content_utility_client.cc
@@ -124,8 +124,10 @@ bool ChromeContentUtilityClient::OnMessageReceived(
IPC_MESSAGE_HANDLER(ChromeUtilityMsg_PatchFileCourgette,
OnPatchFileCourgette)
IPC_MESSAGE_HANDLER(ChromeUtilityMsg_StartupPing, OnStartupPing)
+#if defined(FULL_SAFE_BROWSING)
IPC_MESSAGE_HANDLER(ChromeUtilityMsg_AnalyzeZipFileForDownloadProtection,
OnAnalyzeZipFileForDownloadProtection)
+#endif
#if defined(ENABLE_EXTENSIONS)
IPC_MESSAGE_HANDLER(ChromeUtilityMsg_ParseMediaMetadata,
OnParseMediaMetadata)
@@ -286,6 +288,7 @@ void ChromeContentUtilityClient::OnStartupPing() {
// Don't release the process, we assume further messages are on the way.
}
+#if defined(FULL_SAFE_BROWSING)
void ChromeContentUtilityClient::OnAnalyzeZipFileForDownloadProtection(
const IPC::PlatformFileForTransit& zip_file) {
safe_browsing::zip_analyzer::Results results;
@@ -295,6 +298,7 @@ void ChromeContentUtilityClient::OnAnalyzeZipFileForDownloadProtection(
results));
ReleaseProcessIfNeeded();
}
+#endif
#if defined(ENABLE_EXTENSIONS)
// TODO(thestig): Try to move this to
diff --git a/chrome/utility/chrome_content_utility_client.h b/chrome/utility/chrome_content_utility_client.h
index 3e3de04..e701064 100644
--- a/chrome/utility/chrome_content_utility_client.h
+++ b/chrome/utility/chrome_content_utility_client.h
@@ -54,8 +54,10 @@ class ChromeContentUtilityClient : public content::ContentUtilityClient {
const base::FilePath& patch_file,
const base::FilePath& output_file);
void OnStartupPing();
+#if defined(FULL_SAFE_BROWSING)
void OnAnalyzeZipFileForDownloadProtection(
const IPC::PlatformFileForTransit& zip_file);
+#endif
#if defined(ENABLE_EXTENSIONS)
void OnParseMediaMetadata(const std::string& mime_type,
int64 total_size,