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

Side by Side Diff: chrome/browser/memory/tab_manager.cc

Issue 2095413002: TabManagerDelegate: Better prioritize ARC processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more review comment Created 4 years, 5 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 (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/memory/tab_manager.h" 5 #include "chrome/browser/memory/tab_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 716
717 TabManager::WebContentsData* TabManager::GetWebContentsData( 717 TabManager::WebContentsData* TabManager::GetWebContentsData(
718 content::WebContents* contents) const { 718 content::WebContents* contents) const {
719 WebContentsData::CreateForWebContents(contents); 719 WebContentsData::CreateForWebContents(contents);
720 auto web_contents_data = WebContentsData::FromWebContents(contents); 720 auto web_contents_data = WebContentsData::FromWebContents(contents);
721 web_contents_data->set_test_tick_clock(test_tick_clock_); 721 web_contents_data->set_test_tick_clock(test_tick_clock_);
722 return web_contents_data; 722 return web_contents_data;
723 } 723 }
724 724
725 // static 725 // static
726 bool TabManager::CompareTabStats(TabStats first, TabStats second) { 726 bool TabManager::CompareTabStats(const TabStats& first,
727 const TabStats& second) {
727 // Being currently selected is most important to protect. 728 // Being currently selected is most important to protect.
728 if (first.is_selected != second.is_selected) 729 if (first.is_selected != second.is_selected)
729 return first.is_selected; 730 return first.is_selected;
730 731
731 // Protect tabs with pending form entries. 732 // Protect tabs with pending form entries.
732 if (first.has_form_entry != second.has_form_entry) 733 if (first.has_form_entry != second.has_form_entry)
733 return first.has_form_entry; 734 return first.has_form_entry;
734 735
735 // Protect streaming audio and video conferencing tabs as these are similar to 736 // Protect streaming audio and video conferencing tabs as these are similar to
736 // active tabs. 737 // active tabs.
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 observers_.RemoveObserver(observer); 901 observers_.RemoveObserver(observer);
901 } 902 }
902 903
903 void TabManager::OnDiscardedStateChange(content::WebContents* contents, 904 void TabManager::OnDiscardedStateChange(content::WebContents* contents,
904 bool is_discarded) { 905 bool is_discarded) {
905 FOR_EACH_OBSERVER(TabManagerObserver, observers_, 906 FOR_EACH_OBSERVER(TabManagerObserver, observers_,
906 OnDiscardedStateChange(contents, is_discarded)); 907 OnDiscardedStateChange(contents, is_discarded));
907 } 908 }
908 909
909 } // namespace memory 910 } // namespace memory
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698