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

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

Issue 2495123003: Continue attempts to reinstall corrupt policy extensions across restarts (Closed)
Patch Set: cleanup Created 4 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/chrome_content_verifier_delegate.h" 5 #include "chrome/browser/extensions/chrome_content_verifier_delegate.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 ContentVerifyJob::FailureReason reason) { 168 ContentVerifyJob::FailureReason reason) {
169 ExtensionRegistry* registry = ExtensionRegistry::Get(context_); 169 ExtensionRegistry* registry = ExtensionRegistry::Get(context_);
170 const Extension* extension = 170 const Extension* extension =
171 registry->enabled_extensions().GetByID(extension_id); 171 registry->enabled_extensions().GetByID(extension_id);
172 if (!extension) 172 if (!extension)
173 return; 173 return;
174 ExtensionSystem* system = ExtensionSystem::Get(context_); 174 ExtensionSystem* system = ExtensionSystem::Get(context_);
175 ExtensionService* service = system->extension_service(); 175 ExtensionService* service = system->extension_service();
176 Mode mode = ShouldBeVerified(*extension); 176 Mode mode = ShouldBeVerified(*extension);
177 if (mode >= ContentVerifierDelegate::ENFORCE) { 177 if (mode >= ContentVerifierDelegate::ENFORCE) {
178 if (!system->management_policy()->UserMayModifySettings(extension, NULL)) { 178 if (system->management_policy()->MustRemainEnabled(extension, NULL)) {
179 PendingExtensionManager* pending_manager = 179 PendingExtensionManager* pending_manager =
180 service->pending_extension_manager(); 180 service->pending_extension_manager();
181 if (pending_manager->IsPolicyReinstallForCorruptionExpected(extension_id)) 181 if (pending_manager->IsPolicyReinstallForCorruptionExpected(extension_id))
182 return; 182 return;
183 SYSLOG(WARNING) << "Corruption detected in policy extension " 183 SYSLOG(WARNING) << "Corruption detected in policy extension "
184 << extension_id << " installed at: " 184 << extension_id << " installed at: "
185 << extension->path().value(); 185 << extension->path().value();
186 pending_manager->ExpectPolicyReinstallForCorruption(extension_id); 186 pending_manager->ExpectPolicyReinstallForCorruption(extension_id);
187 service->DisableExtension(extension_id, Extension::DISABLE_CORRUPTED); 187 service->DisableExtension(extension_id, Extension::DISABLE_CORRUPTED);
188 service->CheckForExternalUpdates(); 188 service->CheckForExternalUpdates();
(...skipping 10 matching lines...) Expand all
199 UMA_HISTOGRAM_ENUMERATION("Extensions.CorruptExtensionDisabledReason", 199 UMA_HISTOGRAM_ENUMERATION("Extensions.CorruptExtensionDisabledReason",
200 reason, ContentVerifyJob::FAILURE_REASON_MAX); 200 reason, ContentVerifyJob::FAILURE_REASON_MAX);
201 } else if (!base::ContainsKey(would_be_disabled_ids_, extension_id)) { 201 } else if (!base::ContainsKey(would_be_disabled_ids_, extension_id)) {
202 UMA_HISTOGRAM_BOOLEAN("Extensions.CorruptExtensionWouldBeDisabled", true); 202 UMA_HISTOGRAM_BOOLEAN("Extensions.CorruptExtensionWouldBeDisabled", true);
203 would_be_disabled_ids_.insert(extension_id); 203 would_be_disabled_ids_.insert(extension_id);
204 } 204 }
205 } 205 }
206 206
207 207
208 } // namespace extensions 208 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698