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

Side by Side Diff: chromeos_update_engine.h

Issue 6648007: Libcros changes for issue_12743: Add async RequestUpdateCheck call. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/cros.git@master
Patch Set: Used scoped_ptr in callback data. Created 9 years, 9 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 | Annotate | Revision Log
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_UPDATE_ENGINE_H_ 5 #ifndef CHROMEOS_UPDATE_ENGINE_H_
6 #define CHROMEOS_UPDATE_ENGINE_H_ 6 #define CHROMEOS_UPDATE_ENGINE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // Register an UpdateMonitor callback. 57 // Register an UpdateMonitor callback.
58 extern UpdateStatusConnection (*MonitorUpdateStatus)(UpdateMonitor monitor, 58 extern UpdateStatusConnection (*MonitorUpdateStatus)(UpdateMonitor monitor,
59 void*); 59 void*);
60 // Unregister an UpdateMonitor callback. 60 // Unregister an UpdateMonitor callback.
61 extern void (*DisconnectUpdateProgress)(UpdateStatusConnection connection); 61 extern void (*DisconnectUpdateProgress)(UpdateStatusConnection connection);
62 62
63 // Poll for the status once. Returns true on success. 63 // Poll for the status once. Returns true on success.
64 extern bool (*RetrieveUpdateProgress)(UpdateProgress* information); 64 extern bool (*RetrieveUpdateProgress)(UpdateProgress* information);
65 // Tell UpdateEngine daemon to check for an update. Returns true on success. 65 // Tell UpdateEngine daemon to check for an update. Returns true on success.
66 extern bool (*InitiateUpdateCheck)(); 66 extern bool (*InitiateUpdateCheck)();
67 // Asynchronously tell UpdateEngine daemon to check for an update.
68 // If |callback| is non NULL, call with the result when the request completes.
69 enum UpdateResult {
70 UPDATE_RESULT_SUCCESS,
71 UPDATE_RESULT_FAILED,
72 UPDATE_RESULT_DBUS_FAILED
73 };
74 typedef void (*UpdateCallback)(void* user_data,
75 UpdateResult result,
76 const char* error_msg);
77 extern void (*RequestUpdateCheck)(UpdateCallback callback, void* user_data);
67 // Tell UpdateEngine daemon to reboot the system if an update has been 78 // Tell UpdateEngine daemon to reboot the system if an update has been
68 // downloaded and installed. Returns true on success. 79 // downloaded and installed. Returns true on success.
69 extern bool (*RebootIfUpdated)(); 80 extern bool (*RebootIfUpdated)();
70 // Set the release track (channel). |track| should look like 81 // Set the release track (channel). |track| should look like
71 // "beta-channel" and "dev-channel". Returns true on success. 82 // "beta-channel" and "dev-channel". Returns true on success.
72 extern bool (*SetTrack)(const std::string& track); 83 extern bool (*SetTrack)(const std::string& track);
73 // Return the release track (channel). On error, return an empty string. 84 // Return the release track (channel). On error, return an empty string.
74 extern std::string (*GetTrack)(); 85 extern std::string (*GetTrack)();
75 86
76 } // namespace chromeos 87 } // namespace chromeos
77 88
78 #endif // CHROMEOS_UPDATE_ENGINE_H_ 89 #endif // CHROMEOS_UPDATE_ENGINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698