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

Side by Side Diff: content/browser/browser_child_process_host_impl.cc

Issue 2882513004: Remove renderer notifications of memory pressure. (Closed)
Patch Set: Merge Created 3 years, 7 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
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/devtools/protocol/memory_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "content/browser/browser_child_process_host_impl.h" 5 #include "content/browser/browser_child_process_host_impl.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 10 matching lines...) Expand all
21 #include "base/metrics/persistent_memory_allocator.h" 21 #include "base/metrics/persistent_memory_allocator.h"
22 #include "base/stl_util.h" 22 #include "base/stl_util.h"
23 #include "base/strings/string_util.h" 23 #include "base/strings/string_util.h"
24 #include "base/strings/stringprintf.h" 24 #include "base/strings/stringprintf.h"
25 #include "base/synchronization/waitable_event.h" 25 #include "base/synchronization/waitable_event.h"
26 #include "base/threading/thread_task_runner_handle.h" 26 #include "base/threading/thread_task_runner_handle.h"
27 #include "build/build_config.h" 27 #include "build/build_config.h"
28 #include "components/tracing/common/tracing_switches.h" 28 #include "components/tracing/common/tracing_switches.h"
29 #include "content/browser/histogram_message_filter.h" 29 #include "content/browser/histogram_message_filter.h"
30 #include "content/browser/loader/resource_message_filter.h" 30 #include "content/browser/loader/resource_message_filter.h"
31 #include "content/browser/memory/memory_message_filter.h"
32 #include "content/browser/profiler_message_filter.h" 31 #include "content/browser/profiler_message_filter.h"
33 #include "content/browser/service_manager/service_manager_context.h" 32 #include "content/browser/service_manager/service_manager_context.h"
34 #include "content/browser/tracing/trace_message_filter.h" 33 #include "content/browser/tracing/trace_message_filter.h"
35 #include "content/common/child_process_host_impl.h" 34 #include "content/common/child_process_host_impl.h"
36 #include "content/common/child_process_messages.h" 35 #include "content/common/child_process_messages.h"
37 #include "content/common/service_manager/child_connection.h" 36 #include "content/common/service_manager/child_connection.h"
38 #include "content/public/browser/browser_child_process_host_delegate.h" 37 #include "content/public/browser/browser_child_process_host_delegate.h"
39 #include "content/public/browser/browser_child_process_observer.h" 38 #include "content/public/browser/browser_child_process_observer.h"
40 #include "content/public/browser/browser_thread.h" 39 #include "content/public/browser/browser_thread.h"
41 #include "content/public/browser/child_process_data.h" 40 #include "content/public/browser/child_process_data.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 channel_(nullptr), 151 channel_(nullptr),
153 is_channel_connected_(false), 152 is_channel_connected_(false),
154 notify_child_disconnected_(false), 153 notify_child_disconnected_(false),
155 weak_factory_(this) { 154 weak_factory_(this) {
156 data_.id = ChildProcessHostImpl::GenerateChildProcessUniqueId(); 155 data_.id = ChildProcessHostImpl::GenerateChildProcessUniqueId();
157 156
158 child_process_host_.reset(ChildProcessHost::Create(this)); 157 child_process_host_.reset(ChildProcessHost::Create(this));
159 AddFilter(new TraceMessageFilter(data_.id)); 158 AddFilter(new TraceMessageFilter(data_.id));
160 AddFilter(new ProfilerMessageFilter(process_type)); 159 AddFilter(new ProfilerMessageFilter(process_type));
161 AddFilter(new HistogramMessageFilter); 160 AddFilter(new HistogramMessageFilter);
162 AddFilter(new MemoryMessageFilter(this, process_type));
163 161
164 g_child_process_list.Get().push_back(this); 162 g_child_process_list.Get().push_back(this);
165 GetContentClient()->browser()->BrowserChildProcessHostCreated(this); 163 GetContentClient()->browser()->BrowserChildProcessHostCreated(this);
166 164
167 if (!service_name.empty()) { 165 if (!service_name.empty()) {
168 DCHECK_CURRENTLY_ON(BrowserThread::IO); 166 DCHECK_CURRENTLY_ON(BrowserThread::IO);
169 service_manager::Identity child_identity( 167 service_manager::Identity child_identity(
170 service_name, service_manager::mojom::kInheritUserID, 168 service_name, service_manager::mojom::kInheritUserID,
171 base::StringPrintf("%d", data_.id)); 169 base::StringPrintf("%d", data_.id));
172 child_connection_.reset( 170 child_connection_.reset(
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 597
600 #if defined(OS_WIN) 598 #if defined(OS_WIN)
601 599
602 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { 600 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) {
603 OnChildDisconnected(); 601 OnChildDisconnected();
604 } 602 }
605 603
606 #endif 604 #endif
607 605
608 } // namespace content 606 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/devtools/protocol/memory_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698