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 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 iter.Advance(); | 1243 iter.Advance(); |
1244 } | 1244 } |
1245 | 1245 |
1246 ClearTransportDIBCache(); | 1246 ClearTransportDIBCache(); |
1247 | 1247 |
1248 // this object is not deleted at this point and may be reused later. | 1248 // this object is not deleted at this point and may be reused later. |
1249 // TODO(darin): clean this up | 1249 // TODO(darin): clean this up |
1250 } | 1250 } |
1251 | 1251 |
1252 void RenderProcessHostImpl::OnShutdownRequest() { | 1252 void RenderProcessHostImpl::OnShutdownRequest() { |
1253 // Don't shutdown if there are pending RenderViews being swapped back in. | 1253 // Don't shut down if there are more RenderViews than the one asking to |
1254 if (pending_views_) | 1254 // close, or if there are pending RenderViews being swapped back in. |
| 1255 if (pending_views_ || render_widget_hosts_.size() > 1) |
1255 return; | 1256 return; |
1256 | 1257 |
1257 // Notify any tabs that might have swapped out renderers from this process. | 1258 // Notify any tabs that might have swapped out renderers from this process. |
1258 // They should not attempt to swap them back in. | 1259 // They should not attempt to swap them back in. |
1259 content::NotificationService::current()->Notify( | 1260 content::NotificationService::current()->Notify( |
1260 content::NOTIFICATION_RENDERER_PROCESS_CLOSING, | 1261 content::NOTIFICATION_RENDERER_PROCESS_CLOSING, |
1261 content::Source<RenderProcessHost>(this), | 1262 content::Source<RenderProcessHost>(this), |
1262 content::NotificationService::NoDetails()); | 1263 content::NotificationService::NoDetails()); |
1263 | 1264 |
1264 Send(new ChildProcessMsg_Shutdown()); | 1265 Send(new ChildProcessMsg_Shutdown()); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 void RenderProcessHostImpl::OnRevealFolderInOS(const FilePath& path) { | 1338 void RenderProcessHostImpl::OnRevealFolderInOS(const FilePath& path) { |
1338 // Only honor the request if appropriate persmissions are granted. | 1339 // Only honor the request if appropriate persmissions are granted. |
1339 if (ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile(GetID(), | 1340 if (ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile(GetID(), |
1340 path)) | 1341 path)) |
1341 content::GetContentClient()->browser()->OpenItem(path); | 1342 content::GetContentClient()->browser()->OpenItem(path); |
1342 } | 1343 } |
1343 | 1344 |
1344 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { | 1345 void RenderProcessHostImpl::OnSavedPageAsMHTML(int job_id, int64 data_size) { |
1345 MHTMLGenerationManager::GetInstance()->MHTMLGenerated(job_id, data_size); | 1346 MHTMLGenerationManager::GetInstance()->MHTMLGenerated(job_id, data_size); |
1346 } | 1347 } |
OLD | NEW |