Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2222063002: Check that all shared workers are terminated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 NOTREACHED() << "There should be only one RenderProcessHost when running " 705 NOTREACHED() << "There should be only one RenderProcessHost when running "
706 << "in-process."; 706 << "in-process.";
707 } 707 }
708 } 708 }
709 709
710 void RenderProcessHostImpl::RegisterRendererMainThreadFactory( 710 void RenderProcessHostImpl::RegisterRendererMainThreadFactory(
711 RendererMainThreadFactoryFunction create) { 711 RendererMainThreadFactoryFunction create) {
712 g_renderer_main_thread_factory = create; 712 g_renderer_main_thread_factory = create;
713 } 713 }
714 714
715 // static
716 // TODO(alokp): Remove after collecting crash data.
717 // Temporary checks to verify that all shared workers are terminated.
horo 2016/08/09 04:03:24 Nit: s/shared workers/shared workers and service w
alokp 2016/08/09 05:07:26 Thanks for reviewing. I just commented about share
horo 2016/08/09 06:01:26 I just suggested that you should change the commen
alokp 2016/08/09 06:35:27 For more context see crbug.com/628192 All audio s
horo 2016/08/09 09:00:52 Ah I got it. I checked ServiceWorkerProcessManage
718 // It is suspected that shared workers prevent render process hosts
719 // from shutting down: crbug.com/608049
720 void RenderProcessHostImpl::CheckAllWorkersTerminated() {
721 iterator iter(AllHostsIterator());
722 while (!iter.IsAtEnd()) {
723 RenderProcessHostImpl* host =
724 static_cast<RenderProcessHostImpl*>(iter.GetCurrentValue());
725 CHECK_EQ(0, host->worker_ref_count_);
falken 2016/09/02 07:47:45 This would infinitely loop, no? iter.Advance() sho
726 }
727 }
728
715 RenderProcessHostImpl::~RenderProcessHostImpl() { 729 RenderProcessHostImpl::~RenderProcessHostImpl() {
716 #ifndef NDEBUG 730 #ifndef NDEBUG
717 DCHECK(is_self_deleted_) 731 DCHECK(is_self_deleted_)
718 << "RenderProcessHostImpl is destroyed by something other than itself"; 732 << "RenderProcessHostImpl is destroyed by something other than itself";
719 #endif 733 #endif
720 734
721 // Make sure to clean up the in-process renderer before the channel, otherwise 735 // Make sure to clean up the in-process renderer before the channel, otherwise
722 // it may still run and have its IPCs fail, causing asserts. 736 // it may still run and have its IPCs fail, causing asserts.
723 in_process_renderer_.reset(); 737 in_process_renderer_.reset();
724 738
(...skipping 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after
2828 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 2842 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
2829 2843
2830 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias 2844 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias
2831 // enough information here so that we can determine what the bad message was. 2845 // enough information here so that we can determine what the bad message was.
2832 base::debug::Alias(&error); 2846 base::debug::Alias(&error);
2833 bad_message::ReceivedBadMessage(process.get(), 2847 bad_message::ReceivedBadMessage(process.get(),
2834 bad_message::RPH_MOJO_PROCESS_ERROR); 2848 bad_message::RPH_MOJO_PROCESS_ERROR);
2835 } 2849 }
2836 2850
2837 } // namespace content 2851 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698