 Chromium Code Reviews
 Chromium Code Reviews Issue 879233003:
  Initial RemoteCommandService  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@remote-commands
    
  
    Issue 879233003:
  Initial RemoteCommandService  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@remote-commands| Index: components/policy/core/common/cloud/cloud_policy_client.h | 
| diff --git a/components/policy/core/common/cloud/cloud_policy_client.h b/components/policy/core/common/cloud/cloud_policy_client.h | 
| index 4fefa864743c5f32ba3a94d1219c20c9f4d4bb97..6feb4675f171259b179bc9f29d1d9f70383cc8d0 100644 | 
| --- a/components/policy/core/common/cloud/cloud_policy_client.h | 
| +++ b/components/policy/core/common/cloud/cloud_policy_client.h | 
| @@ -18,6 +18,7 @@ | 
| #include "base/observer_list.h" | 
| #include "base/time/time.h" | 
| #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 
| +#include "components/policy/core/common/remote_commands/remote_command_job.h" | 
| #include "components/policy/policy_export.h" | 
| #include "policy/proto/device_management_backend.pb.h" | 
| @@ -42,12 +43,17 @@ class POLICY_EXPORT CloudPolicyClient { | 
| public: | 
| // Maps a (policy type, settings entity ID) pair to its corresponding | 
| // PolicyFetchResponse. | 
| - typedef std::map<std::pair<std::string, std::string>, | 
| - enterprise_management::PolicyFetchResponse*> ResponseMap; | 
| + using ResponseMap = std::map<std::pair<std::string, std::string>, | 
| + enterprise_management::PolicyFetchResponse*>; | 
| // A callback which receives boolean status of an operation. If the operation | 
| // succeeded, |status| is true. | 
| - typedef base::Callback<void(bool status)> StatusCallback; | 
| + using StatusCallback = base::Callback<void(bool status)>; | 
| + | 
| + // A callback which receives fetched remote commands. | 
| + using RemoteCommandCallback = base::Callback<void( | 
| + DeviceManagementStatus, | 
| + const std::vector<enterprise_management::RemoteCommand>&)>; | 
| // Observer interface for state and policy changes. | 
| class POLICY_EXPORT Observer { | 
| @@ -138,6 +144,18 @@ class POLICY_EXPORT CloudPolicyClient { | 
| const enterprise_management::SessionStatusReportRequest* session_status, | 
| const StatusCallback& callback); | 
| + // Attempts to fetch remote commands, with |last_command_id| being the last | 
| 
bartfab (slow)
2015/03/17 14:01:21
Nit: s/last ID of the command/ID of the last comma
 
binjin
2015/03/18 10:09:38
Done.
 | 
| + // ID of the command started execution and |command_results| being results for | 
| 
bartfab (slow)
2015/03/17 14:01:21
Nit: s/started/finished/
 
binjin
2015/03/18 10:09:38
Done.
 | 
| + // previous commands which have not been reported yet. The |callback| will be | 
| + // called when the operation completes. | 
| + // Note that sending |last_command_id| will acknowledge this command. A | 
| 
bartfab (slow)
2015/03/17 14:01:22
Nit: "and any previous commands"
 
binjin
2015/03/18 10:09:38
Done.
 | 
| + // nullptr indicates that no commands have been recorded yet. | 
| 
bartfab (slow)
2015/03/17 14:01:21
Nit: As before, what does "recorded" mean?
 
binjin
2015/03/18 10:09:38
Done.
 | 
| + virtual void FetchRemoteCommands( | 
| + scoped_ptr<RemoteCommandJob::UniqueIDType> last_command_id, | 
| + const std::vector<enterprise_management::RemoteCommandResult>& | 
| + command_results, | 
| + const RemoteCommandCallback& callback); | 
| + | 
| // Adds an observer to be called back upon policy and state changes. | 
| void AddObserver(Observer* observer); | 
| @@ -267,6 +285,14 @@ class POLICY_EXPORT CloudPolicyClient { | 
| int net_error, | 
| const enterprise_management::DeviceManagementResponse& response); | 
| + // Callback for remote command fetch requests. | 
| + void OnRemoteCommandsFetched( | 
| + const DeviceManagementRequestJob* job, | 
| + const RemoteCommandCallback& callback, | 
| + DeviceManagementStatus status, | 
| + int net_error, | 
| + const enterprise_management::DeviceManagementResponse& response); | 
| + | 
| // Helper to remove a job from request_jobs_. | 
| void RemoveJob(const DeviceManagementRequestJob* job); |