OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/extensions/sandboxed_extension_unpacker.h" | 5 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/crypto/signature_verifier.h" | 10 #include "base/crypto/signature_verifier.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 ReportSuccess(); | 174 ReportSuccess(); |
175 } | 175 } |
176 | 176 |
177 void SandboxedExtensionUnpacker::OnUnpackExtensionFailed( | 177 void SandboxedExtensionUnpacker::OnUnpackExtensionFailed( |
178 const std::string& error) { | 178 const std::string& error) { |
179 DCHECK(BrowserThread::CurrentlyOn(thread_identifier_)); | 179 DCHECK(BrowserThread::CurrentlyOn(thread_identifier_)); |
180 got_response_ = true; | 180 got_response_ = true; |
181 ReportFailure(error); | 181 ReportFailure(error); |
182 } | 182 } |
183 | 183 |
184 void SandboxedExtensionUnpacker::OnProcessCrashed() { | 184 void SandboxedExtensionUnpacker::OnProcessCrashed(int exit_code) { |
185 // Don't report crashes if they happen after we got a response. | 185 // Don't report crashes if they happen after we got a response. |
186 if (got_response_) | 186 if (got_response_) |
187 return; | 187 return; |
188 | 188 |
189 ReportFailure("Utility process crashed while trying to install."); | 189 ReportFailure("Utility process crashed while trying to install."); |
190 } | 190 } |
191 | 191 |
192 bool SandboxedExtensionUnpacker::ValidateSignature() { | 192 bool SandboxedExtensionUnpacker::ValidateSignature() { |
193 ScopedStdioHandle file(file_util::OpenFile(crx_path_, "rb")); | 193 ScopedStdioHandle file(file_util::OpenFile(crx_path_, "rb")); |
194 if (!file.get()) { | 194 if (!file.get()) { |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 if (!file_util::WriteFile(path, | 415 if (!file_util::WriteFile(path, |
416 catalog_json.c_str(), | 416 catalog_json.c_str(), |
417 catalog_json.size())) { | 417 catalog_json.size())) { |
418 ReportFailure("Error saving catalog."); | 418 ReportFailure("Error saving catalog."); |
419 return false; | 419 return false; |
420 } | 420 } |
421 } | 421 } |
422 | 422 |
423 return true; | 423 return true; |
424 } | 424 } |
OLD | NEW |