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/extensions/startup_helper.h" | 5 #include "chrome/browser/extensions/startup_helper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 if (!temp_dir.CreateUniqueTempDir()) { | 174 if (!temp_dir.CreateUniqueTempDir()) { |
175 *error = std::string("Failed to create temp dir"); | 175 *error = std::string("Failed to create temp dir"); |
176 return false; | 176 return false; |
177 } | 177 } |
178 | 178 |
179 base::RunLoop run_loop; | 179 base::RunLoop run_loop; |
180 CRXFileInfo file(path); | 180 CRXFileInfo file(path); |
181 scoped_refptr<ValidateCrxHelper> helper( | 181 scoped_refptr<ValidateCrxHelper> helper( |
182 new ValidateCrxHelper(file, temp_dir.path(), &run_loop)); | 182 new ValidateCrxHelper(file, temp_dir.path(), &run_loop)); |
183 helper->Start(); | 183 helper->Start(); |
184 if (!helper->finished()) | 184 run_loop.Run(); |
185 run_loop.Run(); | |
186 | 185 |
187 bool success = helper->success(); | 186 bool success = helper->success(); |
188 if (!success) | 187 if (!success) |
189 *error = base::UTF16ToUTF8(helper->error()); | 188 *error = base::UTF16ToUTF8(helper->error()); |
190 return success; | 189 return success; |
191 } | 190 } |
192 | 191 |
193 StartupHelper::~StartupHelper() { | 192 StartupHelper::~StartupHelper() { |
194 if (pack_job_.get()) | 193 if (pack_job_.get()) |
195 pack_job_->ClearClient(); | 194 pack_job_->ClearClient(); |
196 } | 195 } |
197 | 196 |
198 } // namespace extensions | 197 } // namespace extensions |
OLD | NEW |