OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CHROME_BROWSER_SAFE_BROWSING_SANDBOXED_DMG_ANALYZER_MAC_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_SANDBOXED_DMG_ANALYZER_MAC_H_ |
6 #define CHROME_BROWSER_SAFE_BROWSING_SANDBOXED_DMG_ANALYZER_MAC_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_SANDBOXED_DMG_ANALYZER_MAC_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 // Called on the blocking pool, this opens the DMG file, in preparation for | 39 // Called on the blocking pool, this opens the DMG file, in preparation for |
40 // sending the FD to the utility process. | 40 // sending the FD to the utility process. |
41 void OpenDMGFile(); | 41 void OpenDMGFile(); |
42 | 42 |
43 // Called on the IO thread, this starts the utility process. | 43 // Called on the IO thread, this starts the utility process. |
44 void StartAnalysis(); | 44 void StartAnalysis(); |
45 | 45 |
46 // content::UtilityProcessHostClient: | 46 // content::UtilityProcessHostClient: |
47 void OnProcessCrashed(int exit_code) override; | 47 void OnProcessCrashed(int exit_code) override; |
48 void OnProcessLaunchFailed() override; | 48 void OnProcessLaunchFailed(int error_code) override; |
49 bool OnMessageReceived(const IPC::Message& message) override; | 49 bool OnMessageReceived(const IPC::Message& message) override; |
50 | 50 |
51 // Message handler to receive the results of the analysis. Invokes the | 51 // Message handler to receive the results of the analysis. Invokes the |
52 // |callback_|. | 52 // |callback_|. |
53 void OnAnalysisFinished(const zip_analyzer::Results& results); | 53 void OnAnalysisFinished(const zip_analyzer::Results& results); |
54 | 54 |
55 const base::FilePath file_path_; // The path of the DMG file. | 55 const base::FilePath file_path_; // The path of the DMG file. |
56 base::File file_; // The opened file handle for |file_path_|. | 56 base::File file_; // The opened file handle for |file_path_|. |
57 | 57 |
58 const ResultsCallback callback_; // Result callback. | 58 const ResultsCallback callback_; // Result callback. |
59 bool callback_called_; // Whether |callback_| has already been invoked. | 59 bool callback_called_; // Whether |callback_| has already been invoked. |
60 | 60 |
61 DISALLOW_COPY_AND_ASSIGN(SandboxedDMGAnalyzer); | 61 DISALLOW_COPY_AND_ASSIGN(SandboxedDMGAnalyzer); |
62 }; | 62 }; |
63 | 63 |
64 } // namespace safe_browsing | 64 } // namespace safe_browsing |
65 | 65 |
66 #endif // CHROME_BROWSER_SAFE_BROWSING_SANDBOXED_DMG_ANALYZER_MAC_H_ | 66 #endif // CHROME_BROWSER_SAFE_BROWSING_SANDBOXED_DMG_ANALYZER_MAC_H_ |
OLD | NEW |