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

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

Issue 381553002: Update the CrxInstaller and UnpackedInstaller to use the ExtensionInstallChecker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved include to correct file Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extension_install_checker.h" 5 #include "chrome/browser/extensions/extension_install_checker.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/extensions/blacklist.h" 8 #include "chrome/browser/extensions/blacklist.h"
9 #include "chrome/browser/extensions/requirements_checker.h" 9 #include "chrome/browser/extensions/requirements_checker.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 failed_mask |= CHECK_MANAGEMENT_POLICY; 156 failed_mask |= CHECK_MANAGEMENT_POLICY;
157 157
158 // Invoke callback if all checks are complete or there was at least one 158 // Invoke callback if all checks are complete or there was at least one
159 // failure and |fail_fast_| is true. 159 // failure and |fail_fast_| is true.
160 if (!is_running() || (failed_mask && fail_fast_)) { 160 if (!is_running() || (failed_mask && fail_fast_)) {
161 // If we are failing fast, discard any pending results. 161 // If we are failing fast, discard any pending results.
162 weak_ptr_factory_.InvalidateWeakPtrs(); 162 weak_ptr_factory_.InvalidateWeakPtrs();
163 running_checks_ = 0; 163 running_checks_ = 0;
164 ++current_sequence_number_; 164 ++current_sequence_number_;
165 165
166 callback_.Run(failed_mask); 166 Callback callback_copy = callback_;
167 callback_.Reset(); 167 callback_.Reset();
168
169 // This instance may be owned by the callback recipient and deleted here,
170 // so reset |callback_| first and invoke a copy of the callback.
171 callback_copy.Run(failed_mask);
168 } 172 }
169 } 173 }
170 174
171 } // namespace extensions 175 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/crx_installer_browsertest.cc ('k') | chrome/browser/extensions/extension_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698