| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_SERVICE_H_ |
| 6 #define CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_SERVICE_H_ | 6 #define CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_SERVICE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 // Configures the fetcher, setting up payload and headers. | 45 // Configures the fetcher, setting up payload and headers. |
| 46 virtual void ConfigureRequest(URLFetcher* fetcher) = 0; | 46 virtual void ConfigureRequest(URLFetcher* fetcher) = 0; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 explicit DeviceManagementService(const std::string& server_url); | 49 explicit DeviceManagementService(const std::string& server_url); |
| 50 virtual ~DeviceManagementService(); | 50 virtual ~DeviceManagementService(); |
| 51 | 51 |
| 52 // Constructs a device management backend for use by client code. Ownership of | 52 // Constructs a device management backend for use by client code. Ownership of |
| 53 // the returned backend object is transferred to the caller. | 53 // the returned backend object is transferred to the caller. |
| 54 DeviceManagementBackend* CreateBackend(); | 54 // Marked virtual for the benefit of tests. |
| 55 virtual DeviceManagementBackend* CreateBackend(); |
| 55 | 56 |
| 56 // Provides the backend with a request context so it can make actual network | 57 // Provides the backend with a request context so it can make actual network |
| 57 // requests. This will also fire any requests queued earlier. | 58 // requests. This will also fire any requests queued earlier. |
| 58 void Initialize(URLRequestContextGetter* request_context_getter); | 59 void Initialize(URLRequestContextGetter* request_context_getter); |
| 59 | 60 |
| 60 // Makes the service stop all requests and drop the reference to the request | 61 // Makes the service stop all requests and drop the reference to the request |
| 61 // context. | 62 // context. |
| 62 void Shutdown(); | 63 void Shutdown(); |
| 63 | 64 |
| 64 // Adds a job. Caller must make sure the job pointer stays valid until the job | 65 // Adds a job. Caller must make sure the job pointer stays valid until the job |
| (...skipping 30 matching lines...) Expand all Loading... |
| 95 | 96 |
| 96 // Jobs that are registered, but not started yet. | 97 // Jobs that are registered, but not started yet. |
| 97 JobQueue queued_jobs_; | 98 JobQueue queued_jobs_; |
| 98 | 99 |
| 99 DISALLOW_COPY_AND_ASSIGN(DeviceManagementService); | 100 DISALLOW_COPY_AND_ASSIGN(DeviceManagementService); |
| 100 }; | 101 }; |
| 101 | 102 |
| 102 } // namespace policy | 103 } // namespace policy |
| 103 | 104 |
| 104 #endif // CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_SERVICE_H_ | 105 #endif // CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_SERVICE_H_ |
| OLD | NEW |