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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 NOTREACHED() << "There should be only one RenderProcessHost when running " | 701 NOTREACHED() << "There should be only one RenderProcessHost when running " |
702 << "in-process."; | 702 << "in-process."; |
703 } | 703 } |
704 } | 704 } |
705 | 705 |
706 void RenderProcessHostImpl::RegisterRendererMainThreadFactory( | 706 void RenderProcessHostImpl::RegisterRendererMainThreadFactory( |
707 RendererMainThreadFactoryFunction create) { | 707 RendererMainThreadFactoryFunction create) { |
708 g_renderer_main_thread_factory = create; | 708 g_renderer_main_thread_factory = create; |
709 } | 709 } |
710 | 710 |
| 711 // static |
| 712 // TODO(alokp): Remove after collecting crash data. |
| 713 // Temporary checks to verify that all shared workers are terminated. |
| 714 // It is suspected that shared workers prevent render process hosts |
| 715 // from shutting down: crbug.com/608049 |
| 716 void RenderProcessHostImpl::CheckAllWorkersTerminated() { |
| 717 iterator iter(AllHostsIterator()); |
| 718 while (!iter.IsAtEnd()) { |
| 719 RenderProcessHostImpl* host = |
| 720 static_cast<RenderProcessHostImpl*>(iter.GetCurrentValue()); |
| 721 CHECK_EQ(0, host->worker_ref_count_); |
| 722 } |
| 723 } |
| 724 |
711 RenderProcessHostImpl::~RenderProcessHostImpl() { | 725 RenderProcessHostImpl::~RenderProcessHostImpl() { |
712 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 726 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
713 #ifndef NDEBUG | 727 #ifndef NDEBUG |
714 DCHECK(is_self_deleted_) | 728 DCHECK(is_self_deleted_) |
715 << "RenderProcessHostImpl is destroyed by something other than itself"; | 729 << "RenderProcessHostImpl is destroyed by something other than itself"; |
716 #endif | 730 #endif |
717 | 731 |
718 // Make sure to clean up the in-process renderer before the channel, otherwise | 732 // Make sure to clean up the in-process renderer before the channel, otherwise |
719 // it may still run and have its IPCs fail, causing asserts. | 733 // it may still run and have its IPCs fail, causing asserts. |
720 in_process_renderer_.reset(); | 734 in_process_renderer_.reset(); |
(...skipping 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2824 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2838 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
2825 | 2839 |
2826 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2840 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
2827 // enough information here so that we can determine what the bad message was. | 2841 // enough information here so that we can determine what the bad message was. |
2828 base::debug::Alias(&error); | 2842 base::debug::Alias(&error); |
2829 bad_message::ReceivedBadMessage(process.get(), | 2843 bad_message::ReceivedBadMessage(process.get(), |
2830 bad_message::RPH_MOJO_PROCESS_ERROR); | 2844 bad_message::RPH_MOJO_PROCESS_ERROR); |
2831 } | 2845 } |
2832 | 2846 |
2833 } // namespace content | 2847 } // namespace content |
OLD | NEW |