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

Side by Side Diff: content/browser/memory/memory_message_filter.h

Issue 1641813002: Provide renderers with memory pressure signals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@contentapi
Patch Set: Addressed creis' comments. Created 4 years, 10 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 2015 The Chromium Authors. All rights reserved. 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 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 #ifndef CONTENT_BROWSER_MEMORY_MEMORY_MESSAGE_FILTER_H_ 5 #ifndef CONTENT_BROWSER_MEMORY_MEMORY_MESSAGE_FILTER_H_
6 #define CONTENT_BROWSER_MEMORY_MEMORY_MESSAGE_FILTER_H_ 6 #define CONTENT_BROWSER_MEMORY_MEMORY_MESSAGE_FILTER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/memory_pressure_listener.h" 9 #include "base/memory/memory_pressure_listener.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
(...skipping 18 matching lines...) Expand all
29 void OnChannelClosing() override; 29 void OnChannelClosing() override;
30 bool OnMessageReceived(const IPC::Message& message) override; 30 bool OnMessageReceived(const IPC::Message& message) override;
31 31
32 void SendSetPressureNotificationsSuppressed(bool suppressed); 32 void SendSetPressureNotificationsSuppressed(bool suppressed);
33 void SendSimulatePressureNotification( 33 void SendSimulatePressureNotification(
34 base::MemoryPressureListener::MemoryPressureLevel level); 34 base::MemoryPressureListener::MemoryPressureLevel level);
35 void SendPressureNotification( 35 void SendPressureNotification(
36 base::MemoryPressureListener::MemoryPressureLevel level); 36 base::MemoryPressureListener::MemoryPressureLevel level);
37 37
38 protected: 38 protected:
39 friend class MemoryPressureController; 39 friend class MemoryPressureControllerImpl;
40 40
41 ~MemoryMessageFilter() override; 41 ~MemoryMessageFilter() override;
42 42
43 const void* process_host() const { return process_host_; } 43 const void* process_host() const { return process_host_; }
44 ProcessType process_type() const { return process_type_; } 44 ProcessType process_type() const { return process_type_; }
45 45
46 private: 46 private:
47 // The untyped process host and ProcessType associated with this filter 47 // The untyped process host and ProcessType associated with this filter
48 // instance. The process host is stored as untyped because it is only used as 48 // instance. The process host is stored as untyped because it is only used as
49 // a key in MemoryPressureController; at no point is it ever deferenced to 49 // a key in MemoryPressureControllerImpl; at no point is it ever deferenced to
50 // invoke any members on a process host. 50 // invoke any members on a process host.
51 const void* process_host_; 51 const void* process_host_;
52 ProcessType process_type_; 52 ProcessType process_type_;
53 53
54 DISALLOW_COPY_AND_ASSIGN(MemoryMessageFilter); 54 DISALLOW_COPY_AND_ASSIGN(MemoryMessageFilter);
55 }; 55 };
56 56
57 } // namespace content 57 } // namespace content
58 58
59 #endif // CONTENT_BROWSER_MEMORY_MEMORY_MESSAGE_FILTER_H_ 59 #endif // CONTENT_BROWSER_MEMORY_MEMORY_MESSAGE_FILTER_H_
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/memory_handler.cc ('k') | content/browser/memory/memory_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698