Chromium Code Reviews| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 void Shutdown(); | 65 void Shutdown(); |
| 66 | 66 |
| 67 // Adds a job. Caller must make sure the job pointer stays valid until the job | 67 // Adds a job. Caller must make sure the job pointer stays valid until the job |
| 68 // completes or gets canceled via RemoveJob(). | 68 // completes or gets canceled via RemoveJob(). |
| 69 void AddJob(DeviceManagementJob* job); | 69 void AddJob(DeviceManagementJob* job); |
| 70 | 70 |
| 71 // Removes a job. The job will be removed and won't receive a completion | 71 // Removes a job. The job will be removed and won't receive a completion |
| 72 // callback. | 72 // callback. |
| 73 void RemoveJob(DeviceManagementJob* job); | 73 void RemoveJob(DeviceManagementJob* job); |
| 74 | 74 |
| 75 protected: | |
| 76 // Starts the given job. | |
| 77 virtual void StartJob(DeviceManagementJob* job); | |
|
gfeher
2011/07/19 13:45:33
Maybe you can make this private now?
Joao da Silva
2011/07/19 15:19:39
Not really, since the Mock needs to override this
| |
| 78 | |
| 75 private: | 79 private: |
| 76 typedef std::map<const URLFetcher*, DeviceManagementJob*> JobFetcherMap; | 80 typedef std::map<const URLFetcher*, DeviceManagementJob*> JobFetcherMap; |
| 77 typedef std::deque<DeviceManagementJob*> JobQueue; | 81 typedef std::deque<DeviceManagementJob*> JobQueue; |
| 78 | 82 |
| 79 // Starts the given job. | |
| 80 void StartJob(DeviceManagementJob* job); | |
| 81 | |
| 82 // URLFetcher::Delegate override. | 83 // URLFetcher::Delegate override. |
| 83 virtual void OnURLFetchComplete(const URLFetcher* source, | 84 virtual void OnURLFetchComplete(const URLFetcher* source, |
| 84 const GURL& url, | 85 const GURL& url, |
| 85 const net::URLRequestStatus& status, | 86 const net::URLRequestStatus& status, |
| 86 int response_code, | 87 int response_code, |
| 87 const net::ResponseCookies& cookies, | 88 const net::ResponseCookies& cookies, |
| 88 const std::string& data); | 89 const std::string& data); |
| 89 | 90 |
| 90 // Does the actual initialization using the request context specified for | 91 // Does the actual initialization using the request context specified for |
| 91 // |PrepareInitialization|. This will also fire any pending network requests. | 92 // |PrepareInitialization|. This will also fire any pending network requests. |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 109 | 110 |
| 110 // Creates tasks used for running |Initialize| delayed on the UI thread. | 111 // Creates tasks used for running |Initialize| delayed on the UI thread. |
| 111 ScopedRunnableMethodFactory<DeviceManagementService> method_factory_; | 112 ScopedRunnableMethodFactory<DeviceManagementService> method_factory_; |
| 112 | 113 |
| 113 DISALLOW_COPY_AND_ASSIGN(DeviceManagementService); | 114 DISALLOW_COPY_AND_ASSIGN(DeviceManagementService); |
| 114 }; | 115 }; |
| 115 | 116 |
| 116 } // namespace policy | 117 } // namespace policy |
| 117 | 118 |
| 118 #endif // CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_SERVICE_H_ | 119 #endif // CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_SERVICE_H_ |
| OLD | NEW |