Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(959)

Side by Side Diff: chrome/browser/safe_browsing/sandboxed_dmg_analyzer_mac.cc

Issue 1923653002: Wire up process launch error codes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix debug and clang Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "chrome/browser/safe_browsing/sandboxed_dmg_analyzer_mac.h" 5 #include "chrome/browser/safe_browsing/sandboxed_dmg_analyzer_mac.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "chrome/common/chrome_utility_messages.h" 10 #include "chrome/common/chrome_utility_messages.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 IDS_UTILITY_PROCESS_SAFE_BROWSING_ZIP_FILE_ANALYZER_NAME)); 66 IDS_UTILITY_PROCESS_SAFE_BROWSING_ZIP_FILE_ANALYZER_NAME));
67 utility_process_host->Send( 67 utility_process_host->Send(
68 new ChromeUtilityMsg_AnalyzeDmgFileForDownloadProtection( 68 new ChromeUtilityMsg_AnalyzeDmgFileForDownloadProtection(
69 IPC::TakePlatformFileForTransit(std::move(file_)))); 69 IPC::TakePlatformFileForTransit(std::move(file_))));
70 } 70 }
71 71
72 void SandboxedDMGAnalyzer::OnProcessCrashed(int exit_code) { 72 void SandboxedDMGAnalyzer::OnProcessCrashed(int exit_code) {
73 OnAnalysisFinished(zip_analyzer::Results()); 73 OnAnalysisFinished(zip_analyzer::Results());
74 } 74 }
75 75
76 void SandboxedDMGAnalyzer::OnProcessLaunchFailed() { 76 void SandboxedDMGAnalyzer::OnProcessLaunchFailed(int error_code) {
77 OnAnalysisFinished(zip_analyzer::Results()); 77 OnAnalysisFinished(zip_analyzer::Results());
78 } 78 }
79 79
80 bool SandboxedDMGAnalyzer::OnMessageReceived(const IPC::Message& message) { 80 bool SandboxedDMGAnalyzer::OnMessageReceived(const IPC::Message& message) {
81 bool handled = true; 81 bool handled = true;
82 IPC_BEGIN_MESSAGE_MAP(SandboxedDMGAnalyzer, message) 82 IPC_BEGIN_MESSAGE_MAP(SandboxedDMGAnalyzer, message)
83 IPC_MESSAGE_HANDLER( 83 IPC_MESSAGE_HANDLER(
84 ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished, 84 ChromeUtilityHostMsg_AnalyzeDmgFileForDownloadProtection_Finished,
85 OnAnalysisFinished) 85 OnAnalysisFinished)
86 IPC_MESSAGE_UNHANDLED(handled = false) 86 IPC_MESSAGE_UNHANDLED(handled = false)
87 IPC_END_MESSAGE_MAP() 87 IPC_END_MESSAGE_MAP()
88 return handled; 88 return handled;
89 } 89 }
90 90
91 void SandboxedDMGAnalyzer::OnAnalysisFinished( 91 void SandboxedDMGAnalyzer::OnAnalysisFinished(
92 const zip_analyzer::Results& results) { 92 const zip_analyzer::Results& results) {
93 DCHECK_CURRENTLY_ON(BrowserThread::IO); 93 DCHECK_CURRENTLY_ON(BrowserThread::IO);
94 if (callback_called_) 94 if (callback_called_)
95 return; 95 return;
96 96
97 callback_called_ = true; 97 callback_called_ = true;
98 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 98 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
99 base::Bind(callback_, results)); 99 base::Bind(callback_, results));
100 } 100 }
101 101
102 } // namespace safe_browsing 102 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/sandboxed_dmg_analyzer_mac.h ('k') | chrome/browser/safe_browsing/sandboxed_zip_analyzer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698