| 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 #include "chrome/browser/component_updater/component_updater_service.h" | 5 #include "chrome/browser/component_updater/component_updater_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 // the files created. | 922 // the files created. |
| 923 void CrxUpdateService::Install(const CRXContext* context, | 923 void CrxUpdateService::Install(const CRXContext* context, |
| 924 const base::FilePath& crx_path) { | 924 const base::FilePath& crx_path) { |
| 925 // This function owns the |crx_path| and the |context| object. | 925 // This function owns the |crx_path| and the |context| object. |
| 926 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 926 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 927 ComponentUnpacker unpacker(context->pk_hash, | 927 ComponentUnpacker unpacker(context->pk_hash, |
| 928 crx_path, | 928 crx_path, |
| 929 context->fingerprint, | 929 context->fingerprint, |
| 930 component_patcher_.get(), | 930 component_patcher_.get(), |
| 931 context->installer); | 931 context->installer); |
| 932 if (!base::Delete(crx_path, false)) | 932 if (!base::DeleteFile(crx_path, false)) |
| 933 NOTREACHED() << crx_path.value(); | 933 NOTREACHED() << crx_path.value(); |
| 934 // Why unretained? See comment at top of file. | 934 // Why unretained? See comment at top of file. |
| 935 BrowserThread::PostDelayedTask( | 935 BrowserThread::PostDelayedTask( |
| 936 BrowserThread::UI, | 936 BrowserThread::UI, |
| 937 FROM_HERE, | 937 FROM_HERE, |
| 938 base::Bind(&CrxUpdateService::DoneInstalling, base::Unretained(this), | 938 base::Bind(&CrxUpdateService::DoneInstalling, base::Unretained(this), |
| 939 context->id, unpacker.error(), unpacker.extended_error()), | 939 context->id, unpacker.error(), unpacker.extended_error()), |
| 940 base::TimeDelta::FromMilliseconds(config_->StepDelay())); | 940 base::TimeDelta::FromMilliseconds(config_->StepDelay())); |
| 941 delete context; | 941 delete context; |
| 942 } | 942 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 ScheduleNextRun(false); | 984 ScheduleNextRun(false); |
| 985 } | 985 } |
| 986 | 986 |
| 987 // The component update factory. Using the component updater as a singleton | 987 // The component update factory. Using the component updater as a singleton |
| 988 // is the job of the browser process. | 988 // is the job of the browser process. |
| 989 ComponentUpdateService* ComponentUpdateServiceFactory( | 989 ComponentUpdateService* ComponentUpdateServiceFactory( |
| 990 ComponentUpdateService::Configurator* config) { | 990 ComponentUpdateService::Configurator* config) { |
| 991 DCHECK(config); | 991 DCHECK(config); |
| 992 return new CrxUpdateService(config); | 992 return new CrxUpdateService(config); |
| 993 } | 993 } |
| OLD | NEW |