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

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

Issue 2607513002: Remove Render.Workers.MaxWorkerCountInRendererProcess UMA. (Closed)
Patch Set: Created 3 years, 12 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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 storage_partition_impl_(storage_partition_impl), 676 storage_partition_impl_(storage_partition_impl),
677 sudden_termination_allowed_(true), 677 sudden_termination_allowed_(true),
678 ignore_input_events_(false), 678 ignore_input_events_(false),
679 is_for_guests_only_(is_for_guests_only), 679 is_for_guests_only_(is_for_guests_only),
680 gpu_observer_registered_(false), 680 gpu_observer_registered_(false),
681 delayed_cleanup_needed_(false), 681 delayed_cleanup_needed_(false),
682 within_process_died_observer_(false), 682 within_process_died_observer_(false),
683 #if BUILDFLAG(ENABLE_WEBRTC) 683 #if BUILDFLAG(ENABLE_WEBRTC)
684 webrtc_eventlog_host_(id_), 684 webrtc_eventlog_host_(id_),
685 #endif 685 #endif
686 max_worker_count_(0),
687 permission_service_context_(new PermissionServiceContext(this)), 686 permission_service_context_(new PermissionServiceContext(this)),
688 channel_connected_(false), 687 channel_connected_(false),
689 sent_render_process_ready_(false), 688 sent_render_process_ready_(false),
690 #if defined(OS_ANDROID) 689 #if defined(OS_ANDROID)
691 never_signaled_(base::WaitableEvent::ResetPolicy::MANUAL, 690 never_signaled_(base::WaitableEvent::ResetPolicy::MANUAL,
692 base::WaitableEvent::InitialState::NOT_SIGNALED), 691 base::WaitableEvent::InitialState::NOT_SIGNALED),
693 #endif 692 #endif
694 instance_weak_factory_( 693 instance_weak_factory_(
695 new base::WeakPtrFactory<RenderProcessHostImpl>(this)), 694 new base::WeakPtrFactory<RenderProcessHostImpl>(this)),
696 weak_factory_(this) { 695 weak_factory_(this) {
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
1381 1380
1382 size_t RenderProcessHostImpl::GetWorkerRefCount() const { 1381 size_t RenderProcessHostImpl::GetWorkerRefCount() const {
1383 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1382 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1384 return service_worker_ref_count_ + shared_worker_ref_count_; 1383 return service_worker_ref_count_ + shared_worker_ref_count_;
1385 } 1384 }
1386 1385
1387 void RenderProcessHostImpl::IncrementServiceWorkerRefCount() { 1386 void RenderProcessHostImpl::IncrementServiceWorkerRefCount() {
1388 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1387 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1389 DCHECK(!is_worker_ref_count_disabled_); 1388 DCHECK(!is_worker_ref_count_disabled_);
1390 ++service_worker_ref_count_; 1389 ++service_worker_ref_count_;
1391 if (GetWorkerRefCount() > max_worker_count_)
1392 max_worker_count_ = GetWorkerRefCount();
1393 } 1390 }
1394 1391
1395 void RenderProcessHostImpl::DecrementServiceWorkerRefCount() { 1392 void RenderProcessHostImpl::DecrementServiceWorkerRefCount() {
1396 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1393 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1397 DCHECK(!is_worker_ref_count_disabled_); 1394 DCHECK(!is_worker_ref_count_disabled_);
1398 DCHECK_GT(GetWorkerRefCount(), 0U); 1395 DCHECK_GT(GetWorkerRefCount(), 0U);
1399 --service_worker_ref_count_; 1396 --service_worker_ref_count_;
1400 if (GetWorkerRefCount() == 0) 1397 if (GetWorkerRefCount() == 0)
1401 Cleanup(); 1398 Cleanup();
1402 } 1399 }
1403 1400
1404 void RenderProcessHostImpl::IncrementSharedWorkerRefCount() { 1401 void RenderProcessHostImpl::IncrementSharedWorkerRefCount() {
1405 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1402 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1406 DCHECK(!is_worker_ref_count_disabled_); 1403 DCHECK(!is_worker_ref_count_disabled_);
1407 ++shared_worker_ref_count_; 1404 ++shared_worker_ref_count_;
1408 if (GetWorkerRefCount() > max_worker_count_)
1409 max_worker_count_ = GetWorkerRefCount();
1410 } 1405 }
1411 1406
1412 void RenderProcessHostImpl::DecrementSharedWorkerRefCount() { 1407 void RenderProcessHostImpl::DecrementSharedWorkerRefCount() {
1413 DCHECK_CURRENTLY_ON(BrowserThread::UI); 1408 DCHECK_CURRENTLY_ON(BrowserThread::UI);
1414 DCHECK(!is_worker_ref_count_disabled_); 1409 DCHECK(!is_worker_ref_count_disabled_);
1415 DCHECK_GT(GetWorkerRefCount(), 0U); 1410 DCHECK_GT(GetWorkerRefCount(), 0U);
1416 --shared_worker_ref_count_; 1411 --shared_worker_ref_count_;
1417 if (GetWorkerRefCount() == 0) 1412 if (GetWorkerRefCount() == 0)
1418 Cleanup(); 1413 Cleanup();
1419 } 1414 }
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
2137 if (is_initialized_) 2132 if (is_initialized_)
2138 ClearWebRtcLogMessageCallback(); 2133 ClearWebRtcLogMessageCallback();
2139 #endif 2134 #endif
2140 2135
2141 if (!survive_for_worker_start_time_.is_null()) { 2136 if (!survive_for_worker_start_time_.is_null()) {
2142 UMA_HISTOGRAM_LONG_TIMES( 2137 UMA_HISTOGRAM_LONG_TIMES(
2143 "SharedWorker.RendererSurviveForWorkerTime", 2138 "SharedWorker.RendererSurviveForWorkerTime",
2144 base::TimeTicks::Now() - survive_for_worker_start_time_); 2139 base::TimeTicks::Now() - survive_for_worker_start_time_);
2145 } 2140 }
2146 2141
2147 if (max_worker_count_ > 0) {
2148 // Record the max number of workers (SharedWorker or ServiceWorker)
2149 // that are simultaneously hosted in this renderer process.
2150 UMA_HISTOGRAM_COUNTS("Render.Workers.MaxWorkerCountInRendererProcess",
2151 max_worker_count_);
2152 }
2153
2154 // We cannot clean up twice; if this fails, there is an issue with our 2142 // We cannot clean up twice; if this fails, there is an issue with our
2155 // control flow. 2143 // control flow.
2156 DCHECK(!deleting_soon_); 2144 DCHECK(!deleting_soon_);
2157 2145
2158 DCHECK_EQ(0, pending_views_); 2146 DCHECK_EQ(0, pending_views_);
2159 2147
2160 // If the process associated with this RenderProcessHost is still alive, 2148 // If the process associated with this RenderProcessHost is still alive,
2161 // notify all observers that the process has exited cleanly, even though it 2149 // notify all observers that the process has exited cleanly, even though it
2162 // will be destroyed a bit later. Observers shouldn't rely on this process 2150 // will be destroyed a bit later. Observers shouldn't rely on this process
2163 // anymore. 2151 // anymore.
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
3014 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 3002 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
3015 3003
3016 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. 3004 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing.
3017 // Capture the error message in a crash key value. 3005 // Capture the error message in a crash key value.
3018 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); 3006 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error);
3019 bad_message::ReceivedBadMessage(render_process_id, 3007 bad_message::ReceivedBadMessage(render_process_id,
3020 bad_message::RPH_MOJO_PROCESS_ERROR); 3008 bad_message::RPH_MOJO_PROCESS_ERROR);
3021 } 3009 }
3022 3010
3023 } // namespace content 3011 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.h ('k') | content/public/browser/render_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698