OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 size_t memory_tier = base::SysInfo::AmountOfPhysicalMemoryMB() / 256; | 238 size_t memory_tier = base::SysInfo::AmountOfPhysicalMemoryMB() / 256; |
239 if (memory_tier >= arraysize(kMaxRenderersByRamTier)) | 239 if (memory_tier >= arraysize(kMaxRenderersByRamTier)) |
240 max_count = content::kMaxRendererProcessCount; | 240 max_count = content::kMaxRendererProcessCount; |
241 else | 241 else |
242 max_count = kMaxRenderersByRamTier[memory_tier]; | 242 max_count = kMaxRenderersByRamTier[memory_tier]; |
243 } | 243 } |
244 return max_count; | 244 return max_count; |
245 } | 245 } |
246 | 246 |
247 // the global list of all renderer processes | 247 // the global list of all renderer processes |
248 base::LazyInstance< | 248 base::LazyInstance<IDMap<content::RenderProcessHost> >::Leaky |
249 IDMap<content::RenderProcessHost>, | 249 g_all_hosts = LAZY_INSTANCE_INITIALIZER; |
250 base::LeakyLazyInstanceTraits<IDMap<content::RenderProcessHost> > > | |
251 g_all_hosts = LAZY_INSTANCE_INITIALIZER; | |
252 | 250 |
253 } // namespace | 251 } // namespace |
254 | 252 |
255 // static | 253 // static |
256 bool g_run_renderer_in_process_ = false; | 254 bool g_run_renderer_in_process_ = false; |
257 | 255 |
258 // static | 256 // static |
259 void content::RenderProcessHost::SetMaxRendererProcessCountForTest( | 257 void content::RenderProcessHost::SetMaxRendererProcessCountForTest( |
260 size_t count) { | 258 size_t count) { |
261 max_renderer_count_override = count; | 259 max_renderer_count_override = count; |
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1290 void RenderProcessHostImpl::OnRevealFolderInOS(const FilePath& path) { | 1288 void RenderProcessHostImpl::OnRevealFolderInOS(const FilePath& path) { |
1291 // Only honor the request if appropriate persmissions are granted. | 1289 // Only honor the request if appropriate persmissions are granted. |
1292 if (ChildProcessSecurityPolicy::GetInstance()->CanReadFile(GetID(), path)) | 1290 if (ChildProcessSecurityPolicy::GetInstance()->CanReadFile(GetID(), path)) |
1293 content::GetContentClient()->browser()->OpenItem(path); | 1291 content::GetContentClient()->browser()->OpenItem(path); |
1294 } | 1292 } |
1295 | 1293 |
1296 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { | 1294 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { |
1297 content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> | 1295 content::GetContentClient()->browser()->GetMHTMLGenerationManager()-> |
1298 MHTMLGenerated(job_id, data_size); | 1296 MHTMLGenerated(job_id, data_size); |
1299 } | 1297 } |
OLD | NEW |