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

Side by Side Diff: chrome/browser/browsing_instance.cc

Issue 6106003: Similar as extension, DOM UI needs to be created in its own process.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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
OLDNEW
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/browsing_instance.h" 5 #include "chrome/browser/browsing_instance.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/renderer_host/site_instance.h" 10 #include "chrome/browser/renderer_host/site_instance.h"
(...skipping 16 matching lines...) Expand all
27 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 27 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
28 if (command_line.HasSwitch(switches::kProcessPerSite)) 28 if (command_line.HasSwitch(switches::kProcessPerSite))
29 return true; 29 return true;
30 30
31 if (url.SchemeIs(chrome::kExtensionScheme)) { 31 if (url.SchemeIs(chrome::kExtensionScheme)) {
32 // Always consolidate extensions regardless of the command line, because 32 // Always consolidate extensions regardless of the command line, because
33 // they will break if split into multiple processes. 33 // they will break if split into multiple processes.
34 return true; 34 return true;
35 } 35 }
36 36
37 if (url.SchemeIs(chrome::kChromeUIScheme)) {
Charlie Reis 2011/01/06 18:27:59 I think we may have had a bug before-- should this
klobag.chromium 2011/01/06 20:23:02 Done.
38 // Always consolidate instances of the new tab page (and instances of any
39 // other internal resource urls.
40 return true;
41 }
42
37 if (!command_line.HasSwitch(switches::kProcessPerTab)) { 43 if (!command_line.HasSwitch(switches::kProcessPerTab)) {
38 // We are not in process-per-site or process-per-tab, so we must be in the 44 // We are not in process-per-site or process-per-tab, so we must be in the
39 // default (process-per-site-instance). Only use the process-per-site 45 // default (process-per-site-instance). Only use the process-per-site
40 // logic for particular sites that we want to consolidate. 46 // logic for particular sites that we want to consolidate.
41 // Note that --single-process may have been specified, but that affects the 47 // Note that --single-process may have been specified, but that affects the
42 // process creation logic in RenderProcessHost, so we do not need to worry 48 // process creation logic in RenderProcessHost, so we do not need to worry
43 // about it here. 49 // about it here.
Charlie Reis 2011/01/06 18:27:59 This comment and the one below assume that the pro
klobag.chromium 2011/01/06 20:23:02 Done.
Charlie Reis 2011/01/06 21:00:20 Actually, it looks like the comments are gone now.
44 if (url.SchemeIs(chrome::kChromeUIScheme))
45 // Always consolidate instances of the new tab page (and instances of any
46 // other internal resource urls.
47 return true;
48 50
49 // TODO(creis): List any other special cases that we want to limit to a 51 // TODO(creis): List any other special cases that we want to limit to a
50 // single process for all instances. 52 // single process for all instances.
51 } 53 }
52 54
53 // In all other cases, don't use process-per-site logic. 55 // In all other cases, don't use process-per-site logic.
54 return false; 56 return false;
55 } 57 }
56 58
57 BrowsingInstance::SiteInstanceMap* BrowsingInstance::GetSiteInstanceMap( 59 BrowsingInstance::SiteInstanceMap* BrowsingInstance::GetSiteInstanceMap(
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 return true; 149 return true;
148 } 150 }
149 return false; 151 return false;
150 } 152 }
151 153
152 BrowsingInstance::~BrowsingInstance() { 154 BrowsingInstance::~BrowsingInstance() {
153 // We should only be deleted when all of the SiteInstances that refer to 155 // We should only be deleted when all of the SiteInstances that refer to
154 // us are gone. 156 // us are gone.
155 DCHECK(site_instance_map_.empty()); 157 DCHECK(site_instance_map_.empty());
156 } 158 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698