| 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 | |
| 725 RenderProcessHostImpl::~RenderProcessHostImpl() { | 711 RenderProcessHostImpl::~RenderProcessHostImpl() { |
| 726 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 712 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 727 #ifndef NDEBUG | 713 #ifndef NDEBUG |
| 728 DCHECK(is_self_deleted_) | 714 DCHECK(is_self_deleted_) |
| 729 << "RenderProcessHostImpl is destroyed by something other than itself"; | 715 << "RenderProcessHostImpl is destroyed by something other than itself"; |
| 730 #endif | 716 #endif |
| 731 | 717 |
| 732 // Make sure to clean up the in-process renderer before the channel, otherwise | 718 // Make sure to clean up the in-process renderer before the channel, otherwise |
| 733 // it may still run and have its IPCs fail, causing asserts. | 719 // it may still run and have its IPCs fail, causing asserts. |
| 734 in_process_renderer_.reset(); | 720 in_process_renderer_.reset(); |
| (...skipping 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2838 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2824 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 2839 | 2825 |
| 2840 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2826 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
| 2841 // enough information here so that we can determine what the bad message was. | 2827 // enough information here so that we can determine what the bad message was. |
| 2842 base::debug::Alias(&error); | 2828 base::debug::Alias(&error); |
| 2843 bad_message::ReceivedBadMessage(process.get(), | 2829 bad_message::ReceivedBadMessage(process.get(), |
| 2844 bad_message::RPH_MOJO_PROCESS_ERROR); | 2830 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 2845 } | 2831 } |
| 2846 | 2832 |
| 2847 } // namespace content | 2833 } // namespace content |
| OLD | NEW |