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

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

Issue 848073002: Fix MojoApplicationHost assertion when navigating from RenderProcessGone. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <algorithm> 10 #include <algorithm>
(...skipping 2021 matching lines...) Expand 10 before | Expand all | Expand 10 after
2032 child_process_launcher_.reset(); 2032 child_process_launcher_.reset();
2033 channel_.reset(); 2033 channel_.reset();
2034 2034
2035 within_process_died_observer_ = true; 2035 within_process_died_observer_ = true;
2036 NotificationService::current()->Notify( 2036 NotificationService::current()->Notify(
2037 NOTIFICATION_RENDERER_PROCESS_CLOSED, 2037 NOTIFICATION_RENDERER_PROCESS_CLOSED,
2038 Source<RenderProcessHost>(this), 2038 Source<RenderProcessHost>(this),
2039 Details<RendererClosedDetails>(&details)); 2039 Details<RendererClosedDetails>(&details));
2040 FOR_EACH_OBSERVER(RenderProcessHostObserver, 2040 FOR_EACH_OBSERVER(RenderProcessHostObserver,
2041 observers_, 2041 observers_,
2042 RenderProcessExited(this, status, exit_code)); 2042 RenderProcessExited(this, status, exit_code));
Sam McNally 2015/02/03 04:28:59 Could RenderProcessExited or NOTIFICATION_RENDERER
Marshall 2015/02/03 19:48:24 A quick survey via codesearch didn't indicate any
2043 within_process_died_observer_ = false; 2043 within_process_died_observer_ = false;
2044 2044
2045 gpu_message_filter_ = NULL; 2045 gpu_message_filter_ = NULL;
2046 message_port_message_filter_ = NULL; 2046 message_port_message_filter_ = NULL;
2047 #if defined(ENABLE_BROWSER_CDMS) 2047 #if defined(ENABLE_BROWSER_CDMS)
2048 browser_cdm_manager_ = NULL; 2048 browser_cdm_manager_ = NULL;
2049 #endif 2049 #endif
2050 RemoveUserData(kSessionStorageHolderKey); 2050 RemoveUserData(kSessionStorageHolderKey);
2051 2051
2052 // RenderProcessGone handlers might navigate or perform other actions that
2053 // require a connection. Ensure that there is one before calling them.
2054 mojo_application_host_.reset(new MojoApplicationHost);
2055
2052 IDMap<IPC::Listener>::iterator iter(&listeners_); 2056 IDMap<IPC::Listener>::iterator iter(&listeners_);
2053 while (!iter.IsAtEnd()) { 2057 while (!iter.IsAtEnd()) {
2054 iter.GetCurrentValue()->OnMessageReceived( 2058 iter.GetCurrentValue()->OnMessageReceived(
2055 ViewHostMsg_RenderProcessGone(iter.GetCurrentKey(), 2059 ViewHostMsg_RenderProcessGone(iter.GetCurrentKey(),
2056 static_cast<int>(status), 2060 static_cast<int>(status),
2057 exit_code)); 2061 exit_code));
2058 iter.Advance(); 2062 iter.Advance();
2059 } 2063 }
2060 2064
2061 mojo_application_host_.reset(new MojoApplicationHost);
2062
2063 // It's possible that one of the calls out to the observers might have caused 2065 // It's possible that one of the calls out to the observers might have caused
2064 // this object to be no longer needed. 2066 // this object to be no longer needed.
2065 if (delayed_cleanup_needed_) 2067 if (delayed_cleanup_needed_)
2066 Cleanup(); 2068 Cleanup();
2067 2069
2068 // This object is not deleted at this point and might be reused later. 2070 // This object is not deleted at this point and might be reused later.
2069 // TODO(darin): clean this up 2071 // TODO(darin): clean this up
2070 } 2072 }
2071 2073
2072 int RenderProcessHostImpl::GetActiveViewCount() { 2074 int RenderProcessHostImpl::GetActiveViewCount() {
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
2359 2361
2360 void RenderProcessHostImpl::DecrementWorkerRefCount() { 2362 void RenderProcessHostImpl::DecrementWorkerRefCount() {
2361 DCHECK_CURRENTLY_ON(BrowserThread::UI); 2363 DCHECK_CURRENTLY_ON(BrowserThread::UI);
2362 DCHECK_GT(worker_ref_count_, 0); 2364 DCHECK_GT(worker_ref_count_, 0);
2363 --worker_ref_count_; 2365 --worker_ref_count_;
2364 if (worker_ref_count_ == 0) 2366 if (worker_ref_count_ == 0)
2365 Cleanup(); 2367 Cleanup();
2366 } 2368 }
2367 2369
2368 } // namespace content 2370 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698