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

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

Issue 2931633002: Add a metric to check how often SiteInstances can reuse processes (Closed)
Patch Set: Addressed comments 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 | tools/metrics/histograms/enums.xml » ('j') | 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 3085 matching lines...) Expand 10 before | Expand all | Expand 10 after
3096 render_process_host = GetProcessHostForSite(browser_context, site_url); 3096 render_process_host = GetProcessHostForSite(browser_context, site_url);
3097 break; 3097 break;
3098 case SiteInstanceImpl::ProcessReusePolicy::USE_DEFAULT_SUBFRAME_PROCESS: 3098 case SiteInstanceImpl::ProcessReusePolicy::USE_DEFAULT_SUBFRAME_PROCESS:
3099 DCHECK(SiteIsolationPolicy::IsTopDocumentIsolationEnabled()); 3099 DCHECK(SiteIsolationPolicy::IsTopDocumentIsolationEnabled());
3100 render_process_host = GetDefaultSubframeProcessHost( 3100 render_process_host = GetDefaultSubframeProcessHost(
3101 browser_context, site_instance, is_for_guests_only); 3101 browser_context, site_instance, is_for_guests_only);
3102 break; 3102 break;
3103 case SiteInstanceImpl::ProcessReusePolicy::REUSE_PENDING_OR_COMMITTED_SITE: 3103 case SiteInstanceImpl::ProcessReusePolicy::REUSE_PENDING_OR_COMMITTED_SITE:
3104 render_process_host = 3104 render_process_host =
3105 FindReusableProcessHostForSite(browser_context, site_url); 3105 FindReusableProcessHostForSite(browser_context, site_url);
3106 UMA_HISTOGRAM_BOOLEAN(
3107 "SiteIsolation.ReusePendingOrCommittedSite.CouldReuse",
3108 render_process_host != nullptr);
3106 break; 3109 break;
3107 default: 3110 default:
3108 break; 3111 break;
3109 } 3112 }
3110 3113
3111 // If not (or if none found), see if we should reuse an existing process. 3114 // If not (or if none found), see if we should reuse an existing process.
3112 if (!render_process_host && 3115 if (!render_process_host &&
3113 ShouldTryToUseExistingProcessHost(browser_context, site_url)) { 3116 ShouldTryToUseExistingProcessHost(browser_context, site_url)) {
3114 render_process_host = GetExistingProcessHost(browser_context, site_url); 3117 render_process_host = GetExistingProcessHost(browser_context, site_url);
3115 } 3118 }
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
3626 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3629 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3627 3630
3628 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3631 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3629 // Capture the error message in a crash key value. 3632 // Capture the error message in a crash key value.
3630 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3633 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3631 bad_message::ReceivedBadMessage(render_process_id, 3634 bad_message::ReceivedBadMessage(render_process_id,
3632 bad_message::RPH_MOJO_PROCESS_ERROR); 3635 bad_message::RPH_MOJO_PROCESS_ERROR);
3633 } 3636 }
3634 3637
3635 } // namespace content 3638 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/enums.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698