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

Side by Side Diff: postinstall_runner_action.h

Issue 4690006: AU: Execute postinst asynchronously so that the D-Bus service is not blocked. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: address review comments Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | postinstall_runner_action.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POSTINSTALL_RUNNER_ACTION_H__ 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_POSTINSTALL_RUNNER_ACTION_H__
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_POSTINSTALL_RUNNER_ACTION_H__ 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_POSTINSTALL_RUNNER_ACTION_H__
7 7
8 #include <string> 8 #include <string>
9
9 #include "update_engine/action.h" 10 #include "update_engine/action.h"
10 #include "update_engine/install_plan.h" 11 #include "update_engine/install_plan.h"
11 12
12 // The Postinstall Runner Action is responsible for running the postinstall 13 // The Postinstall Runner Action is responsible for running the postinstall
13 // script of a successfully downloaded update. 14 // script of a successfully downloaded update.
14 15
15 namespace chromeos_update_engine { 16 namespace chromeos_update_engine {
16 17
17 class PostinstallRunnerAction; 18 class PostinstallRunnerAction;
18 class NoneType; 19 class NoneType;
19 20
20 template<> 21 template<>
21 class ActionTraits<PostinstallRunnerAction> { 22 class ActionTraits<PostinstallRunnerAction> {
22 public: 23 public:
23 // Takes the device path as input 24 // Takes the device path as input
24 typedef InstallPlan InputObjectType; 25 typedef InstallPlan InputObjectType;
25 // Passes the device path as output 26 // Passes the device path as output
26 typedef InstallPlan OutputObjectType; 27 typedef InstallPlan OutputObjectType;
27 }; 28 };
28 29
29 class PostinstallRunnerAction : public Action<PostinstallRunnerAction> { 30 class PostinstallRunnerAction : public Action<PostinstallRunnerAction> {
30 public: 31 public:
31 PostinstallRunnerAction() {} 32 PostinstallRunnerAction() {}
32 typedef ActionTraits<PostinstallRunnerAction>::InputObjectType 33 typedef ActionTraits<PostinstallRunnerAction>::InputObjectType
33 InputObjectType; 34 InputObjectType;
34 typedef ActionTraits<PostinstallRunnerAction>::OutputObjectType 35 typedef ActionTraits<PostinstallRunnerAction>::OutputObjectType
35 OutputObjectType; 36 OutputObjectType;
36 void PerformAction(); 37 void PerformAction();
37 38
38 // This is a synchronous action, and thus TerminateProcessing() should 39 // Note that there's no support for terminating this action currently.
39 // never be called
40 void TerminateProcessing() { CHECK(false); } 40 void TerminateProcessing() { CHECK(false); }
41 41
42 // Debugging/logging 42 // Debugging/logging
43 static std::string StaticType() { return "PostinstallRunnerAction"; } 43 static std::string StaticType() { return "PostinstallRunnerAction"; }
44 std::string Type() const { return StaticType(); } 44 std::string Type() const { return StaticType(); }
45 45
46 private: 46 private:
47 // Subprocess::Exec callback.
48 void CompletePostinstall(int return_code);
49 static void StaticCompletePostinstall(int return_code,
50 const std::string& output,
51 void* p);
52
53 std::string temp_rootfs_dir_;
54
47 DISALLOW_COPY_AND_ASSIGN(PostinstallRunnerAction); 55 DISALLOW_COPY_AND_ASSIGN(PostinstallRunnerAction);
48 }; 56 };
49 57
50 } // namespace chromeos_update_engine 58 } // namespace chromeos_update_engine
51 59
52 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_POSTINSTALL_RUNNER_ACTION_H__ 60 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_POSTINSTALL_RUNNER_ACTION_H__
OLDNEW
« no previous file with comments | « no previous file | postinstall_runner_action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698