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

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

Issue 7328029: Use process-per-app-instance for hosted apps without background permission. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix incognito function. 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/content_browser_client.h ('k') | content/browser/site_instance_unittest.cc » ('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 24 matching lines...) Expand all
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, content::NOTIFICATION_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 NotificationService::current()->Notify(
46 content::NOTIFICATION_SITE_INSTANCE_DELETED,
47 Source<SiteInstance>(this),
48 NotificationService::NoDetails());
49
45 // Now that no one is referencing us, we can safely remove ourselves from 50 // 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 51 // the BrowsingInstance. Any future visits to a page from this site
47 // (within the same BrowsingInstance) can safely create a new SiteInstance. 52 // (within the same BrowsingInstance) can safely create a new SiteInstance.
48 if (has_site_) 53 if (has_site_)
49 browsing_instance_->UnregisterSiteInstance(this); 54 browsing_instance_->UnregisterSiteInstance(this);
50 } 55 }
51 56
52 bool SiteInstance::HasProcess() const { 57 bool SiteInstance::HasProcess() const {
53 return (process_ != NULL); 58 return (process_ != NULL);
54 } 59 }
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 } 238 }
234 239
235 void SiteInstance::Observe(int type, 240 void SiteInstance::Observe(int type,
236 const NotificationSource& source, 241 const NotificationSource& source,
237 const NotificationDetails& details) { 242 const NotificationDetails& details) {
238 DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_TERMINATED); 243 DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_TERMINATED);
239 RenderProcessHost* rph = Source<RenderProcessHost>(source).ptr(); 244 RenderProcessHost* rph = Source<RenderProcessHost>(source).ptr();
240 if (rph == process_) 245 if (rph == process_)
241 process_ = NULL; 246 process_ = NULL;
242 } 247 }
OLDNEW
« no previous file with comments | « content/browser/content_browser_client.h ('k') | content/browser/site_instance_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698