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

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

Issue 342003005: Show alert failure for reloading unpacked extensions with bad manifest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed patch set 4 comments 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <set> 9 #include <set>
10 10
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 scoped_ptr<ExtensionInfo> installed_extension( 691 scoped_ptr<ExtensionInfo> installed_extension(
692 extension_prefs_->GetInstalledExtensionInfo(extension_id)); 692 extension_prefs_->GetInstalledExtensionInfo(extension_id));
693 if (installed_extension.get() && 693 if (installed_extension.get() &&
694 installed_extension->extension_manifest.get()) { 694 installed_extension->extension_manifest.get()) {
695 extensions::InstalledLoader(this).Load(*installed_extension, false); 695 extensions::InstalledLoader(this).Load(*installed_extension, false);
696 } else { 696 } else {
697 // Otherwise, the extension is unpacked (location LOAD). 697 // Otherwise, the extension is unpacked (location LOAD).
698 // We should always be able to remember the extension's path. If it's not in 698 // We should always be able to remember the extension's path. If it's not in
699 // the map, someone failed to update |unloaded_extension_paths_|. 699 // the map, someone failed to update |unloaded_extension_paths_|.
700 CHECK(!path.empty()); 700 CHECK(!path.empty());
701 extensions::UnpackedInstaller::Create(this)->Load(path); 701 scoped_refptr<extensions::UnpackedInstaller> unpacked_installer =
702 extensions::UnpackedInstaller::Create(this);
703 unpacked_installer->set_be_noisy_on_failure(false);
gpdavis 2014/06/30 19:42:52 Still need to figure out how to address this probl
Devlin 2014/06/30 21:06:41 Not even (as there can be explicit extension loads
gpdavis 2014/06/30 21:41:19 Where exactly is the relevant code that triggers t
Devlin 2014/06/30 22:32:36 cs.chromium.org is pretty awesome. So, you know t
gpdavis 2014/06/30 23:35:11 I am fairly well acquainted with code search (I ce
Devlin 2014/07/01 17:02:55 Yeah, adding a boolean be_noisy to ExtensionServic
gpdavis 2014/07/01 20:58:55 Sweet. I went ahead and added that argument and u
704 unpacked_installer->Load(path);
702 } 705 }
703 // When reloading is done, mark this extension as done reloading. 706 // When reloading is done, mark this extension as done reloading.
704 SetBeingReloaded(extension_id, false); 707 SetBeingReloaded(extension_id, false);
705 #endif // defined(ENABLE_EXTENSIONS) 708 #endif // defined(ENABLE_EXTENSIONS)
706 } 709 }
707 710
708 bool ExtensionService::UninstallExtension( 711 bool ExtensionService::UninstallExtension(
709 // "transient" because the process of uninstalling may cause the reference 712 // "transient" because the process of uninstalling may cause the reference
710 // to become invalid. Instead, use |extenson->id()|. 713 // to become invalid. Instead, use |extenson->id()|.
711 const std::string& transient_extension_id, 714 const std::string& transient_extension_id,
(...skipping 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after
2487 } 2490 }
2488 2491
2489 void ExtensionService::OnProfileDestructionStarted() { 2492 void ExtensionService::OnProfileDestructionStarted() {
2490 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); 2493 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs();
2491 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); 2494 for (ExtensionIdSet::iterator it = ids_to_unload.begin();
2492 it != ids_to_unload.end(); 2495 it != ids_to_unload.end();
2493 ++it) { 2496 ++it) {
2494 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); 2497 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN);
2495 } 2498 }
2496 } 2499 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698