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

Side by Side Diff: chrome/browser/chromeos/memory/oom_priority_manager.cc

Issue 823533004: Move memory histograms generation to MetricsMemoryDetails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better class comment. Created 5 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
« no previous file with comments | « no previous file | chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.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 "chrome/browser/chromeos/memory/oom_priority_manager.h" 5 #include "chrome/browser/chromeos/memory/oom_priority_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 if (DiscardTabById(least_important_tab_id)) 285 if (DiscardTabById(least_important_tab_id))
286 return true; 286 return true;
287 } 287 }
288 return false; 288 return false;
289 } 289 }
290 290
291 void OomPriorityManager::LogMemoryAndDiscardTab() { 291 void OomPriorityManager::LogMemoryAndDiscardTab() {
292 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 292 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
293 // Deletes itself upon completion. 293 // Deletes itself upon completion.
294 OomMemoryDetails* details = new OomMemoryDetails(); 294 OomMemoryDetails* details = new OomMemoryDetails();
295 details->StartFetch(MemoryDetails::SKIP_USER_METRICS); 295 details->StartFetch();
296 } 296 }
297 297
298 /////////////////////////////////////////////////////////////////////////////// 298 ///////////////////////////////////////////////////////////////////////////////
299 // OomPriorityManager, private: 299 // OomPriorityManager, private:
300 300
301 // static 301 // static
302 bool OomPriorityManager::IsReloadableUI(const GURL& url) { 302 bool OomPriorityManager::IsReloadableUI(const GURL& url) {
303 // There are many chrome:// UI URLs, but only look for the ones that users 303 // There are many chrome:// UI URLs, but only look for the ones that users
304 // are likely to have open. Most of the benefit is the from NTP URL. 304 // are likely to have open. Most of the benefit is the from NTP URL.
305 const char* const kReloadableUrlPrefixes[] = { 305 const char* const kReloadableUrlPrefixes[] = {
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 // For the moment we only do something when we reach a critical state. 709 // For the moment we only do something when we reach a critical state.
710 if (memory_pressure_level == 710 if (memory_pressure_level ==
711 base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL) { 711 base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL) {
712 LogMemoryAndDiscardTab(); 712 LogMemoryAndDiscardTab();
713 } 713 }
714 // TODO(skuhne): If more memory pressure levels are introduced, we might 714 // TODO(skuhne): If more memory pressure levels are introduced, we might
715 // consider to call PurgeBrowserMemory() before CRITICAL is reached. 715 // consider to call PurgeBrowserMemory() before CRITICAL is reached.
716 } 716 }
717 717
718 } // namespace chromeos 718 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698