AU: Beginnings of delta support
- proto file for delta files; still needs hardlink support
- code to generate a delta update from two directory trees (old, new).
- code to parse delta update
- Actions: postinst-runner, install, bootable flag setter, filesystem
copier, Omaha response handler, Omaha request preparer,
- misc utility functions, like StringHasSuffix(), templatized Action
classes to feed/collect an object from another action.
- FilesystemIterator: iterates a directory tree with optional
exclusion path. Tolerates deleting of files during iteration.
- Subprocess class: support for synchronously or asynchronously
running an external command. Doesn't pass any env variables.
- Integration test that strings many Actions together and tests using
actual Omaha/Lorry. Currently only tests full updates.
- New simple HTTP server for unittest that supports fake flaky
connections.
- Some refactoring.
Review URL: http://codereview.chromium.org/466036
git-svn-id: svn://chrome-svn/chromeos/trunk@334 06c00378-0e64-4dae-be16-12b19f9950a1
diff --git a/update_check_action.cc b/update_check_action.cc
index a4942a6..a9d303c 100644
--- a/update_check_action.cc
+++ b/update_check_action.cc
@@ -9,14 +9,16 @@
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
+#include "chromeos/obsolete_logging.h"
#include "update_engine/action_pipe.h"
+#include "update_engine/utils.h"
using std::string;
namespace chromeos_update_engine {
const char* const UpdateCheckParams::kAppId(
- "87efface-864d-49a5-9bb3-4b050a7c227a");
+ "{87efface-864d-49a5-9bb3-4b050a7c227a}");
const char* const UpdateCheckParams::kOsPlatform("Chrome OS");
const char* const UpdateCheckParams::kOsVersion("Indy");
@@ -91,13 +93,14 @@
return string(reinterpret_cast<const char *>(str.get()));
}
-UpdateCheckAction::UpdateCheckAction(const UpdateCheckParams& params,
- HttpFetcher* http_fetcher)
- : params_(params), http_fetcher_(http_fetcher) {}
+UpdateCheckAction::UpdateCheckAction(HttpFetcher* http_fetcher)
+ : http_fetcher_(http_fetcher) {}
UpdateCheckAction::~UpdateCheckAction() {}
void UpdateCheckAction::PerformAction() {
+ CHECK(HasInputObject());
+ params_ = GetInputObject();
http_fetcher_->set_delegate(this);
string request_post(FormatRequest(params_));
http_fetcher_->SetPostData(request_post.data(), request_post.size());
@@ -118,26 +121,6 @@
}
namespace {
-// A little object to call ActionComplete on the ActionProcessor when
-// it's destructed.
-class ScopedActionCompleter {
- public:
- explicit ScopedActionCompleter(ActionProcessor* processor,
- AbstractAction* action)
- : processor_(processor), action_(action), success_(false) {}
- ~ScopedActionCompleter() {
- processor_->ActionComplete(action_, success_);
- }
- void set_success(bool success) {
- success_ = success;
- }
- private:
- ActionProcessor* processor_;
- AbstractAction* action_;
- bool success_;
- DISALLOW_COPY_AND_ASSIGN(ScopedActionCompleter);
-};
-
// If non-NULL response, caller is responsible for calling xmlXPathFreeObject()
// on the returned object.
// This code is roughly based on the libxml tutorial at: