OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Multiply-included message file, so no include guard. | 5 // Multiply-included message file, so no include guard. |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <Windows.h> | 8 #include <Windows.h> |
9 #endif // defined(OS_WIN) | 9 #endif // defined(OS_WIN) |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
16 #include "base/tuple.h" | 16 #include "base/tuple.h" |
17 #include "base/values.h" | 17 #include "base/values.h" |
18 #include "chrome/common/safe_browsing/zip_analyzer.h" | 18 #include "chrome/common/safe_browsing/zip_analyzer_results.h" |
19 #include "ipc/ipc_message_macros.h" | 19 #include "ipc/ipc_message_macros.h" |
20 #include "ipc/ipc_platform_file.h" | 20 #include "ipc/ipc_platform_file.h" |
21 #include "third_party/skia/include/core/SkBitmap.h" | 21 #include "third_party/skia/include/core/SkBitmap.h" |
22 #include "ui/gfx/ipc/gfx_param_traits.h" | 22 #include "ui/gfx/ipc/gfx_param_traits.h" |
23 | 23 |
| 24 #if defined(FULL_SAFE_BROWSING) |
| 25 #include "chrome/common/safe_browsing/ipc_protobuf_message_macros.h" |
| 26 #include "chrome/common/safe_browsing/protobuf_message_param_traits.h" |
| 27 #endif |
| 28 |
24 // Singly-included section for typedefs. | 29 // Singly-included section for typedefs. |
25 #ifndef CHROME_COMMON_CHROME_UTILITY_MESSAGES_H_ | 30 #ifndef CHROME_COMMON_CHROME_UTILITY_MESSAGES_H_ |
26 #define CHROME_COMMON_CHROME_UTILITY_MESSAGES_H_ | 31 #define CHROME_COMMON_CHROME_UTILITY_MESSAGES_H_ |
27 | 32 |
28 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
29 // A vector of filters, each being a Tuple containing a display string (i.e. | 34 // A vector of filters, each being a Tuple containing a display string (i.e. |
30 // "Text Files") and a filter pattern (i.e. "*.txt"). | 35 // "Text Files") and a filter pattern (i.e. "*.txt"). |
31 typedef std::vector<Tuple<base::string16, base::string16>> | 36 typedef std::vector<Tuple<base::string16, base::string16>> |
32 GetOpenFileNameFilter; | 37 GetOpenFileNameFilter; |
33 #endif // OS_WIN | 38 #endif // OS_WIN |
34 | 39 |
35 #endif // CHROME_COMMON_CHROME_UTILITY_MESSAGES_H_ | 40 #endif // CHROME_COMMON_CHROME_UTILITY_MESSAGES_H_ |
36 | 41 |
37 #define IPC_MESSAGE_START ChromeUtilityMsgStart | 42 #define IPC_MESSAGE_START ChromeUtilityMsgStart |
38 | 43 |
39 #if defined(FULL_SAFE_BROWSING) | 44 #if defined(FULL_SAFE_BROWSING) |
| 45 IPC_ENUM_TRAITS_VALIDATE( |
| 46 safe_browsing::ClientDownloadRequest_DownloadType, |
| 47 safe_browsing::ClientDownloadRequest_DownloadType_IsValid(value)) |
| 48 |
| 49 IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN(safe_browsing::ClientDownloadRequest_Digests) |
| 50 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(sha256) |
| 51 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(sha1) |
| 52 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(md5) |
| 53 IPC_PROTOBUF_MESSAGE_TRAITS_END() |
| 54 |
| 55 IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN( |
| 56 safe_browsing::ClientDownloadRequest_CertificateChain_Element) |
| 57 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(certificate) |
| 58 IPC_PROTOBUF_MESSAGE_TRAITS_END() |
| 59 |
| 60 IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN( |
| 61 safe_browsing::ClientDownloadRequest_CertificateChain) |
| 62 IPC_PROTOBUF_MESSAGE_TRAITS_REPEATED_COMPLEX_MEMBER(element) |
| 63 IPC_PROTOBUF_MESSAGE_TRAITS_END() |
| 64 |
| 65 IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN( |
| 66 safe_browsing::ClientDownloadRequest_SignatureInfo) |
| 67 IPC_PROTOBUF_MESSAGE_TRAITS_REPEATED_COMPLEX_MEMBER(certificate_chain) |
| 68 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_FUNDAMENTAL_MEMBER(trusted) |
| 69 IPC_PROTOBUF_MESSAGE_TRAITS_END() |
| 70 |
| 71 IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN( |
| 72 safe_browsing::ClientDownloadRequest_PEImageHeaders_DebugData) |
| 73 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(directory_entry) |
| 74 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(raw_data) |
| 75 IPC_PROTOBUF_MESSAGE_TRAITS_END() |
| 76 |
| 77 IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN( |
| 78 safe_browsing::ClientDownloadRequest_PEImageHeaders) |
| 79 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(dos_header) |
| 80 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(file_header) |
| 81 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(optional_headers32) |
| 82 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(optional_headers64) |
| 83 IPC_PROTOBUF_MESSAGE_TRAITS_REPEATED_COMPLEX_MEMBER(section_header) |
| 84 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(export_section_data) |
| 85 IPC_PROTOBUF_MESSAGE_TRAITS_REPEATED_COMPLEX_MEMBER(debug_data) |
| 86 IPC_PROTOBUF_MESSAGE_TRAITS_END() |
| 87 |
| 88 IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN( |
| 89 safe_browsing::ClientDownloadRequest_ImageHeaders) |
| 90 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(pe_headers) |
| 91 IPC_PROTOBUF_MESSAGE_TRAITS_END() |
| 92 |
| 93 IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN( |
| 94 safe_browsing::ClientDownloadRequest_ArchivedBinary) |
| 95 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(file_basename) |
| 96 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_FUNDAMENTAL_MEMBER(download_type) |
| 97 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(digests) |
| 98 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_FUNDAMENTAL_MEMBER(length) |
| 99 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(signature) |
| 100 IPC_PROTOBUF_MESSAGE_TRAITS_OPTIONAL_COMPLEX_MEMBER(image_headers) |
| 101 IPC_PROTOBUF_MESSAGE_TRAITS_END() |
| 102 |
40 IPC_STRUCT_TRAITS_BEGIN(safe_browsing::zip_analyzer::Results) | 103 IPC_STRUCT_TRAITS_BEGIN(safe_browsing::zip_analyzer::Results) |
41 IPC_STRUCT_TRAITS_MEMBER(success) | 104 IPC_STRUCT_TRAITS_MEMBER(success) |
42 IPC_STRUCT_TRAITS_MEMBER(has_executable) | 105 IPC_STRUCT_TRAITS_MEMBER(has_executable) |
43 IPC_STRUCT_TRAITS_MEMBER(has_archive) | 106 IPC_STRUCT_TRAITS_MEMBER(has_archive) |
| 107 IPC_STRUCT_TRAITS_MEMBER(archived_binary) |
44 IPC_STRUCT_TRAITS_END() | 108 IPC_STRUCT_TRAITS_END() |
45 #endif | 109 #endif // FULL_SAFE_BROWSING |
46 | 110 |
47 #if defined(OS_WIN) | 111 #if defined(OS_WIN) |
48 IPC_STRUCT_BEGIN(ChromeUtilityMsg_GetSaveFileName_Params) | 112 IPC_STRUCT_BEGIN(ChromeUtilityMsg_GetSaveFileName_Params) |
49 IPC_STRUCT_MEMBER(HWND, owner) | 113 IPC_STRUCT_MEMBER(HWND, owner) |
50 IPC_STRUCT_MEMBER(DWORD, flags) | 114 IPC_STRUCT_MEMBER(DWORD, flags) |
51 IPC_STRUCT_MEMBER(GetOpenFileNameFilter, filters) | 115 IPC_STRUCT_MEMBER(GetOpenFileNameFilter, filters) |
52 IPC_STRUCT_MEMBER(int, one_based_filter_index) | 116 IPC_STRUCT_MEMBER(int, one_based_filter_index) |
53 IPC_STRUCT_MEMBER(base::FilePath, suggested_filename) | 117 IPC_STRUCT_MEMBER(base::FilePath, suggested_filename) |
54 IPC_STRUCT_MEMBER(base::FilePath, initial_directory) | 118 IPC_STRUCT_MEMBER(base::FilePath, initial_directory) |
55 IPC_STRUCT_MEMBER(base::string16, default_extension) | 119 IPC_STRUCT_MEMBER(base::string16, default_extension) |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 base::FileDescriptor /* dest_fd */) | 162 base::FileDescriptor /* dest_fd */) |
99 #endif // defined(OS_CHROMEOS) | 163 #endif // defined(OS_CHROMEOS) |
100 | 164 |
101 // Requests the utility process to respond with a | 165 // Requests the utility process to respond with a |
102 // ChromeUtilityHostMsg_ProcessStarted message once it has started. This may | 166 // ChromeUtilityHostMsg_ProcessStarted message once it has started. This may |
103 // be used if the host process needs a handle to the running utility process. | 167 // be used if the host process needs a handle to the running utility process. |
104 IPC_MESSAGE_CONTROL0(ChromeUtilityMsg_StartupPing) | 168 IPC_MESSAGE_CONTROL0(ChromeUtilityMsg_StartupPing) |
105 | 169 |
106 #if defined(FULL_SAFE_BROWSING) | 170 #if defined(FULL_SAFE_BROWSING) |
107 // Tells the utility process to analyze a zip file for malicious download | 171 // Tells the utility process to analyze a zip file for malicious download |
108 // protection. | 172 // protection, providing a file that can be used temporarily to analyze binaries |
109 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_AnalyzeZipFileForDownloadProtection, | 173 // contained therein. |
110 IPC::PlatformFileForTransit /* zip_file */) | 174 IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_AnalyzeZipFileForDownloadProtection, |
| 175 IPC::PlatformFileForTransit /* zip_file */, |
| 176 IPC::PlatformFileForTransit /* temp_file */) |
111 #endif | 177 #endif |
112 | 178 |
113 #if defined(OS_WIN) | 179 #if defined(OS_WIN) |
114 // Invokes ui::base::win::OpenFileViaShell from the utility process. | 180 // Invokes ui::base::win::OpenFileViaShell from the utility process. |
115 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_OpenFileViaShell, | 181 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_OpenFileViaShell, |
116 base::FilePath /* full_path */) | 182 base::FilePath /* full_path */) |
117 | 183 |
118 // Invokes ui::base::win::OpenFolderViaShell from the utility process. | 184 // Invokes ui::base::win::OpenFolderViaShell from the utility process. |
119 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_OpenFolderViaShell, | 185 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_OpenFolderViaShell, |
120 base::FilePath /* full_path */) | 186 base::FilePath /* full_path */) |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 #endif // defined(OS_WIN) | 275 #endif // defined(OS_WIN) |
210 | 276 |
211 #if defined(OS_ANDROID) | 277 #if defined(OS_ANDROID) |
212 // Reply to ChromeUtilityMsg_DetectSeccompSupport to report the level | 278 // Reply to ChromeUtilityMsg_DetectSeccompSupport to report the level |
213 // of kernel support for seccomp-bpf. | 279 // of kernel support for seccomp-bpf. |
214 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_DetectSeccompSupport_ResultPrctl, | 280 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_DetectSeccompSupport_ResultPrctl, |
215 bool /* seccomp prctl supported */) | 281 bool /* seccomp prctl supported */) |
216 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_DetectSeccompSupport_ResultSyscall, | 282 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_DetectSeccompSupport_ResultSyscall, |
217 bool /* seccomp syscall supported */) | 283 bool /* seccomp syscall supported */) |
218 #endif | 284 #endif |
OLD | NEW |