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

Unified Diff: chrome/browser/component_updater/component_patcher.h

Issue 25883006: Support asynchronous patching operations in the component updater. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tests
Patch Set: sorin@, cpu@ review Created 7 years, 1 month 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
Index: chrome/browser/component_updater/component_patcher.h
diff --git a/chrome/browser/component_updater/component_patcher.h b/chrome/browser/component_updater/component_patcher.h
index 1990922dac9c3d024d6eb65c14f83609b503355b..fca1e758996a7c3cf927f26ba877838af11a2e3a 100644
--- a/chrome/browser/component_updater/component_patcher.h
+++ b/chrome/browser/component_updater/component_patcher.h
@@ -38,6 +38,8 @@ class FilePath;
class ComponentInstaller;
+namespace component_updater {
+
// Applies a delta patch to a single file. Specifically, creates a file at
// |output_file| using |input_file| patched according to the algorithm
// specified by |patch_type| using |patch_file|. Sets the value of error to
@@ -51,22 +53,24 @@ class ComponentPatcher {
kPatchTypeBsdiff,
};
- virtual ComponentUnpacker::Error Patch(PatchType patch_type,
- const base::FilePath& input_file,
- const base::FilePath& patch_file,
- const base::FilePath& output_file,
- int* error) = 0;
+ virtual ComponentUnpacker::Error Patch(
+ PatchType patch_type,
+ const base::FilePath& input_file,
+ const base::FilePath& patch_file,
+ const base::FilePath& output_file,
+ int* error) = 0;
virtual ~ComponentPatcher() {}
};
class ComponentPatcherCrossPlatform : public ComponentPatcher {
public:
ComponentPatcherCrossPlatform();
- virtual ComponentUnpacker::Error Patch(PatchType patch_type,
- const base::FilePath& input_file,
- const base::FilePath& patch_file,
- const base::FilePath& output_file,
- int* error) OVERRIDE;
+ virtual ComponentUnpacker::Error Patch(
+ PatchType patch_type,
+ const base::FilePath& input_file,
+ const base::FilePath& patch_file,
+ const base::FilePath& output_file,
+ int* error) OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(ComponentPatcherCrossPlatform);
};
@@ -75,12 +79,16 @@ class ComponentPatcherCrossPlatform : public ComponentPatcher {
// component installer, and creates a new (non-differential) unpacked CRX, which
// is then installed normally.
// The non-differential files are written into the |unpack_dir| directory.
-// Sets |error| to the error code of the first failing patch operation.
-ComponentUnpacker::Error DifferentialUpdatePatch(
+// When finished, calls the callback, passing error codes if any errors were
+// encountered.
+void DifferentialUpdatePatch(
const base::FilePath& input_dir,
const base::FilePath& unpack_dir,
ComponentPatcher* component_patcher,
ComponentInstaller* installer,
- int* error);
+ base::Callback<void(ComponentUnpacker::Error, int)>
+ callback);
+
+} // namespace component_updater
#endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_PATCHER_H_

Powered by Google App Engine
This is Rietveld 408576698