OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include <algorithm> | 10 #include <algorithm> |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 } | 307 } |
308 return IPC::TakePlatformFileForTransit(std::move(dump_file)); | 308 return IPC::TakePlatformFileForTransit(std::move(dump_file)); |
309 } | 309 } |
310 | 310 |
311 // Allow us to only run the trial in the first renderer. | 311 // Allow us to only run the trial in the first renderer. |
312 bool has_done_stun_trials = false; | 312 bool has_done_stun_trials = false; |
313 | 313 |
314 #endif | 314 #endif |
315 | 315 |
316 // the global list of all renderer processes | 316 // the global list of all renderer processes |
317 base::LazyInstance<IDMap<RenderProcessHost>>::Leaky g_all_hosts = | 317 base::LazyInstance<IDMap<RenderProcessHost*>>::Leaky g_all_hosts = |
318 LAZY_INSTANCE_INITIALIZER; | 318 LAZY_INSTANCE_INITIALIZER; |
319 | 319 |
320 // Map of site to process, to ensure we only have one RenderProcessHost per | 320 // Map of site to process, to ensure we only have one RenderProcessHost per |
321 // site in process-per-site mode. Each map is specific to a BrowserContext. | 321 // site in process-per-site mode. Each map is specific to a BrowserContext. |
322 class SiteProcessMap : public base::SupportsUserData::Data { | 322 class SiteProcessMap : public base::SupportsUserData::Data { |
323 public: | 323 public: |
324 typedef base::hash_map<std::string, RenderProcessHost*> SiteToProcessMap; | 324 typedef base::hash_map<std::string, RenderProcessHost*> SiteToProcessMap; |
325 SiteProcessMap() {} | 325 SiteProcessMap() {} |
326 | 326 |
327 void RegisterProcess(const std::string& site, RenderProcessHost* process) { | 327 void RegisterProcess(const std::string& site, RenderProcessHost* process) { |
(...skipping 2343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2671 NOTIFICATION_RENDERER_PROCESS_CLOSED, Source<RenderProcessHost>(this), | 2671 NOTIFICATION_RENDERER_PROCESS_CLOSED, Source<RenderProcessHost>(this), |
2672 Details<RendererClosedDetails>(&details)); | 2672 Details<RendererClosedDetails>(&details)); |
2673 for (auto& observer : observers_) | 2673 for (auto& observer : observers_) |
2674 observer.RenderProcessExited(this, status, exit_code); | 2674 observer.RenderProcessExited(this, status, exit_code); |
2675 within_process_died_observer_ = false; | 2675 within_process_died_observer_ = false; |
2676 | 2676 |
2677 message_port_message_filter_ = NULL; | 2677 message_port_message_filter_ = NULL; |
2678 | 2678 |
2679 RemoveUserData(kSessionStorageHolderKey); | 2679 RemoveUserData(kSessionStorageHolderKey); |
2680 | 2680 |
2681 IDMap<IPC::Listener>::iterator iter(&listeners_); | 2681 IDMap<IPC::Listener*>::iterator iter(&listeners_); |
2682 while (!iter.IsAtEnd()) { | 2682 while (!iter.IsAtEnd()) { |
2683 iter.GetCurrentValue()->OnMessageReceived(FrameHostMsg_RenderProcessGone( | 2683 iter.GetCurrentValue()->OnMessageReceived(FrameHostMsg_RenderProcessGone( |
2684 iter.GetCurrentKey(), static_cast<int>(status), exit_code)); | 2684 iter.GetCurrentKey(), static_cast<int>(status), exit_code)); |
2685 iter.Advance(); | 2685 iter.Advance(); |
2686 } | 2686 } |
2687 | 2687 |
2688 // Initialize a new ChannelProxy in case this host is re-used for a new | 2688 // Initialize a new ChannelProxy in case this host is re-used for a new |
2689 // process. This ensures that new messages can be sent on the host ASAP (even | 2689 // process. This ensures that new messages can be sent on the host ASAP (even |
2690 // before Init()) and they'll eventually reach the new process. | 2690 // before Init()) and they'll eventually reach the new process. |
2691 // | 2691 // |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3000 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3000 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
3001 | 3001 |
3002 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 3002 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
3003 // enough information here so that we can determine what the bad message was. | 3003 // enough information here so that we can determine what the bad message was. |
3004 base::debug::Alias(&error); | 3004 base::debug::Alias(&error); |
3005 bad_message::ReceivedBadMessage(render_process_id, | 3005 bad_message::ReceivedBadMessage(render_process_id, |
3006 bad_message::RPH_MOJO_PROCESS_ERROR); | 3006 bad_message::RPH_MOJO_PROCESS_ERROR); |
3007 } | 3007 } |
3008 | 3008 |
3009 } // namespace content | 3009 } // namespace content |
OLD | NEW |