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

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: 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
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 3061 matching lines...) Expand 10 before | Expand all | Expand 10 after
3072 render_process_host = GetProcessHostForSite(browser_context, site_url); 3072 render_process_host = GetProcessHostForSite(browser_context, site_url);
3073 break; 3073 break;
3074 case SiteInstanceImpl::ProcessReusePolicy::USE_DEFAULT_SUBFRAME_PROCESS: 3074 case SiteInstanceImpl::ProcessReusePolicy::USE_DEFAULT_SUBFRAME_PROCESS:
3075 DCHECK(SiteIsolationPolicy::IsTopDocumentIsolationEnabled()); 3075 DCHECK(SiteIsolationPolicy::IsTopDocumentIsolationEnabled());
3076 render_process_host = GetDefaultSubframeProcessHost( 3076 render_process_host = GetDefaultSubframeProcessHost(
3077 browser_context, site_instance, is_for_guests_only); 3077 browser_context, site_instance, is_for_guests_only);
3078 break; 3078 break;
3079 case SiteInstanceImpl::ProcessReusePolicy::REUSE_PENDING_OR_COMMITTED_SITE: 3079 case SiteInstanceImpl::ProcessReusePolicy::REUSE_PENDING_OR_COMMITTED_SITE:
3080 render_process_host = 3080 render_process_host =
3081 FindReusableProcessHostForSite(browser_context, site_url); 3081 FindReusableProcessHostForSite(browser_context, site_url);
3082 UMA_HISTOGRAM_BOOLEAN("SiteInstance.ReusePendingOrComittedSiteCouldReuse",
Charlie Reis 2017/06/07 20:15:33 typo: Committed
clamy 2017/06/13 15:04:47 Done.
3083 render_process_host != nullptr);
3082 break; 3084 break;
3083 default: 3085 default:
3084 break; 3086 break;
3085 } 3087 }
3086 3088
3087 // If not (or if none found), see if we should reuse an existing process. 3089 // If not (or if none found), see if we should reuse an existing process.
3088 if (!render_process_host && 3090 if (!render_process_host &&
3089 ShouldTryToUseExistingProcessHost(browser_context, site_url)) { 3091 ShouldTryToUseExistingProcessHost(browser_context, site_url)) {
3090 render_process_host = GetExistingProcessHost(browser_context, site_url); 3092 render_process_host = GetExistingProcessHost(browser_context, site_url);
3091 } 3093 }
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
3601 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3603 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3602 3604
3603 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3605 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3604 // Capture the error message in a crash key value. 3606 // Capture the error message in a crash key value.
3605 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3607 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3606 bad_message::ReceivedBadMessage(render_process_id, 3608 bad_message::ReceivedBadMessage(render_process_id,
3607 bad_message::RPH_MOJO_PROCESS_ERROR); 3609 bad_message::RPH_MOJO_PROCESS_ERROR);
3608 } 3610 }
3609 3611
3610 } // namespace content 3612 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698