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

Unified Diff: components/update_client/update_client.h

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 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
« no previous file with comments | « components/update_client/test_installer.cc ('k') | components/update_client/update_client_errors.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/update_client/update_client.h
diff --git a/components/update_client/update_client.h b/components/update_client/update_client.h
index 138915b15c7a54e8882339b80108471440d7332a..f58e82092fa11ee7a23a2c410c0fb8ceb9c79940 100644
--- a/components/update_client/update_client.h
+++ b/components/update_client/update_client.h
@@ -15,6 +15,7 @@
#include "base/callback_forward.h"
#include "base/memory/ref_counted.h"
#include "base/version.h"
+#include "components/update_client/update_client_errors.h"
// The UpdateClient class is a facade with a simple interface. The interface
// exposes a few APIs to install a CRX or update a group of CRXs.
@@ -149,6 +150,16 @@ using Callback = base::Callback<void(Error error)>;
// Defines an interface for a generic CRX installer.
class CrxInstaller : public base::RefCountedThreadSafe<CrxInstaller> {
public:
+ // Contains the result of the Install operation.
+ struct Result {
+ explicit Result(int error, int extended_error = 0)
+ : error(error), extended_error(extended_error) {}
+ explicit Result(InstallError error, int extended_error = 0)
+ : error(static_cast<int>(error)), extended_error(extended_error) {}
+ int error = 0; // 0 indicates that install has been successful.
+ int extended_error = 0;
+ };
+
// Called on the main thread when there was a problem unpacking or
// verifying the CRX. |error| is a non-zero value which is only meaningful
// to the caller.
@@ -159,8 +170,8 @@ class CrxInstaller : public base::RefCountedThreadSafe<CrxInstaller> {
// as a json dictionary.|unpack_path| contains the temporary directory
// with all the unpacked CRX files.
// This method may be called from a thread other than the main thread.
- virtual bool Install(const base::DictionaryValue& manifest,
- const base::FilePath& unpack_path) = 0;
+ virtual Result Install(const base::DictionaryValue& manifest,
+ const base::FilePath& unpack_path) = 0;
// Sets |installed_file| to the full path to the installed |file|. |file| is
// the filename of the file in this CRX. Returns false if this is
« no previous file with comments | « components/update_client/test_installer.cc ('k') | components/update_client/update_client_errors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698