OLD | NEW |
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 Loading... |
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 2543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2600 // visibility at this point. https://crbug.com/560446. | 2602 // visibility at this point. https://crbug.com/560446. |
2601 // Except on Android for now because of https://crbug.com/601184 :-(. | 2603 // Except on Android for now because of https://crbug.com/601184 :-(. |
2602 #if defined(OS_ANDROID) | 2604 #if defined(OS_ANDROID) |
2603 UpdateProcessPriority(); | 2605 UpdateProcessPriority(); |
2604 #endif | 2606 #endif |
2605 | 2607 |
2606 // Share histograms between the renderer and this process. | 2608 // Share histograms between the renderer and this process. |
2607 CreateSharedRendererHistogramAllocator(); | 2609 CreateSharedRendererHistogramAllocator(); |
2608 } | 2610 } |
2609 | 2611 |
| 2612 if (memory_coordinator::IsEnabled()) { |
| 2613 BrowserMainLoop::GetInstance()->memory_coordinator()->RendererLaunched( |
| 2614 GetRemoteInterfaces()); |
| 2615 } |
| 2616 |
2610 // NOTE: This needs to be before sending queued messages because | 2617 // NOTE: This needs to be before sending queued messages because |
2611 // ExtensionService uses this notification to initialize the renderer process | 2618 // ExtensionService uses this notification to initialize the renderer process |
2612 // with state that must be there before any JavaScript executes. | 2619 // with state that must be there before any JavaScript executes. |
2613 // | 2620 // |
2614 // The queued messages contain such things as "navigate". If this notification | 2621 // The queued messages contain such things as "navigate". If this notification |
2615 // was after, we can end up executing JavaScript before the initialization | 2622 // was after, we can end up executing JavaScript before the initialization |
2616 // happens. | 2623 // happens. |
2617 NotificationService::current()->Notify(NOTIFICATION_RENDERER_PROCESS_CREATED, | 2624 NotificationService::current()->Notify(NOTIFICATION_RENDERER_PROCESS_CREATED, |
2618 Source<RenderProcessHost>(this), | 2625 Source<RenderProcessHost>(this), |
2619 NotificationService::NoDetails()); | 2626 NotificationService::NoDetails()); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2846 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 2853 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
2847 | 2854 |
2848 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias | 2855 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. Alias |
2849 // enough information here so that we can determine what the bad message was. | 2856 // enough information here so that we can determine what the bad message was. |
2850 base::debug::Alias(&error); | 2857 base::debug::Alias(&error); |
2851 bad_message::ReceivedBadMessage(process.get(), | 2858 bad_message::ReceivedBadMessage(process.get(), |
2852 bad_message::RPH_MOJO_PROCESS_ERROR); | 2859 bad_message::RPH_MOJO_PROCESS_ERROR); |
2853 } | 2860 } |
2854 | 2861 |
2855 } // namespace content | 2862 } // namespace content |
OLD | NEW |