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

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

Issue 2926563005: [GRC] Correctly Invalidate RenderProcessHost's CU Interface (Closed)
Patch Set: Created 3 years, 6 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 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 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after
1771 Send(new ChildProcessMsg_Resume()); 1771 Send(new ChildProcessMsg_Resume());
1772 } 1772 }
1773 1773
1774 mojom::Renderer* RenderProcessHostImpl::GetRendererInterface() { 1774 mojom::Renderer* RenderProcessHostImpl::GetRendererInterface() {
1775 return renderer_interface_.get(); 1775 return renderer_interface_.get();
1776 } 1776 }
1777 1777
1778 resource_coordinator::ResourceCoordinatorInterface* 1778 resource_coordinator::ResourceCoordinatorInterface*
1779 RenderProcessHostImpl::GetProcessResourceCoordinator() { 1779 RenderProcessHostImpl::GetProcessResourceCoordinator() {
1780 if (!process_resource_coordinator_) { 1780 if (!process_resource_coordinator_) {
1781 base::ProcessHandle process_handle = GetHandle();
1782 DCHECK(process_handle);
1783
1781 process_resource_coordinator_ = 1784 process_resource_coordinator_ =
1782 base::MakeUnique<resource_coordinator::ResourceCoordinatorInterface>( 1785 base::MakeUnique<resource_coordinator::ResourceCoordinatorInterface>(
1783 ServiceManagerConnection::GetForProcess()->GetConnector(), 1786 ServiceManagerConnection::GetForProcess()->GetConnector(),
1784 resource_coordinator::CoordinationUnitType::kProcess, 1787 resource_coordinator::CoordinationUnitType::kProcess,
1785 base::Process(GetHandle()).Pid()); 1788 base::Process(process_handle).Pid());
1786 } 1789 }
1787 return process_resource_coordinator_.get(); 1790 return process_resource_coordinator_.get();
1788 } 1791 }
1789 1792
1790 void RenderProcessHostImpl::SetIsNeverSuitableForReuse() { 1793 void RenderProcessHostImpl::SetIsNeverSuitableForReuse() {
1791 is_never_suitable_for_reuse_ = true; 1794 is_never_suitable_for_reuse_ = true;
1792 } 1795 }
1793 1796
1794 bool RenderProcessHostImpl::MayReuseHost() { 1797 bool RenderProcessHostImpl::MayReuseHost() {
1795 if (is_never_suitable_for_reuse_) 1798 if (is_never_suitable_for_reuse_)
(...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after
3194 } 3197 }
3195 } 3198 }
3196 3199
3197 RendererClosedDetails details(status, exit_code); 3200 RendererClosedDetails details(status, exit_code);
3198 3201
3199 child_process_launcher_.reset(); 3202 child_process_launcher_.reset();
3200 is_dead_ = true; 3203 is_dead_ = true;
3201 if (route_provider_binding_.is_bound()) 3204 if (route_provider_binding_.is_bound())
3202 route_provider_binding_.Close(); 3205 route_provider_binding_.Close();
3203 associated_interfaces_.reset(); 3206 associated_interfaces_.reset();
3207 process_resource_coordinator_.reset();
3204 ResetChannelProxy(); 3208 ResetChannelProxy();
3205 3209
3206 UpdateProcessPriority(); 3210 UpdateProcessPriority();
3207 3211
3208 within_process_died_observer_ = true; 3212 within_process_died_observer_ = true;
3209 NotificationService::current()->Notify( 3213 NotificationService::current()->Notify(
3210 NOTIFICATION_RENDERER_PROCESS_CLOSED, Source<RenderProcessHost>(this), 3214 NOTIFICATION_RENDERER_PROCESS_CLOSED, Source<RenderProcessHost>(this),
3211 Details<RendererClosedDetails>(&details)); 3215 Details<RendererClosedDetails>(&details));
3212 for (auto& observer : observers_) 3216 for (auto& observer : observers_)
3213 observer.RenderProcessExited(this, status, exit_code); 3217 observer.RenderProcessExited(this, status, exit_code);
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
3621 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3625 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3622 3626
3623 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3627 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3624 // Capture the error message in a crash key value. 3628 // Capture the error message in a crash key value.
3625 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3629 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3626 bad_message::ReceivedBadMessage(render_process_id, 3630 bad_message::ReceivedBadMessage(render_process_id,
3627 bad_message::RPH_MOJO_PROCESS_ERROR); 3631 bad_message::RPH_MOJO_PROCESS_ERROR);
3628 } 3632 }
3629 3633
3630 } // namespace content 3634 } // 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