Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FilesTiering] Add skeleton class for DriveFsPinManager
This adds skeleton code for the DriveFsPinManager which will manage and maintain the "bulk pinning" functionality. This also adds a new pref that maintains the enablement of this feature, toggling it currently does nothing, but later will serve as the mechanism to start and stop the bulk pinning action. Bug: b:259454320 Change-Id: I790775a01218493a3184cc0f3066540b4649631d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4036471 Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org> Auto-Submit: Ben Reich <benreich@chromium.org> Reviewed-by: Bo Majewski <majewski@chromium.org> Reviewed-by: James Cook <jamescook@chromium.org> Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/main@{#1075127}
- Loading branch information
Showing
9 changed files
with
100 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright 2022 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chromeos/ash/components/drivefs/drivefs_pin_manager.h" | ||
|
||
namespace drivefs::pinning { | ||
|
||
DriveFsPinManager::DriveFsPinManager(bool enabled) : enabled_(enabled) {} | ||
|
||
} // namespace drivefs::pinning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2022 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef CHROMEOS_ASH_COMPONENTS_DRIVEFS_DRIVEFS_PIN_MANAGER_H_ | ||
#define CHROMEOS_ASH_COMPONENTS_DRIVEFS_DRIVEFS_PIN_MANAGER_H_ | ||
|
||
#include "base/component_export.h" | ||
|
||
namespace drivefs::pinning { | ||
|
||
// Manages bulk pinning of items via DriveFS. This class handles the following: | ||
// - Manage batching of pin actions to avoid sending too many events at once. | ||
// - Ensure disk space is not being exceeded whilst pinning files. | ||
// - Maintain pinning of files that are newly created. | ||
// - Rebuild the progress of bulk pinned items (if turned off mid way through a | ||
// bulk pinning event). | ||
class COMPONENT_EXPORT(CHROMEOS_ASH_COMPONENTS_DRIVEFS) DriveFsPinManager { | ||
public: | ||
explicit DriveFsPinManager(bool enabled); | ||
|
||
DriveFsPinManager(const DriveFsPinManager&) = delete; | ||
DriveFsPinManager& operator=(const DriveFsPinManager&) = delete; | ||
|
||
~DriveFsPinManager() = default; | ||
|
||
// Enable or disable the bulk pinning. | ||
void SetBulkPinningEnabled(bool enabled) { enabled_ = enabled; } | ||
|
||
private: | ||
bool enabled_ = false; | ||
}; | ||
|
||
} // namespace drivefs::pinning | ||
|
||
#endif // CHROMEOS_ASH_COMPONENTS_DRIVEFS_DRIVEFS_PIN_MANAGER_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters