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

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

Issue 2047283004: [TabManager] fixing comment at DiscardTabById function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | no next file » | 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 #ifndef CHROME_BROWSER_MEMORY_TAB_MANAGER_H_ 5 #ifndef CHROME_BROWSER_MEMORY_TAB_MANAGER_H_
6 #define CHROME_BROWSER_MEMORY_TAB_MANAGER_H_ 6 #define CHROME_BROWSER_MEMORY_TAB_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // Goes through a list of checks to see if a tab is allowed to be discarded by 94 // Goes through a list of checks to see if a tab is allowed to be discarded by
95 // the automatic tab discarding mechanism. Note that this is not used when 95 // the automatic tab discarding mechanism. Note that this is not used when
96 // discarding a particular tab from about:discards. 96 // discarding a particular tab from about:discards.
97 bool CanDiscardTab(int64_t target_web_contents_id) const; 97 bool CanDiscardTab(int64_t target_web_contents_id) const;
98 98
99 // Discards a tab to free the memory occupied by its renderer. The tab still 99 // Discards a tab to free the memory occupied by its renderer. The tab still
100 // exists in the tab-strip; clicking on it will reload it. 100 // exists in the tab-strip; clicking on it will reload it.
101 void DiscardTab(); 101 void DiscardTab();
102 102
103 // Discards a tab with the given unique ID. The tab still exists in the 103 // Discards a tab with the given unique ID. The tab still exists in the
104 // tab-strip; clicking on it will reload it. Returns true if it successfully 104 // tab-strip; clicking on it will reload it. Returns nullptr if it didn't find
105 // found a tab and discarded it. 105 // the tab or it can't be discared. Otherwise return a web_contents.
Anderson Silva 2016/06/08 15:57:48 In the implementation, the returned web_contens is
Georges Khalil 2016/06/09 13:50:52 Let's go with this: Returns null if the tab cannot
106 content::WebContents* DiscardTabById(int64_t target_web_contents_id); 106 content::WebContents* DiscardTabById(int64_t target_web_contents_id);
107 107
108 // Log memory statistics for the running processes, then discards a tab. 108 // Log memory statistics for the running processes, then discards a tab.
109 // Tab discard happens sometime later, as collecting the statistics touches 109 // Tab discard happens sometime later, as collecting the statistics touches
110 // multiple threads and takes time. 110 // multiple threads and takes time.
111 void LogMemoryAndDiscardTab(); 111 void LogMemoryAndDiscardTab();
112 112
113 // Log memory statistics for the running processes, then call the callback. 113 // Log memory statistics for the running processes, then call the callback.
114 void LogMemory(const std::string& title, const base::Closure& callback); 114 void LogMemory(const std::string& title, const base::Closure& callback);
115 115
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 330
331 // Weak pointer factory used for posting delayed tasks to task_runner_. 331 // Weak pointer factory used for posting delayed tasks to task_runner_.
332 base::WeakPtrFactory<TabManager> weak_ptr_factory_; 332 base::WeakPtrFactory<TabManager> weak_ptr_factory_;
333 333
334 DISALLOW_COPY_AND_ASSIGN(TabManager); 334 DISALLOW_COPY_AND_ASSIGN(TabManager);
335 }; 335 };
336 336
337 } // namespace memory 337 } // namespace memory
338 338
339 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_H_ 339 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698