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

Side by Side Diff: components/update_client/action.h

Issue 2206583007: Handle the case when the updates are disabled for a component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 months 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
« no previous file with comments | « no previous file | components/update_client/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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium 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 COMPONENTS_UPDATE_CLIENT_ACTION_H_ 5 #ifndef COMPONENTS_UPDATE_CLIENT_ACTION_H_
6 #define COMPONENTS_UPDATE_CLIENT_ACTION_H_ 6 #define COMPONENTS_UPDATE_CLIENT_ACTION_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 22 matching lines...) Expand all
33 enum class ErrorCategory { 33 enum class ErrorCategory {
34 kErrorNone = 0, 34 kErrorNone = 0,
35 kNetworkError, 35 kNetworkError,
36 kUnpackError, 36 kUnpackError,
37 kInstallError, 37 kInstallError,
38 kServiceError, // Runtime errors which occur in the service itself. 38 kServiceError, // Runtime errors which occur in the service itself.
39 }; 39 };
40 40
41 enum class ServiceError { 41 enum class ServiceError {
42 ERROR_WAIT = 1, 42 ERROR_WAIT = 1,
43 ERROR_UPDATE_DISABLED = 2,
43 }; 44 };
44 45
45 using Callback = base::Callback<void(int error)>; 46 using Callback = base::Callback<void(int error)>;
46 virtual ~Action() {} 47 virtual ~Action() {}
47 48
48 // Runs the code encapsulated by the action. When an action completes, it can 49 // Runs the code encapsulated by the action. When an action completes, it can
49 // chain up and transfer the execution flow to another action or it can 50 // chain up and transfer the execution flow to another action or it can
50 // invoke the |callback| when this function has completed and there is nothing 51 // invoke the |callback| when this function has completed and there is nothing
51 // else to do. 52 // else to do.
52 virtual void Run(UpdateContext* update_context, Callback callback) = 0; 53 virtual void Run(UpdateContext* update_context, Callback callback) = 0;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 UpdateContext* update_context_; // Not owned by this class. 92 UpdateContext* update_context_; // Not owned by this class.
92 Action::Callback callback_; 93 Action::Callback callback_;
93 94
94 private: 95 private:
95 DISALLOW_COPY_AND_ASSIGN(ActionImpl); 96 DISALLOW_COPY_AND_ASSIGN(ActionImpl);
96 }; 97 };
97 98
98 } // namespace update_client 99 } // namespace update_client
99 100
100 #endif // COMPONENTS_UPDATE_CLIENT_ACTION_H_ 101 #endif // COMPONENTS_UPDATE_CLIENT_ACTION_H_
OLDNEW
« no previous file with comments | « no previous file | components/update_client/action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698