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

Unified Diff: metadata.h

Issue 5684002: Add support for bsdiff of file system metadata blocks (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: Addressed code review feedbacks 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 | « delta_performer_unittest.cc ('k') | metadata.cc » ('j') | test_utils.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: metadata.h
diff --git a/metadata.h b/metadata.h
new file mode 100644
index 0000000000000000000000000000000000000000..72eb14598023f79b015847225dbaf50c322f4a3a
--- /dev/null
+++ b/metadata.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_METADATA_H__
+#define CHROMEOS_PLATFORM_UPDATE_ENGINE_METADATA_H__
+
+#include "update_engine/delta_diff_generator.h"
+#include "update_engine/graph_types.h"
+
+namespace chromeos_update_engine {
+
+class Metadata {
+ public:
+ // Reads metadata from old image and new image and determines
+ // the smallest way to encode the metadata for the diff.
+ // If there's no change in the metadata, it creates a MOVE
+ // operation. If there is a change, the smallest of REPLACE, REPLACE_BZ,
+ // or BSDIFF wins. It writes the diff to data_fd and updates data_file_size
+ // accordingly. It also adds the required operation to the graph and adds the
+ // metadata extents to blocks.
+ // Returns true on success.
+ static bool DeltaReadMetadata(Graph* graph,
+ std::vector<DeltaDiffGenerator::Block>* blocks,
+ const std::string& old_image,
+ const std::string& new_image,
+ int data_fd,
+ off_t* data_file_size);
+
+ private:
+ // This should never be constructed.
+ DISALLOW_IMPLICIT_CONSTRUCTORS(Metadata);
+};
+
+}; // namespace chromeos_update_engine
+
+#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_METADATA_H__
« no previous file with comments | « delta_performer_unittest.cc ('k') | metadata.cc » ('j') | test_utils.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698