| Index: chrome/browser/memory/tab_manager.cc
|
| diff --git a/chrome/browser/memory/tab_manager.cc b/chrome/browser/memory/tab_manager.cc
|
| index 1112bbd8f4aef1cdbbff4e0bf67e49da0c6063b3..aa2bee07a7e1dac4d8a3049c51eb6a495a5346a3 100644
|
| --- a/chrome/browser/memory/tab_manager.cc
|
| +++ b/chrome/browser/memory/tab_manager.cc
|
| @@ -4,6 +4,8 @@
|
|
|
| #include "chrome/browser/memory/tab_manager.h"
|
|
|
| +#include <stddef.h>
|
| +
|
| #include <algorithm>
|
| #include <set>
|
| #include <vector>
|
| @@ -14,6 +16,7 @@
|
| #include "base/bind.h"
|
| #include "base/bind_helpers.h"
|
| #include "base/command_line.h"
|
| +#include "base/macros.h"
|
| #include "base/memory/memory_pressure_monitor.h"
|
| #include "base/metrics/field_trial.h"
|
| #include "base/metrics/histogram.h"
|
| @@ -75,18 +78,19 @@ const int kAudioProtectionTimeSeconds = 60;
|
|
|
| // Returns a unique ID for a WebContents. Do not cast back to a pointer, as
|
| // the WebContents could be deleted if the user closed the tab.
|
| -int64 IdFromWebContents(WebContents* web_contents) {
|
| - return reinterpret_cast<int64>(web_contents);
|
| +int64_t IdFromWebContents(WebContents* web_contents) {
|
| + return reinterpret_cast<int64_t>(web_contents);
|
| }
|
|
|
| -int FindTabStripModelById(int64 target_web_contents_id, TabStripModel** model) {
|
| +int FindTabStripModelById(int64_t target_web_contents_id,
|
| + TabStripModel** model) {
|
| DCHECK(model);
|
| for (chrome::BrowserIterator it; !it.done(); it.Next()) {
|
| Browser* browser = *it;
|
| TabStripModel* local_model = browser->tab_strip_model();
|
| for (int idx = 0; idx < local_model->count(); idx++) {
|
| WebContents* web_contents = local_model->GetWebContentsAt(idx);
|
| - int64 web_contents_id = IdFromWebContents(web_contents);
|
| + int64_t web_contents_id = IdFromWebContents(web_contents);
|
| if (web_contents_id == target_web_contents_id) {
|
| *model = local_model;
|
| return idx;
|
| @@ -195,7 +199,7 @@ bool TabManager::DiscardTab() {
|
| // Loop until a non-discarded tab to kill is found.
|
| for (TabStatsList::const_reverse_iterator stats_rit = stats.rbegin();
|
| stats_rit != stats.rend(); ++stats_rit) {
|
| - int64 least_important_tab_id = stats_rit->tab_contents_id;
|
| + int64_t least_important_tab_id = stats_rit->tab_contents_id;
|
| if (CanDiscardTab(least_important_tab_id) &&
|
| DiscardTabById(least_important_tab_id))
|
| return true;
|
| @@ -203,7 +207,7 @@ bool TabManager::DiscardTab() {
|
| return false;
|
| }
|
|
|
| -WebContents* TabManager::DiscardTabById(int64 target_web_contents_id) {
|
| +WebContents* TabManager::DiscardTabById(int64_t target_web_contents_id) {
|
| TabStripModel* model;
|
| int index = FindTabStripModelById(target_web_contents_id, &model);
|
|
|
| @@ -435,7 +439,7 @@ void TabManager::UpdateTimerCallback() {
|
| #endif
|
| }
|
|
|
| -bool TabManager::CanDiscardTab(int64 target_web_contents_id) const {
|
| +bool TabManager::CanDiscardTab(int64_t target_web_contents_id) const {
|
| TabStripModel* model;
|
| int idx = FindTabStripModelById(target_web_contents_id, &model);
|
|
|
|
|