| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/renderer_host/site_instance.h" | 5 #include "chrome/browser/renderer_host/site_instance.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browsing_instance.h" | 7 #include "chrome/browser/browsing_instance.h" |
| 8 #include "chrome/browser/dom_ui/dom_ui_factory.h" | 8 #include "chrome/browser/dom_ui/dom_ui_factory.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/renderer_host/browser_render_process_host.h" | 10 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
| 11 #include "chrome/common/url_constants.h" | 11 #include "chrome/common/url_constants.h" |
| 12 #include "chrome/common/notification_service.h" | 12 #include "chrome/common/notification_service.h" |
| 13 #include "net/base/registry_controlled_domain.h" | 13 #include "net/base/registry_controlled_domain.h" |
| 14 | 14 |
| 15 // We treat javascript:, about:crash, about:hang, and about:shorthang as the | 15 // We treat javascript:, about:crash, about:hang, and about:shorthang as the |
| 16 // same site as any URL since they are actually modifiers on existing pages. | 16 // same site as any URL since they are actually modifiers on existing pages. |
| 17 static bool IsURLSameAsAnySiteInstance(const GURL& url) { | 17 static bool IsURLSameAsAnySiteInstance(const GURL& url) { |
| 18 if (!url.is_valid()) | 18 if (!url.is_valid()) |
| 19 return false; | 19 return false; |
| 20 return url.SchemeIs(chrome::kJavaScriptScheme) || | 20 return url.SchemeIs(chrome::kJavaScriptScheme) || |
| 21 url.spec() == chrome::kAboutCrashURL || | 21 url.spec() == chrome::kAboutCrashURL || |
| 22 url.spec() == chrome::kAboutKillURL || |
| 22 url.spec() == chrome::kAboutHangURL || | 23 url.spec() == chrome::kAboutHangURL || |
| 23 url.spec() == chrome::kAboutShorthangURL; | 24 url.spec() == chrome::kAboutShorthangURL; |
| 24 } | 25 } |
| 25 | 26 |
| 26 SiteInstance::SiteInstance(BrowsingInstance* browsing_instance) | 27 SiteInstance::SiteInstance(BrowsingInstance* browsing_instance) |
| 27 : browsing_instance_(browsing_instance), | 28 : browsing_instance_(browsing_instance), |
| 28 render_process_host_factory_(NULL), | 29 render_process_host_factory_(NULL), |
| 29 process_(NULL), | 30 process_(NULL), |
| 30 max_page_id_(-1), | 31 max_page_id_(-1), |
| 31 has_site_(false) { | 32 has_site_(false) { |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 } | 227 } |
| 227 | 228 |
| 228 void SiteInstance::Observe(NotificationType type, | 229 void SiteInstance::Observe(NotificationType type, |
| 229 const NotificationSource& source, | 230 const NotificationSource& source, |
| 230 const NotificationDetails& details) { | 231 const NotificationDetails& details) { |
| 231 DCHECK(type == NotificationType::RENDERER_PROCESS_TERMINATED); | 232 DCHECK(type == NotificationType::RENDERER_PROCESS_TERMINATED); |
| 232 RenderProcessHost* rph = Source<RenderProcessHost>(source).ptr(); | 233 RenderProcessHost* rph = Source<RenderProcessHost>(source).ptr(); |
| 233 if (rph == process_) | 234 if (rph == process_) |
| 234 process_ = NULL; | 235 process_ = NULL; |
| 235 } | 236 } |
| OLD | NEW |