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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 1875503003: Revert "Create and pass shared-histogram-allocator from browser to renderer." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index b4bc8dd842b83a925c6c275c76c1a1952fb0fdbb..522378eabfbd848d23635229a6bdb934c14ba3a9 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -24,12 +24,8 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/shared_memory.h"
-#include "base/memory/shared_memory_handle.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
-#include "base/metrics/persistent_histogram_allocator.h"
-#include "base/metrics/persistent_memory_allocator.h"
#include "base/process/process_handle.h"
#include "base/rand_util.h"
#include "base/single_thread_task_runner.h"
@@ -1123,11 +1119,6 @@ ServiceRegistry* RenderProcessHostImpl::GetServiceRegistry() {
return mojo_application_host_->service_registry();
}
-scoped_ptr<base::SharedPersistentMemoryAllocator>
-RenderProcessHostImpl::TakeMetricsAllocator() {
- return std::move(metrics_allocator_);
-}
-
const base::TimeTicks& RenderProcessHostImpl::GetInitTimeForNavigationMetrics()
const {
return init_time_;
@@ -2367,31 +2358,6 @@ void RenderProcessHostImpl::RegisterProcessHostForSite(
map->RegisterProcess(site, process);
}
-void RenderProcessHostImpl::CreateSharedRendererHistogramAllocator() {
- DCHECK(!metrics_allocator_);
-
- // Create a persistent memory segment for renderer histograms only if
- // they're active in the browser.
- if (!base::GlobalHistogramAllocator::Get())
- return;
-
- // Get handle to the renderer process. Stop if there is none.
- base::ProcessHandle destination = GetHandle();
- if (destination == base::kNullProcessHandle)
- return;
-
- // TODO(bcwhite): Update this with the correct memory size.
- scoped_ptr<base::SharedMemory> shm(new base::SharedMemory());
- shm->CreateAndMapAnonymous(2 << 20); // 2 MiB
- metrics_allocator_.reset(new base::SharedPersistentMemoryAllocator(
- std::move(shm), GetID(), "RendererMetrics", /*readonly=*/false));
-
- base::SharedMemoryHandle shm_handle;
- metrics_allocator_->shared_memory()->ShareToProcess(destination, &shm_handle);
- Send(new ChildProcessMsg_SetHistogramMemory(
- shm_handle, metrics_allocator_->shared_memory()->mapped_size()));
-}
-
void RenderProcessHostImpl::ProcessDied(bool already_dead,
RendererClosedDetails* known_details) {
// Our child process has died. If we didn't expect it, it's a crash.
@@ -2594,9 +2560,6 @@ void RenderProcessHostImpl::OnProcessLaunched() {
#if defined(OS_ANDROID)
UpdateProcessPriority();
#endif
-
- // Share histograms between the renderer and this process.
- CreateSharedRendererHistogramAllocator();
}
// NOTE: This needs to be before sending queued messages because
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.h ('k') | content/child/child_histogram_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698