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

Side by Side Diff: base/memory/memory_pressure_listener.cc

Issue 2691573003: base: Remove auto raw pointer deduction. (Closed)
Patch Set: update Created 3 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
« no previous file with comments | « base/i18n/character_encoding.cc ('k') | base/message_loop/message_loop.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/memory/memory_pressure_listener.h" 5 #include "base/memory/memory_pressure_listener.h"
6 6
7 #include "base/observer_list_threadsafe.h" 7 #include "base/observer_list_threadsafe.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 9
10 namespace base { 10 namespace base {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 private: 44 private:
45 scoped_refptr<ObserverListThreadSafe<MemoryPressureListener>> 45 scoped_refptr<ObserverListThreadSafe<MemoryPressureListener>>
46 async_observers_; 46 async_observers_;
47 ObserverList<MemoryPressureListener>* sync_observers_; 47 ObserverList<MemoryPressureListener>* sync_observers_;
48 Lock sync_observers_lock_; 48 Lock sync_observers_lock_;
49 49
50 DISALLOW_COPY_AND_ASSIGN(MemoryPressureObserver); 50 DISALLOW_COPY_AND_ASSIGN(MemoryPressureObserver);
51 }; 51 };
52 52
53 MemoryPressureObserver* GetMemoryPressureObserver() { 53 MemoryPressureObserver* GetMemoryPressureObserver() {
54 static auto observer = new MemoryPressureObserver(); 54 static auto* observer = new MemoryPressureObserver();
55 return observer; 55 return observer;
56 } 56 }
57 57
58 subtle::Atomic32 g_notifications_suppressed = 0; 58 subtle::Atomic32 g_notifications_suppressed = 0;
59 59
60 } // namespace 60 } // namespace
61 61
62 MemoryPressureListener::MemoryPressureListener( 62 MemoryPressureListener::MemoryPressureListener(
63 const MemoryPressureListener::MemoryPressureCallback& callback) 63 const MemoryPressureListener::MemoryPressureCallback& callback)
64 : callback_(callback) { 64 : callback_(callback) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 // static 122 // static
123 void MemoryPressureListener::DoNotifyMemoryPressure( 123 void MemoryPressureListener::DoNotifyMemoryPressure(
124 MemoryPressureLevel memory_pressure_level) { 124 MemoryPressureLevel memory_pressure_level) {
125 DCHECK_NE(memory_pressure_level, MEMORY_PRESSURE_LEVEL_NONE); 125 DCHECK_NE(memory_pressure_level, MEMORY_PRESSURE_LEVEL_NONE);
126 126
127 GetMemoryPressureObserver()->Notify(memory_pressure_level); 127 GetMemoryPressureObserver()->Notify(memory_pressure_level);
128 } 128 }
129 129
130 } // namespace base 130 } // namespace base
OLDNEW
« no previous file with comments | « base/i18n/character_encoding.cc ('k') | base/message_loop/message_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698