| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "extensions/browser/process_manager.h" | 5 #include "extensions/browser/process_manager.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 } | 617 } |
| 618 | 618 |
| 619 void ProcessManager::OnExtensionLoaded(BrowserContext* browser_context, | 619 void ProcessManager::OnExtensionLoaded(BrowserContext* browser_context, |
| 620 const Extension* extension) { | 620 const Extension* extension) { |
| 621 if (ExtensionSystem::Get(browser_context)->ready().is_signaled()) { | 621 if (ExtensionSystem::Get(browser_context)->ready().is_signaled()) { |
| 622 // The extension system is ready, so create the background host. | 622 // The extension system is ready, so create the background host. |
| 623 CreateBackgroundHostForExtensionLoad(this, extension); | 623 CreateBackgroundHostForExtensionLoad(this, extension); |
| 624 } | 624 } |
| 625 } | 625 } |
| 626 | 626 |
| 627 void ProcessManager::OnExtensionUnloaded( | 627 void ProcessManager::OnExtensionUnloaded(BrowserContext* browser_context, |
| 628 BrowserContext* browser_context, | 628 const Extension* extension, |
| 629 const Extension* extension, | 629 UnloadedExtensionReason reason) { |
| 630 UnloadedExtensionInfo::Reason reason) { | |
| 631 ExtensionHost* host = GetBackgroundHostForExtension(extension->id()); | 630 ExtensionHost* host = GetBackgroundHostForExtension(extension->id()); |
| 632 if (host != nullptr) | 631 if (host != nullptr) |
| 633 CloseBackgroundHost(host); | 632 CloseBackgroundHost(host); |
| 634 UnregisterExtension(extension->id()); | 633 UnregisterExtension(extension->id()); |
| 635 } | 634 } |
| 636 | 635 |
| 637 void ProcessManager::CreateStartupBackgroundHosts() { | 636 void ProcessManager::CreateStartupBackgroundHosts() { |
| 638 DCHECK(!startup_background_hosts_created_); | 637 DCHECK(!startup_background_hosts_created_); |
| 639 for (const scoped_refptr<const Extension>& extension : | 638 for (const scoped_refptr<const Extension>& extension : |
| 640 extension_registry_->enabled_extensions()) { | 639 extension_registry_->enabled_extensions()) { |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 if (extension && !IncognitoInfo::IsSplitMode(extension)) { | 887 if (extension && !IncognitoInfo::IsSplitMode(extension)) { |
| 889 BrowserContext* original_context = | 888 BrowserContext* original_context = |
| 890 ExtensionsBrowserClient::Get()->GetOriginalContext(browser_context()); | 889 ExtensionsBrowserClient::Get()->GetOriginalContext(browser_context()); |
| 891 return ProcessManager::Get(original_context)->GetSiteInstanceForURL(url); | 890 return ProcessManager::Get(original_context)->GetSiteInstanceForURL(url); |
| 892 } | 891 } |
| 893 | 892 |
| 894 return ProcessManager::GetSiteInstanceForURL(url); | 893 return ProcessManager::GetSiteInstanceForURL(url); |
| 895 } | 894 } |
| 896 | 895 |
| 897 } // namespace extensions | 896 } // namespace extensions |
| OLD | NEW |