Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(863)

Unified Diff: filesystem_copier_action.h

Issue 5516009: AU: Split applied update verification into a separate step. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: review comments Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « download_action.cc ('k') | filesystem_copier_action.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filesystem_copier_action.h
diff --git a/filesystem_copier_action.h b/filesystem_copier_action.h
index 6dbde413f46346ad9572d7f697d121ab8708244c..0658597fc384cd704400d738afff3583409d0b8b 100644
--- a/filesystem_copier_action.h
+++ b/filesystem_copier_action.h
@@ -37,7 +37,8 @@ class ActionTraits<FilesystemCopierAction> {
class FilesystemCopierAction : public Action<FilesystemCopierAction> {
public:
- explicit FilesystemCopierAction(bool copying_kernel_install_path);
+ FilesystemCopierAction(bool copying_kernel_install_path,
+ bool verify_hash);
typedef ActionTraits<FilesystemCopierAction>::InputObjectType
InputObjectType;
@@ -58,7 +59,8 @@ class FilesystemCopierAction : public Action<FilesystemCopierAction> {
FRIEND_TEST(FilesystemCopierActionTest, RunAsRootDetermineFilesystemSizeTest);
// Ping-pong buffers generally cycle through the following states:
- // Empty->Reading->Full->Writing->Empty.
+ // Empty->Reading->Full->Writing->Empty. In hash verification mode the state
+ // is never set to Writing.
enum BufferState {
kBufferStateEmpty,
kBufferStateReading,
@@ -82,23 +84,24 @@ class FilesystemCopierAction : public Action<FilesystemCopierAction> {
void SpawnAsyncActions();
// Cleans up all the variables we use for async operations and tells the
- // ActionProcessor we're done w/ success as passed in. |cancelled_| should be
+ // ActionProcessor we're done w/ |code| as passed in. |cancelled_| should be
// true if TerminateProcessing() was called.
- void Cleanup(bool success);
+ void Cleanup(ActionExitCode code);
// Determine, if possible, the source file system size to avoid copying the
// whole partition. Currently this supports only the root file system assuming
// it's ext3-compatible.
void DetermineFilesystemSize(int fd);
- // Returns the number of bytes to read based on the size of the buffer and the
- // filesystem size.
- int64_t GetBytesToRead();
-
// If true, this action is copying to the kernel_install_path from
// the install plan, otherwise it's copying just to the install_path.
const bool copying_kernel_install_path_;
+ // If true, this action is running in applied update hash verification mode --
+ // it computes a hash for the target install path and compares it against the
+ // expected value.
+ const bool verify_hash_;
+
// The path to copy from. If empty (the default), the source is from the
// passed in InstallPlan.
std::string copy_source_;
« no previous file with comments | « download_action.cc ('k') | filesystem_copier_action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698