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

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

Issue 12319114: Extract debugger target enumeration into a separate class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@debugger
Patch Set: Addressed comments Created 7 years, 9 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) 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/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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 if (current_extension) { 726 if (current_extension) {
727 // If the extension has an inspector open for its background page, detach 727 // If the extension has an inspector open for its background page, detach
728 // the inspector and hang onto a cookie for it, so that we can reattach 728 // the inspector and hang onto a cookie for it, so that we can reattach
729 // later. 729 // later.
730 // TODO(yoz): this is not incognito-safe! 730 // TODO(yoz): this is not incognito-safe!
731 ExtensionProcessManager* manager = system_->process_manager(); 731 ExtensionProcessManager* manager = system_->process_manager();
732 extensions::ExtensionHost* host = 732 extensions::ExtensionHost* host =
733 manager->GetBackgroundHostForExtension(extension_id); 733 manager->GetBackgroundHostForExtension(extension_id);
734 if (host && DevToolsAgentHost::HasFor(host->render_view_host())) { 734 if (host && DevToolsAgentHost::HasFor(host->render_view_host())) {
735 // Look for an open inspector for the background page. 735 // Look for an open inspector for the background page.
736 int devtools_cookie = DevToolsAgentHost::DisconnectRenderViewHost( 736 std::string devtools_cookie = DevToolsAgentHost::DisconnectRenderViewHost(
737 host->render_view_host()); 737 host->render_view_host());
738 if (devtools_cookie >= 0) 738 if (devtools_cookie != DevToolsAgentHost::NullId)
739 orphaned_dev_tools_[extension_id] = devtools_cookie; 739 orphaned_dev_tools_[extension_id] = devtools_cookie;
740 } 740 }
741 741
742 path = current_extension->path(); 742 path = current_extension->path();
743 DisableExtension(extension_id, Extension::DISABLE_RELOAD); 743 DisableExtension(extension_id, Extension::DISABLE_RELOAD);
744 disabled_extension_paths_[extension_id] = path; 744 disabled_extension_paths_[extension_id] = path;
745 } else { 745 } else {
746 path = unloaded_extension_paths_[extension_id]; 746 path = unloaded_extension_paths_[extension_id];
747 } 747 }
748 748
(...skipping 2380 matching lines...) Expand 10 before | Expand all | Expand 10 after
3129 if (!extension) 3129 if (!extension)
3130 continue; 3130 continue;
3131 blacklisted_extensions_.Insert(extension); 3131 blacklisted_extensions_.Insert(extension);
3132 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); 3132 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST);
3133 UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.BlacklistInstalled", 3133 UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.BlacklistInstalled",
3134 extension->location(), Manifest::NUM_LOCATIONS); 3134 extension->location(), Manifest::NUM_LOCATIONS);
3135 } 3135 }
3136 3136
3137 IdentifyAlertableExtensions(); 3137 IdentifyAlertableExtensions();
3138 } 3138 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698