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 #ifndef CHROME_BROWSER_MEMORY_TAB_STATS_H_ | 5 #ifndef CHROME_BROWSER_MEMORY_TAB_STATS_H_ |
6 #define CHROME_BROWSER_MEMORY_TAB_STATS_H_ | 6 #define CHROME_BROWSER_MEMORY_TAB_STATS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/process/process.h" | 12 #include "base/process/process.h" |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 class RenderProcessHost; | 18 class RenderProcessHost; |
19 } // namespace content | 19 } // namespace content |
20 | 20 |
21 namespace memory { | 21 namespace memory { |
22 | 22 |
23 struct TabStats { | 23 struct TabStats { |
24 TabStats(); | 24 TabStats(); |
25 TabStats(const TabStats& other); | 25 TabStats(const TabStats& other); |
| 26 TabStats(TabStats&& other) noexcept; |
26 ~TabStats(); | 27 ~TabStats(); |
27 bool is_app; // Browser window is an app. | 28 |
28 bool is_internal_page; // Internal page, such as NTP or Settings. | 29 TabStats& operator=(const TabStats& other); |
29 bool is_media; // Playing audio, acessing cam/mic or mirroring display. | 30 |
30 bool is_pinned; | 31 bool is_app = false; // Browser window is an app. |
31 bool is_selected; // Selected in the currently active browser window. | 32 bool is_internal_page = false; // Internal page, such as NTP or Settings. |
32 bool is_discarded; | 33 // Playing audio, accessing cam/mic or mirroring display. |
33 bool has_form_entry; // User has entered text in a form. | 34 bool is_media = false; |
34 int discard_count; | 35 bool is_pinned = false; |
| 36 bool is_selected = false; // Selected in the currently active browser window. |
| 37 bool is_discarded = false; |
| 38 bool has_form_entry = false; // User has entered text in a form. |
| 39 int discard_count = 0; |
35 base::TimeTicks last_active; | 40 base::TimeTicks last_active; |
36 base::TimeTicks last_hidden; | 41 base::TimeTicks last_hidden; |
37 content::RenderProcessHost* render_process_host; | 42 content::RenderProcessHost* render_process_host = nullptr; |
38 base::ProcessHandle renderer_handle; | 43 base::ProcessHandle renderer_handle = 0; |
39 int child_process_host_id; | 44 int child_process_host_id = 0; |
40 base::string16 title; | 45 base::string16 title; |
41 #if defined(OS_CHROMEOS) | 46 #if defined(OS_CHROMEOS) |
42 int oom_score; | 47 int oom_score = 0; |
43 #endif | 48 #endif |
44 int64_t tab_contents_id; // Unique ID per WebContents. | 49 int64_t tab_contents_id = 0; // Unique ID per WebContents. |
45 bool is_auto_discardable; | 50 bool is_auto_discardable = true; |
46 }; | 51 }; |
47 | 52 |
48 typedef std::vector<TabStats> TabStatsList; | 53 typedef std::vector<TabStats> TabStatsList; |
49 | 54 |
50 } // namespace memory | 55 } // namespace memory |
51 | 56 |
52 #endif // CHROME_BROWSER_MEMORY_TAB_STATS_H_ | 57 #endif // CHROME_BROWSER_MEMORY_TAB_STATS_H_ |
OLD | NEW |