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

Side by Side Diff: net/ssl/ssl_client_session_cache.cc

Issue 2648323005: memory coordinator: Add MemoryCoordinatorClient::OnPurgeMemory() (Closed)
Patch Set: Created 3 years, 11 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 #include "net/ssl/ssl_client_session_cache.h" 5 #include "net/ssl/ssl_client_session_cache.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/memory_coordinator_client_registry.h" 9 #include "base/memory/memory_coordinator_client_registry.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 break; 170 break;
171 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE: 171 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE:
172 FlushExpiredSessions(); 172 FlushExpiredSessions();
173 break; 173 break;
174 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL: 174 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL:
175 Flush(); 175 Flush();
176 break; 176 break;
177 } 177 }
178 } 178 }
179 179
180 void SSLClientSessionCache::OnMemoryStateChange(base::MemoryState state) { 180 void SSLClientSessionCache::OnPurgeMemory() {
181 // TODO(hajimehoshi): When the state changes, adjust the sizes of the caches 181 Flush();
182 // to reduce the limits. SSLClientSessionCache doesn't have the ability to
183 // limit at present.
184 switch (state) {
185 case base::MemoryState::NORMAL:
186 break;
187 case base::MemoryState::THROTTLED:
188 Flush();
189 break;
190 case base::MemoryState::SUSPENDED:
191 // Note: Not supported at present. Fall through.
192 case base::MemoryState::UNKNOWN:
193 NOTREACHED();
194 break;
195 }
196 } 182 }
197 183
198 } // namespace net 184 } // namespace net
OLDNEW
« base/memory/memory_coordinator_client.h ('K') | « net/ssl/ssl_client_session_cache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698