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

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

Issue 2094583002: Add MemoryCoordinator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn Created 4 years, 5 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 26 matching lines...) Expand all
37 #include "base/strings/stringprintf.h" 37 #include "base/strings/stringprintf.h"
38 #include "base/supports_user_data.h" 38 #include "base/supports_user_data.h"
39 #include "base/sys_info.h" 39 #include "base/sys_info.h"
40 #include "base/threading/thread.h" 40 #include "base/threading/thread.h"
41 #include "base/threading/thread_restrictions.h" 41 #include "base/threading/thread_restrictions.h"
42 #include "base/threading/thread_task_runner_handle.h" 42 #include "base/threading/thread_task_runner_handle.h"
43 #include "base/trace_event/trace_event.h" 43 #include "base/trace_event/trace_event.h"
44 #include "base/tracked_objects.h" 44 #include "base/tracked_objects.h"
45 #include "build/build_config.h" 45 #include "build/build_config.h"
46 #include "cc/base/switches.h" 46 #include "cc/base/switches.h"
47 #include "components/memory_coordinator/browser/memory_coordinator_impl.h"
48 #include "components/memory_coordinator/common/memory_coordinator_features.h"
47 #include "components/scheduler/common/scheduler_switches.h" 49 #include "components/scheduler/common/scheduler_switches.h"
48 #include "components/tracing/common/tracing_switches.h" 50 #include "components/tracing/common/tracing_switches.h"
49 #include "components/webmessaging/broadcast_channel_provider.h" 51 #include "components/webmessaging/broadcast_channel_provider.h"
50 #include "content/browser/appcache/appcache_dispatcher_host.h" 52 #include "content/browser/appcache/appcache_dispatcher_host.h"
51 #include "content/browser/appcache/chrome_appcache_service.h" 53 #include "content/browser/appcache/chrome_appcache_service.h"
52 #include "content/browser/background_sync/background_sync_service_impl.h" 54 #include "content/browser/background_sync/background_sync_service_impl.h"
53 #include "content/browser/bad_message.h" 55 #include "content/browser/bad_message.h"
54 #include "content/browser/blob_storage/blob_dispatcher_host.h" 56 #include "content/browser/blob_storage/blob_dispatcher_host.h"
55 #include "content/browser/blob_storage/chrome_blob_storage_context.h" 57 #include "content/browser/blob_storage/chrome_blob_storage_context.h"
56 #include "content/browser/browser_child_process_host_impl.h" 58 #include "content/browser/browser_child_process_host_impl.h"
(...skipping 2524 matching lines...) Expand 10 before | Expand all | Expand 10 after
2581 // visibility at this point. https://crbug.com/560446. 2583 // visibility at this point. https://crbug.com/560446.
2582 // Except on Android for now because of https://crbug.com/601184 :-(. 2584 // Except on Android for now because of https://crbug.com/601184 :-(.
2583 #if defined(OS_ANDROID) 2585 #if defined(OS_ANDROID)
2584 UpdateProcessPriority(); 2586 UpdateProcessPriority();
2585 #endif 2587 #endif
2586 2588
2587 // Share histograms between the renderer and this process. 2589 // Share histograms between the renderer and this process.
2588 CreateSharedRendererHistogramAllocator(); 2590 CreateSharedRendererHistogramAllocator();
2589 } 2591 }
2590 2592
2593 if (memory_coordinator::IsEnabled()) {
2594 BrowserMainLoop::GetInstance()->memory_coordinator()->RendererLaunched(
2595 GetRemoteInterfaces());
2596 }
2597
2591 // NOTE: This needs to be before sending queued messages because 2598 // NOTE: This needs to be before sending queued messages because
2592 // ExtensionService uses this notification to initialize the renderer process 2599 // ExtensionService uses this notification to initialize the renderer process
2593 // with state that must be there before any JavaScript executes. 2600 // with state that must be there before any JavaScript executes.
2594 // 2601 //
2595 // The queued messages contain such things as "navigate". If this notification 2602 // The queued messages contain such things as "navigate". If this notification
2596 // was after, we can end up executing JavaScript before the initialization 2603 // was after, we can end up executing JavaScript before the initialization
2597 // happens. 2604 // happens.
2598 NotificationService::current()->Notify(NOTIFICATION_RENDERER_PROCESS_CREATED, 2605 NotificationService::current()->Notify(NOTIFICATION_RENDERER_PROCESS_CREATED,
2599 Source<RenderProcessHost>(this), 2606 Source<RenderProcessHost>(this),
2600 NotificationService::NoDetails()); 2607 NotificationService::NoDetails());
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
2827 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; 2834 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error;
2828 2835
2829 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias 2836 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias
2830 // enough information here so that we can determine what the bad message was. 2837 // enough information here so that we can determine what the bad message was.
2831 base::debug::Alias(&error); 2838 base::debug::Alias(&error);
2832 bad_message::ReceivedBadMessage(process.get(), 2839 bad_message::ReceivedBadMessage(process.get(),
2833 bad_message::RPH_MOJO_PROCESS_ERROR); 2840 bad_message::RPH_MOJO_PROCESS_ERROR);
2834 } 2841 }
2835 2842
2836 } // namespace content 2843 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698