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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 DCHECK(!startup_background_hosts_created_); | 840 DCHECK(!startup_background_hosts_created_); |
841 const ExtensionSet& enabled_extensions = | 841 const ExtensionSet& enabled_extensions = |
842 extension_registry_->enabled_extensions(); | 842 extension_registry_->enabled_extensions(); |
843 for (ExtensionSet::const_iterator extension = enabled_extensions.begin(); | 843 for (ExtensionSet::const_iterator extension = enabled_extensions.begin(); |
844 extension != enabled_extensions.end(); | 844 extension != enabled_extensions.end(); |
845 ++extension) { | 845 ++extension) { |
846 CreateBackgroundHostForExtensionLoad(this, extension->get()); | 846 CreateBackgroundHostForExtensionLoad(this, extension->get()); |
847 | 847 |
848 FOR_EACH_OBSERVER(ProcessManagerObserver, | 848 FOR_EACH_OBSERVER(ProcessManagerObserver, |
849 observer_list_, | 849 observer_list_, |
850 OnBackgroundHostStartup(*extension)); | 850 OnBackgroundHostStartup(extension->get())); |
851 } | 851 } |
852 } | 852 } |
853 | 853 |
854 void ProcessManager::OnBackgroundHostCreated(ExtensionHost* host) { | 854 void ProcessManager::OnBackgroundHostCreated(ExtensionHost* host) { |
855 DCHECK_EQ(GetBrowserContext(), host->browser_context()); | 855 DCHECK_EQ(GetBrowserContext(), host->browser_context()); |
856 background_hosts_.insert(host); | 856 background_hosts_.insert(host); |
857 | 857 |
858 if (BackgroundInfo::HasLazyBackgroundPage(host->extension())) { | 858 if (BackgroundInfo::HasLazyBackgroundPage(host->extension())) { |
859 linked_ptr<base::ElapsedTimer> since_suspended( | 859 linked_ptr<base::ElapsedTimer> since_suspended( |
860 background_page_data_[host->extension()->id()]. | 860 background_page_data_[host->extension()->id()]. |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 SiteInstance* IncognitoProcessManager::GetSiteInstanceForURL(const GURL& url) { | 945 SiteInstance* IncognitoProcessManager::GetSiteInstanceForURL(const GURL& url) { |
946 const Extension* extension = | 946 const Extension* extension = |
947 extension_registry_->enabled_extensions().GetExtensionOrAppByURL(url); | 947 extension_registry_->enabled_extensions().GetExtensionOrAppByURL(url); |
948 if (extension && !IncognitoInfo::IsSplitMode(extension)) | 948 if (extension && !IncognitoInfo::IsSplitMode(extension)) |
949 return original_manager_->GetSiteInstanceForURL(url); | 949 return original_manager_->GetSiteInstanceForURL(url); |
950 | 950 |
951 return ProcessManager::GetSiteInstanceForURL(url); | 951 return ProcessManager::GetSiteInstanceForURL(url); |
952 } | 952 } |
953 | 953 |
954 } // namespace extensions | 954 } // namespace extensions |
OLD | NEW |