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

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

Issue 662103002: Reset child_process_launcher after notifying observers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Created 6 years, 2 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 1885 matching lines...) Expand 10 before | Expand all | Expand 10 after
1896 int exit_code = 0; 1896 int exit_code = 0;
1897 base::TerminationStatus status = 1897 base::TerminationStatus status =
1898 child_process_launcher_.get() ? 1898 child_process_launcher_.get() ?
1899 child_process_launcher_->GetChildTerminationStatus(already_dead, 1899 child_process_launcher_->GetChildTerminationStatus(already_dead,
1900 &exit_code) : 1900 &exit_code) :
1901 base::TERMINATION_STATUS_NORMAL_TERMINATION; 1901 base::TERMINATION_STATUS_NORMAL_TERMINATION;
1902 1902
1903 RendererClosedDetails details(GetHandle(), status, exit_code); 1903 RendererClosedDetails details(GetHandle(), status, exit_code);
1904 mojo_application_host_->WillDestroySoon(); 1904 mojo_application_host_->WillDestroySoon();
1905 1905
1906 child_process_launcher_.reset();
no sievers 2014/10/17 19:08:29 This should already provide the old handle because
1907 channel_.reset(); 1906 channel_.reset();
1908 1907
1909 within_process_died_observer_ = true; 1908 within_process_died_observer_ = true;
1910 NotificationService::current()->Notify( 1909 NotificationService::current()->Notify(
1911 NOTIFICATION_RENDERER_PROCESS_CLOSED, 1910 NOTIFICATION_RENDERER_PROCESS_CLOSED,
1912 Source<RenderProcessHost>(this), 1911 Source<RenderProcessHost>(this),
1913 Details<RendererClosedDetails>(&details)); 1912 Details<RendererClosedDetails>(&details));
1914 FOR_EACH_OBSERVER(RenderProcessHostObserver, 1913 FOR_EACH_OBSERVER(RenderProcessHostObserver,
1915 observers_, 1914 observers_,
1916 RenderProcessExited(this, status, exit_code)); 1915 RenderProcessExited(this, status, exit_code));
1917 within_process_died_observer_ = false; 1916 within_process_died_observer_ = false;
1918 1917
1918 child_process_launcher_.reset();
1919 gpu_message_filter_ = NULL; 1919 gpu_message_filter_ = NULL;
1920 message_port_message_filter_ = NULL; 1920 message_port_message_filter_ = NULL;
1921 RemoveUserData(kSessionStorageHolderKey); 1921 RemoveUserData(kSessionStorageHolderKey);
1922 1922
1923 IDMap<IPC::Listener>::iterator iter(&listeners_); 1923 IDMap<IPC::Listener>::iterator iter(&listeners_);
1924 while (!iter.IsAtEnd()) { 1924 while (!iter.IsAtEnd()) {
1925 iter.GetCurrentValue()->OnMessageReceived( 1925 iter.GetCurrentValue()->OnMessageReceived(
1926 ViewHostMsg_RenderProcessGone(iter.GetCurrentKey(), 1926 ViewHostMsg_RenderProcessGone(iter.GetCurrentKey(),
1927 static_cast<int>(status), 1927 static_cast<int>(status),
1928 exit_code)); 1928 exit_code));
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
2234 2234
2235 void RenderProcessHostImpl::DecrementWorkerRefCount() { 2235 void RenderProcessHostImpl::DecrementWorkerRefCount() {
2236 DCHECK_CURRENTLY_ON(BrowserThread::UI); 2236 DCHECK_CURRENTLY_ON(BrowserThread::UI);
2237 DCHECK_GT(worker_ref_count_, 0); 2237 DCHECK_GT(worker_ref_count_, 0);
2238 --worker_ref_count_; 2238 --worker_ref_count_;
2239 if (worker_ref_count_ == 0) 2239 if (worker_ref_count_ == 0)
2240 Cleanup(); 2240 Cleanup();
2241 } 2241 }
2242 2242
2243 } // namespace content 2243 } // 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