Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: content/browser/site_instance.cc

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/site_instance.h ('k') | content/browser/ssl/ssl_client_auth_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 19 matching lines...) Expand all
30 30
31 SiteInstance::SiteInstance(BrowsingInstance* browsing_instance) 31 SiteInstance::SiteInstance(BrowsingInstance* browsing_instance)
32 : id_(next_site_instance_id_++), 32 : id_(next_site_instance_id_++),
33 browsing_instance_(browsing_instance), 33 browsing_instance_(browsing_instance),
34 render_process_host_factory_(NULL), 34 render_process_host_factory_(NULL),
35 process_(NULL), 35 process_(NULL),
36 max_page_id_(-1), 36 max_page_id_(-1),
37 has_site_(false) { 37 has_site_(false) {
38 DCHECK(browsing_instance); 38 DCHECK(browsing_instance);
39 39
40 registrar_.Add(this, NotificationType::RENDERER_PROCESS_TERMINATED, 40 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
41 NotificationService::AllSources()); 41 NotificationService::AllSources());
42 } 42 }
43 43
44 SiteInstance::~SiteInstance() { 44 SiteInstance::~SiteInstance() {
45 // Now that no one is referencing us, we can safely remove ourselves from 45 // Now that no one is referencing us, we can safely remove ourselves from
46 // the BrowsingInstance. Any future visits to a page from this site 46 // the BrowsingInstance. Any future visits to a page from this site
47 // (within the same BrowsingInstance) can safely create a new SiteInstance. 47 // (within the same BrowsingInstance) can safely create a new SiteInstance.
48 if (has_site_) 48 if (has_site_)
49 browsing_instance_->UnregisterSiteInstance(this); 49 browsing_instance_->UnregisterSiteInstance(this);
50 } 50 }
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 225
226 RenderProcessHost::Type SiteInstance::GetRendererType() { 226 RenderProcessHost::Type SiteInstance::GetRendererType() {
227 // We may not have a site at this point, which generally means this is a 227 // We may not have a site at this point, which generally means this is a
228 // normal navigation. 228 // normal navigation.
229 if (!has_site_) 229 if (!has_site_)
230 return RenderProcessHost::TYPE_NORMAL; 230 return RenderProcessHost::TYPE_NORMAL;
231 231
232 return RendererTypeForURL(site_); 232 return RendererTypeForURL(site_);
233 } 233 }
234 234
235 void SiteInstance::Observe(NotificationType type, 235 void SiteInstance::Observe(int type,
236 const NotificationSource& source, 236 const NotificationSource& source,
237 const NotificationDetails& details) { 237 const NotificationDetails& details) {
238 DCHECK(type == NotificationType::RENDERER_PROCESS_TERMINATED); 238 DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_TERMINATED);
239 RenderProcessHost* rph = Source<RenderProcessHost>(source).ptr(); 239 RenderProcessHost* rph = Source<RenderProcessHost>(source).ptr();
240 if (rph == process_) 240 if (rph == process_)
241 process_ = NULL; 241 process_ = NULL;
242 } 242 }
OLDNEW
« no previous file with comments | « content/browser/site_instance.h ('k') | content/browser/ssl/ssl_client_auth_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698