summaryrefslogtreecommitdiff
path: root/common/action.h
diff options
context:
space:
mode:
authorAlex Deymo <deymo@google.com>2016-02-24 22:03:57 -0800
committerAlex Deymo <deymo@google.com>2016-02-29 11:38:17 -0800
commit14fd1ec41d1da4e849b724b762ca111a30c6628c (patch)
tree244700c5b65792c738b80de2af24c0699a22c375 /common/action.h
parentf25eb491ff60f21659a7e2b230ee1c83957034c7 (diff)
Allow to Suspend/Resume the ActionProcessor.
This patch implements the core functionality of suspend/resume actions from the ActionProcessor. No actions support suspend/resume yet. Bug: 27047026 TEST=Added unittets, tested on edison-eng. Change-Id: Ib9600098dbccf05fc30f10f0add4a5bc87892b66
Diffstat (limited to 'common/action.h')
-rw-r--r--common/action.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/action.h b/common/action.h
index d8049ac0..6c88216e 100644
--- a/common/action.h
+++ b/common/action.h
@@ -124,6 +124,15 @@ class AbstractAction {
// Only the ActionProcessor should call this.
virtual void TerminateProcessing() {}
+ // Called on asynchronous actions if the processing is suspended and resumed,
+ // respectively. These methods are called by the ActionProcessor and should
+ // not be explicitly called.
+ // The action may still call ActionCompleted() once the action is completed
+ // while the processing is suspended, for example if suspend/resume is not
+ // implemented for the given action.
+ virtual void SuspendAction() {}
+ virtual void ResumeAction() {}
+
// These methods are useful for debugging. TODO(adlr): consider using
// std::type_info for this?
// Type() returns a string of the Action type. I.e., for DownloadAction,