OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_web_contents_data.h" | 5 #include "chrome/browser/resource_coordinator/tab_manager_web_contents_data.h" |
6 | 6 |
7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
8 #include "base/time/tick_clock.h" | 8 #include "base/time/tick_clock.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/engagement/site_engagement_service.h" | 10 #include "chrome/browser/engagement/site_engagement_service.h" |
11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
14 | 14 |
15 using base::TimeTicks; | 15 using base::TimeTicks; |
16 using content::WebContents; | 16 using content::WebContents; |
17 | 17 |
18 DEFINE_WEB_CONTENTS_USER_DATA_KEY(memory::TabManager::WebContentsData); | 18 DEFINE_WEB_CONTENTS_USER_DATA_KEY( |
| 19 resource_coordinator::TabManager::WebContentsData); |
19 | 20 |
20 namespace memory { | 21 namespace resource_coordinator { |
21 | 22 |
22 TabManager::WebContentsData::WebContentsData(content::WebContents* web_contents) | 23 TabManager::WebContentsData::WebContentsData(content::WebContents* web_contents) |
23 : WebContentsObserver(web_contents), | 24 : WebContentsObserver(web_contents), |
24 test_tick_clock_(nullptr), | 25 test_tick_clock_(nullptr), |
25 time_to_purge_(base::TimeDelta::FromMinutes(30)), | 26 time_to_purge_(base::TimeDelta::FromMinutes(30)), |
26 is_purged_(false) {} | 27 is_purged_(false) {} |
27 | 28 |
28 TabManager::WebContentsData::~WebContentsData() {} | 29 TabManager::WebContentsData::~WebContentsData() {} |
29 | 30 |
30 void TabManager::WebContentsData::DidStartLoading() { | 31 void TabManager::WebContentsData::DidStartLoading() { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 195 |
195 tab_data_.is_auto_discardable = state; | 196 tab_data_.is_auto_discardable = state; |
196 g_browser_process->GetTabManager()->OnAutoDiscardableStateChange( | 197 g_browser_process->GetTabManager()->OnAutoDiscardableStateChange( |
197 web_contents(), state); | 198 web_contents(), state); |
198 } | 199 } |
199 | 200 |
200 bool TabManager::WebContentsData::IsAutoDiscardable() { | 201 bool TabManager::WebContentsData::IsAutoDiscardable() { |
201 return tab_data_.is_auto_discardable; | 202 return tab_data_.is_auto_discardable; |
202 } | 203 } |
203 | 204 |
204 } // namespace memory | 205 } // namespace resource_coordinator |
OLD | NEW |