| OLD | NEW |
| 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 "components/sessions/core/tab_restore_service.h" | 5 #include "components/sessions/core/tab_restore_service.h" |
| 6 | 6 |
| 7 #include "base/trace_event/estimate_memory_usage.h" |
| 8 |
| 7 namespace sessions { | 9 namespace sessions { |
| 8 | 10 |
| 9 // TimeFactory----------------------------------------------------------------- | 11 // TimeFactory----------------------------------------------------------------- |
| 10 | 12 |
| 11 TabRestoreService::TimeFactory::~TimeFactory() {} | 13 TabRestoreService::TimeFactory::~TimeFactory() {} |
| 12 | 14 |
| 13 // Entry ---------------------------------------------------------------------- | 15 // Entry ---------------------------------------------------------------------- |
| 14 | 16 |
| 15 // ID of the next Entry. | 17 // ID of the next Entry. |
| 16 static SessionID::id_type next_entry_id = 1; | 18 static SessionID::id_type next_entry_id = 1; |
| 17 | 19 |
| 18 TabRestoreService::Entry::~Entry() = default; | 20 TabRestoreService::Entry::~Entry() = default; |
| 19 TabRestoreService::Entry::Entry(Type type) : id(next_entry_id++), type(type) {} | 21 TabRestoreService::Entry::Entry(Type type) : id(next_entry_id++), type(type) {} |
| 20 | 22 |
| 23 size_t TabRestoreService::Entry::EstimateMemoryUsage() const { |
| 24 return 0; |
| 25 } |
| 26 |
| 21 TabRestoreService::Tab::Tab() : Entry(TAB) {} | 27 TabRestoreService::Tab::Tab() : Entry(TAB) {} |
| 22 TabRestoreService::Tab::~Tab() = default; | 28 TabRestoreService::Tab::~Tab() = default; |
| 23 | 29 |
| 30 size_t TabRestoreService::Tab::EstimateMemoryUsage() const { |
| 31 using base::trace_event::EstimateMemoryUsage; |
| 32 return |
| 33 EstimateMemoryUsage(navigations) + |
| 34 EstimateMemoryUsage(extension_app_id) + |
| 35 EstimateMemoryUsage(user_agent_override); |
| 36 } |
| 37 |
| 24 TabRestoreService::Window::Window() : Entry(WINDOW) {} | 38 TabRestoreService::Window::Window() : Entry(WINDOW) {} |
| 25 TabRestoreService::Window::~Window() = default; | 39 TabRestoreService::Window::~Window() = default; |
| 26 | 40 |
| 27 // TabRestoreService ---------------------------------------------------------- | 41 // TabRestoreService ---------------------------------------------------------- |
| 28 | 42 |
| 29 TabRestoreService::~TabRestoreService() { | 43 TabRestoreService::~TabRestoreService() { |
| 30 } | 44 } |
| 31 | 45 |
| 32 // PlatformSpecificTabData | 46 // PlatformSpecificTabData |
| 33 // ------------------------------------------------------ | 47 // ------------------------------------------------------ |
| 34 | 48 |
| 35 PlatformSpecificTabData::~PlatformSpecificTabData() {} | 49 PlatformSpecificTabData::~PlatformSpecificTabData() {} |
| 36 | 50 |
| 37 } // namespace sessions | 51 } // namespace sessions |
| OLD | NEW |