| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/resource_manager/public/resource_manager.h" | 5 #include "athena/resource_manager/public/resource_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "athena/activity/public/activity.h" | 10 #include "athena/activity/public/activity.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 namespace athena { | 24 namespace athena { |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 class ResourceManagerImpl : public ResourceManager, | 27 class ResourceManagerImpl : public ResourceManager, |
| 28 public WindowManagerObserver, | 28 public WindowManagerObserver, |
| 29 public ActivityManagerObserver, | 29 public ActivityManagerObserver, |
| 30 public MemoryPressureObserver, | 30 public MemoryPressureObserver, |
| 31 public WindowListProviderObserver { | 31 public WindowListProviderObserver { |
| 32 public: | 32 public: |
| 33 ResourceManagerImpl(ResourceManagerDelegate* delegate); | 33 ResourceManagerImpl(ResourceManagerDelegate* delegate); |
| 34 virtual ~ResourceManagerImpl(); | 34 ~ResourceManagerImpl() override; |
| 35 | 35 |
| 36 // ResourceManager: | 36 // ResourceManager: |
| 37 virtual void SetMemoryPressureAndStopMonitoring( | 37 virtual void SetMemoryPressureAndStopMonitoring( |
| 38 MemoryPressure pressure) override; | 38 MemoryPressure pressure) override; |
| 39 virtual void SetWaitTimeBetweenResourceManageCalls(int time_in_ms) override { | 39 virtual void SetWaitTimeBetweenResourceManageCalls(int time_in_ms) override { |
| 40 wait_time_for_resource_deallocation_ = | 40 wait_time_for_resource_deallocation_ = |
| 41 base::TimeDelta::FromMilliseconds(time_in_ms); | 41 base::TimeDelta::FromMilliseconds(time_in_ms); |
| 42 // Reset the timeout to force the next resource call to execute immediately. | 42 // Reset the timeout to force the next resource call to execute immediately. |
| 43 next_resource_management_time_ = base::Time::Now(); | 43 next_resource_management_time_ = base::Time::Now(); |
| 44 } | 44 } |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 } | 480 } |
| 481 | 481 |
| 482 ResourceManager::ResourceManager() {} | 482 ResourceManager::ResourceManager() {} |
| 483 | 483 |
| 484 ResourceManager::~ResourceManager() { | 484 ResourceManager::~ResourceManager() { |
| 485 DCHECK(instance); | 485 DCHECK(instance); |
| 486 instance = nullptr; | 486 instance = nullptr; |
| 487 } | 487 } |
| 488 | 488 |
| 489 } // namespace athena | 489 } // namespace athena |
| OLD | NEW |