| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/site_instance.h" | 5 #include "content/browser/site_instance.h" |
| 6 | 6 |
| 7 #include "content/browser/browsing_instance.h" | 7 #include "content/browser/browsing_instance.h" |
| 8 #include "content/browser/content_browser_client.h" | 8 #include "content/browser/content_browser_client.h" |
| 9 #include "content/browser/renderer_host/browser_render_process_host.h" | 9 #include "content/browser/renderer_host/browser_render_process_host.h" |
| 10 #include "content/browser/webui/web_ui_factory.h" | 10 #include "content/browser/webui/web_ui_factory.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 if (!process_) { | 78 if (!process_) { |
| 79 if (render_process_host_factory_) { | 79 if (render_process_host_factory_) { |
| 80 process_ = render_process_host_factory_->CreateRenderProcessHost( | 80 process_ = render_process_host_factory_->CreateRenderProcessHost( |
| 81 browsing_instance_->browser_context()); | 81 browsing_instance_->browser_context()); |
| 82 } else { | 82 } else { |
| 83 process_ = | 83 process_ = |
| 84 new BrowserRenderProcessHost(browsing_instance_->browser_context()); | 84 new BrowserRenderProcessHost(browsing_instance_->browser_context()); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 // Make sure the process starts at the right max_page_id | 88 // Make sure the process starts at the right max_page_id, and ensure that |
| 89 process_->UpdateMaxPageID(max_page_id_); | 89 // we send an update to the renderer process. |
| 90 process_->UpdateAndSendMaxPageID(max_page_id_); |
| 90 } | 91 } |
| 91 DCHECK(process_); | 92 DCHECK(process_); |
| 92 | 93 |
| 93 return process_; | 94 return process_; |
| 94 } | 95 } |
| 95 | 96 |
| 96 void SiteInstance::SetSite(const GURL& url) { | 97 void SiteInstance::SetSite(const GURL& url) { |
| 97 // A SiteInstance's site should not change. | 98 // A SiteInstance's site should not change. |
| 98 // TODO(creis): When following links or script navigations, we can currently | 99 // TODO(creis): When following links or script navigations, we can currently |
| 99 // render pages from other sites in this SiteInstance. This will eventually | 100 // render pages from other sites in this SiteInstance. This will eventually |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 } | 223 } |
| 223 | 224 |
| 224 void SiteInstance::Observe(int type, | 225 void SiteInstance::Observe(int type, |
| 225 const NotificationSource& source, | 226 const NotificationSource& source, |
| 226 const NotificationDetails& details) { | 227 const NotificationDetails& details) { |
| 227 DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_TERMINATED); | 228 DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_TERMINATED); |
| 228 RenderProcessHost* rph = Source<RenderProcessHost>(source).ptr(); | 229 RenderProcessHost* rph = Source<RenderProcessHost>(source).ptr(); |
| 229 if (rph == process_) | 230 if (rph == process_) |
| 230 process_ = NULL; | 231 process_ = NULL; |
| 231 } | 232 } |
| OLD | NEW |