| 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 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 } | 752 } |
| 753 | 753 |
| 754 default: | 754 default: |
| 755 NOTREACHED(); | 755 NOTREACHED(); |
| 756 } | 756 } |
| 757 } | 757 } |
| 758 | 758 |
| 759 void ProcessManager::OnDevToolsStateChanged( | 759 void ProcessManager::OnDevToolsStateChanged( |
| 760 content::DevToolsAgentHost* agent_host, | 760 content::DevToolsAgentHost* agent_host, |
| 761 bool attached) { | 761 bool attached) { |
| 762 RenderViewHost* rvh = agent_host->GetRenderViewHost(); | 762 WebContents* web_contents = agent_host->GetWebContents(); |
| 763 // Ignore unrelated notifications. | 763 // Ignore unrelated notifications. |
| 764 if (!rvh || | 764 if (!web_contents || web_contents->GetBrowserContext() != GetBrowserContext()) |
| 765 rvh->GetSiteInstance()->GetProcess()->GetBrowserContext() != | |
| 766 GetBrowserContext()) | |
| 767 return; | 765 return; |
| 768 if (GetViewType(WebContents::FromRenderViewHost(rvh)) != | 766 if (GetViewType(web_contents) != VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) |
| 769 VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) | |
| 770 return; | 767 return; |
| 771 const Extension* extension = GetExtensionForRenderViewHost(rvh); | 768 const Extension* extension = |
| 769 GetExtensionForRenderViewHost(web_contents->GetRenderViewHost()); |
| 772 if (!extension) | 770 if (!extension) |
| 773 return; | 771 return; |
| 774 if (attached) { | 772 if (attached) { |
| 775 // Keep the lazy background page alive while it's being inspected. | 773 // Keep the lazy background page alive while it's being inspected. |
| 776 CancelSuspend(extension); | 774 CancelSuspend(extension); |
| 777 IncrementLazyKeepaliveCount(extension); | 775 IncrementLazyKeepaliveCount(extension); |
| 778 } else { | 776 } else { |
| 779 DecrementLazyKeepaliveCount(extension); | 777 DecrementLazyKeepaliveCount(extension); |
| 780 } | 778 } |
| 781 } | 779 } |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 SiteInstance* IncognitoProcessManager::GetSiteInstanceForURL(const GURL& url) { | 921 SiteInstance* IncognitoProcessManager::GetSiteInstanceForURL(const GURL& url) { |
| 924 const Extension* extension = | 922 const Extension* extension = |
| 925 extension_registry_->enabled_extensions().GetExtensionOrAppByURL(url); | 923 extension_registry_->enabled_extensions().GetExtensionOrAppByURL(url); |
| 926 if (extension && !IncognitoInfo::IsSplitMode(extension)) | 924 if (extension && !IncognitoInfo::IsSplitMode(extension)) |
| 927 return original_manager_->GetSiteInstanceForURL(url); | 925 return original_manager_->GetSiteInstanceForURL(url); |
| 928 | 926 |
| 929 return ProcessManager::GetSiteInstanceForURL(url); | 927 return ProcessManager::GetSiteInstanceForURL(url); |
| 930 } | 928 } |
| 931 | 929 |
| 932 } // namespace extensions | 930 } // namespace extensions |
| OLD | NEW |