Chromium Code Reviews| Index: components/policy/core/common/remote_commands/remote_commands_service.h |
| diff --git a/components/policy/core/common/remote_commands/remote_commands_service.h b/components/policy/core/common/remote_commands/remote_commands_service.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..04d50d05c1a09ef62f5d226a962bbc67676ba505 |
| --- /dev/null |
| +++ b/components/policy/core/common/remote_commands/remote_commands_service.h |
| @@ -0,0 +1,59 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_POLICY_CORE_COMMON_REMOTE_COMMANDS_REMOTE_COMMANDS_SERVICE_H_ |
| +#define COMPONENTS_POLICY_CORE_COMMON_REMOTE_COMMANDS_REMOTE_COMMANDS_SERVICE_H_ |
| + |
| +#include <vector> |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "components/policy/core/common/remote_commands/remote_command_job.h" |
| +#include "components/policy/core/common/remote_commands/remote_commands_queue.h" |
| +#include "components/policy/policy_export.h" |
| +#include "policy/proto/device_management_backend.pb.h" |
| + |
| +namespace policy { |
| + |
| +class CloudPolicyClient; |
| + |
| +// XXX |
| +class POLICY_EXPORT RemoteCommandsService |
| + : public RemoteCommandsQueue::Observer { |
| + public: |
| + RemoteCommandsService(scoped_ptr<RemoteCommandJob::Factory> factory, |
| + CloudPolicyClient* client); |
| + ~RemoteCommandsService() override; |
| + |
| + // XXX |
| + void FetchRemoteCommands(); |
| + |
| + private: |
| + // XXX |
| + void AddCommand(const enterprise_management::RemoteCommand& command); |
| + |
| + // RemoteCommandsQueue::Observer: |
| + void OnJobStarted(RemoteCommandJob* command) override; |
| + void OnJobFinished(RemoteCommandJob* command) override; |
| + |
| + // XXX |
| + void OnRemoteCommandsFetched( |
| + const std::vector<enterprise_management::RemoteCommand>& commands); |
| + |
| + bool request_job_in_progress_; |
|
bartfab (slow)
2015/02/12 14:29:20
Nit: Would you mind renaming this? "Request" is su
binjin
2015/02/16 22:46:24
Done.
|
| + std::vector<enterprise_management::RemoteCommandResult> unsent_results_; |
| + |
| + RemoteCommandJob::UniqueIDType last_fetched_command_id_; |
| + RemoteCommandJob::UniqueIDType last_executed_command_id_; |
| + |
| + RemoteCommandsQueue queue_; |
| + scoped_ptr<RemoteCommandJob::Factory> factory_; |
| + CloudPolicyClient* client_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(RemoteCommandsService); |
| +}; |
| + |
| +} // namespace policy |
| + |
| +#endif // COMPONENTS_POLICY_CORE_COMMON_REMOTE_COMMANDS_REMOTE_COMMANDS_SERVICE_H_ |