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

Unified Diff: src/platform/update_engine/delta_diff_generator.h

Issue 492008: AU: Try delta updates first, then full updates (Closed)
Patch Set: use mkstemp Created 11 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 | « src/platform/update_engine/action_unittest.cc ('k') | src/platform/update_engine/delta_diff_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/update_engine/delta_diff_generator.h
diff --git a/src/platform/update_engine/delta_diff_generator.h b/src/platform/update_engine/delta_diff_generator.h
index 2c355a42c5f941fb0822729fbbf7a15f15852113..5d422c34f424523d0e712624f2c86963303ef22a 100644
--- a/src/platform/update_engine/delta_diff_generator.h
+++ b/src/platform/update_engine/delta_diff_generator.h
@@ -7,6 +7,7 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include <set>
#include <string>
#include <vector>
#include "base/basictypes.h"
@@ -32,14 +33,19 @@ class DeltaDiffGenerator {
// Takes a DeltaArchiveManifest as given from EncodeMetadataToProtoBuffer(),
// fill in the missing fields (DeltaArchiveManifest_File_data_*), and
// write the full delta out to the output file.
+ // Any paths in nondiff_paths will be included in full, rather than
+ // as a diff. This is useful for files that change during postinstall, since
+ // future updates can't depend on them having remaining unchanged.
// Returns true on success.
// If non-empty, the device at force_compress_dev_path will be compressed.
- static bool EncodeDataToDeltaFile(DeltaArchiveManifest* archive,
- const std::string& old_path,
- const std::string& new_path,
- const std::string& out_file,
- const std::string& force_compress_dev_path);
-
+ static bool EncodeDataToDeltaFile(
+ DeltaArchiveManifest* archive,
+ const std::string& old_path,
+ const std::string& new_path,
+ const std::string& out_file,
+ const std::set<std::string>& nondiff_paths,
+ const std::string& force_compress_dev_path);
+
private:
// These functions encode all the data about a file that's not already
// stored in the DeltaArchiveManifest message into the vector 'out'.
@@ -58,9 +64,15 @@ class DeltaDiffGenerator {
static bool EncodeFile(const std::string& old_dir,
const std::string& new_dir,
const std::string& file_name,
+ const bool avoid_diff,
DeltaArchiveManifest_File_DataFormat* out_data_format,
- std::vector<char>* out);
+ std::vector<char>* out,
+ bool* no_change);
+ // nondiff_paths is passed in to EncodeDataToDeltaFile() with
+ // paths relative to the installed system (e.g. /etc/fstab), but
+ // WriteFileDiffsToDeltaFile requires always_full_target_paths to be
+ // the entire path of the new file.
// If non-empty, the device at force_compress_dev_path will be compressed.
static bool WriteFileDiffsToDeltaFile(
DeltaArchiveManifest* archive,
@@ -70,6 +82,7 @@ class DeltaDiffGenerator {
const std::string& new_path,
FileWriter* out_file_writer,
int* out_file_length,
+ std::set<std::string> always_full_target_paths,
const std::string& force_compress_dev_path);
// This should never be constructed
« no previous file with comments | « src/platform/update_engine/action_unittest.cc ('k') | src/platform/update_engine/delta_diff_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698