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

Side by Side Diff: content/browser/memory/memory_message_filter.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
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/browser/memory/memory_message_filter.h"
6
7 #include "content/browser/memory/memory_pressure_controller_impl.h"
8 #include "content/common/memory_messages.h"
9
10 namespace content {
11
12 MemoryMessageFilter::MemoryMessageFilter(
13 const BrowserChildProcessHost* child_process_host,
14 ProcessType process_type)
15 : BrowserMessageFilter(MemoryMsgStart),
16 process_host_(child_process_host),
17 process_type_(process_type) {
18 DCHECK_NE(process_type_, PROCESS_TYPE_RENDERER);
19 }
20
21 MemoryMessageFilter::MemoryMessageFilter(
22 const RenderProcessHost* render_process_host)
23 : BrowserMessageFilter(MemoryMsgStart),
24 process_host_(render_process_host),
25 process_type_(PROCESS_TYPE_RENDERER) {}
26
27 MemoryMessageFilter::~MemoryMessageFilter() {}
28
29 void MemoryMessageFilter::OnFilterAdded(IPC::Channel* channel) {
30 MemoryPressureControllerImpl::GetInstance()->OnMemoryMessageFilterAdded(this);
31 }
32
33 void MemoryMessageFilter::OnChannelClosing() {
34 MemoryPressureControllerImpl::GetInstance()
35 ->OnMemoryMessageFilterRemoved(this);
36 }
37
38 bool MemoryMessageFilter::OnMessageReceived(const IPC::Message& message) {
39 return false;
40 }
41
42 void MemoryMessageFilter::SendSetPressureNotificationsSuppressed(
43 bool suppressed) {
44 Send(new MemoryMsg_SetPressureNotificationsSuppressed(suppressed));
45 }
46
47 void MemoryMessageFilter::SendSimulatePressureNotification(
48 base::MemoryPressureListener::MemoryPressureLevel level) {
49 Send(new MemoryMsg_SimulatePressureNotification(level));
50 }
51
52 void MemoryMessageFilter::SendPressureNotification(
53 base::MemoryPressureListener::MemoryPressureLevel level) {
54 Send(new MemoryMsg_PressureNotification(level));
55 }
56
57 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/memory/memory_message_filter.h ('k') | content/browser/memory/memory_pressure_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698