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

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

Issue 2828663002: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/{i,l,m,n,p,r}* (Closed)
Patch Set: Created 3 years, 8 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 | « chrome/browser/manifest/manifest_icon_downloader.cc ('k') | chrome/browser/memory_details.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/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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 // This loop can only run at most twice. If it doesn't exit the first time 966 // This loop can only run at most twice. If it doesn't exit the first time
967 // through, by the second time through |notified_renderers_| will be empty. 967 // through, by the second time through |notified_renderers_| will be empty.
968 // Since |renderers| is always non-empty, the first renderer encountered 968 // Since |renderers| is always non-empty, the first renderer encountered
969 // during the second pass will be notified. 969 // during the second pass will be notified.
970 } 970 }
971 971
972 // Schedule another notification. Use a weak pointer so this doesn't explode 972 // Schedule another notification. Use a weak pointer so this doesn't explode
973 // during tear down. 973 // during tear down.
974 task_runner_->PostDelayedTask( 974 task_runner_->PostDelayedTask(
975 FROM_HERE, 975 FROM_HERE,
976 base::Bind(&TabManager::DoChildProcessDispatch, 976 base::BindOnce(&TabManager::DoChildProcessDispatch,
977 weak_ptr_factory_.GetWeakPtr()), 977 weak_ptr_factory_.GetWeakPtr()),
978 base::TimeDelta::FromSeconds(kRendererNotificationDelayInSeconds)); 978 base::TimeDelta::FromSeconds(kRendererNotificationDelayInSeconds));
979 } 979 }
980 980
981 // TODO(jamescook): This should consider tabs with references to other tabs, 981 // TODO(jamescook): This should consider tabs with references to other tabs,
982 // such as tabs created with JavaScript window.open(). Potentially consider 982 // such as tabs created with JavaScript window.open(). Potentially consider
983 // discarding the entire set together, or use that in the priority computation. 983 // discarding the entire set together, or use that in the priority computation.
984 content::WebContents* TabManager::DiscardTabImpl() { 984 content::WebContents* TabManager::DiscardTabImpl() {
985 DCHECK_CURRENTLY_ON(BrowserThread::UI); 985 DCHECK_CURRENTLY_ON(BrowserThread::UI);
986 TabStatsList stats = GetTabStats(); 986 TabStatsList stats = GetTabStats();
987 987
(...skipping 23 matching lines...) Expand all
1011 // platform. 1011 // platform.
1012 std::string allow_multiple_discards = variations::GetVariationParamValue( 1012 std::string allow_multiple_discards = variations::GetVariationParamValue(
1013 features::kAutomaticTabDiscarding.name, "AllowMultipleDiscards"); 1013 features::kAutomaticTabDiscarding.name, "AllowMultipleDiscards");
1014 return (allow_multiple_discards != "true"); 1014 return (allow_multiple_discards != "true");
1015 #else 1015 #else
1016 return false; 1016 return false;
1017 #endif 1017 #endif
1018 } 1018 }
1019 1019
1020 } // namespace memory 1020 } // namespace memory
OLDNEW
« no previous file with comments | « chrome/browser/manifest/manifest_icon_downloader.cc ('k') | chrome/browser/memory_details.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698