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

Side by Side Diff: chrome/browser/extensions/sandboxed_extension_unpacker.cc

Issue 3386014: This adds some plumbing for propagating the status and error code of a (Closed)
Patch Set: Fixed Mac code to handle both SEGV and BUS Created 10 years, 2 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 (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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 ReportSuccess(); 163 ReportSuccess();
164 } 164 }
165 165
166 void SandboxedExtensionUnpacker::OnUnpackExtensionFailed( 166 void SandboxedExtensionUnpacker::OnUnpackExtensionFailed(
167 const std::string& error) { 167 const std::string& error) {
168 DCHECK(ChromeThread::CurrentlyOn(thread_identifier_)); 168 DCHECK(ChromeThread::CurrentlyOn(thread_identifier_));
169 got_response_ = true; 169 got_response_ = true;
170 ReportFailure(error); 170 ReportFailure(error);
171 } 171 }
172 172
173 void SandboxedExtensionUnpacker::OnProcessCrashed() { 173 void SandboxedExtensionUnpacker::OnProcessCrashed(int exit_code) {
174 // Don't report crashes if they happen after we got a response. 174 // Don't report crashes if they happen after we got a response.
175 if (got_response_) 175 if (got_response_)
176 return; 176 return;
177 177
178 ReportFailure("Utility process crashed while trying to install."); 178 ReportFailure("Utility process crashed while trying to install.");
179 } 179 }
180 180
181 bool SandboxedExtensionUnpacker::ValidateSignature() { 181 bool SandboxedExtensionUnpacker::ValidateSignature() {
182 ScopedStdioHandle file(file_util::OpenFile(crx_path_, "rb")); 182 ScopedStdioHandle file(file_util::OpenFile(crx_path_, "rb"));
183 if (!file.get()) { 183 if (!file.get()) {
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 if (!file_util::WriteFile(path, 400 if (!file_util::WriteFile(path,
401 catalog_json.c_str(), 401 catalog_json.c_str(),
402 catalog_json.size())) { 402 catalog_json.size())) {
403 ReportFailure("Error saving catalog."); 403 ReportFailure("Error saving catalog.");
404 return false; 404 return false;
405 } 405 }
406 } 406 }
407 407
408 return true; 408 return true;
409 } 409 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/sandboxed_extension_unpacker.h ('k') | chrome/browser/importer/importer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698