| 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 #include "chrome/browser/policy/device_management_service.h" | 5 #include "chrome/browser/policy/device_management_service.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/io_thread.h" | 8 #include "chrome/browser/io_thread.h" |
| 9 #include "chrome/browser/net/chrome_net_log.h" | 9 #include "chrome/browser/net/chrome_net_log.h" |
| 10 #include "chrome/browser/policy/device_management_backend_impl.h" | 10 #include "chrome/browser/policy/device_management_backend_impl.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // All running jobs should have been cancelled by now. If not, there are | 110 // All running jobs should have been cancelled by now. If not, there are |
| 111 // backend objects still around, which is an error. | 111 // backend objects still around, which is an error. |
| 112 DCHECK(pending_jobs_.empty()); | 112 DCHECK(pending_jobs_.empty()); |
| 113 DCHECK(queued_jobs_.empty()); | 113 DCHECK(queued_jobs_.empty()); |
| 114 } | 114 } |
| 115 | 115 |
| 116 DeviceManagementBackend* DeviceManagementService::CreateBackend() { | 116 DeviceManagementBackend* DeviceManagementService::CreateBackend() { |
| 117 return new DeviceManagementBackendImpl(this); | 117 return new DeviceManagementBackendImpl(this); |
| 118 } | 118 } |
| 119 | 119 |
| 120 void DeviceManagementService::ScheduleInitialization(int delay_milliseconds) { | 120 void DeviceManagementService::ScheduleInitialization(int64 delay_milliseconds) { |
| 121 if (initialized_) | 121 if (initialized_) |
| 122 return; | 122 return; |
| 123 CancelableTask* initialization_task = method_factory_.NewRunnableMethod( | 123 CancelableTask* initialization_task = method_factory_.NewRunnableMethod( |
| 124 &DeviceManagementService::Initialize); | 124 &DeviceManagementService::Initialize); |
| 125 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 125 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 126 initialization_task, | 126 initialization_task, |
| 127 delay_milliseconds); | 127 delay_milliseconds); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void DeviceManagementService::Initialize() { | 130 void DeviceManagementService::Initialize() { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 DeviceManagementJob* job = entry->second; | 206 DeviceManagementJob* job = entry->second; |
| 207 pending_jobs_.erase(entry); | 207 pending_jobs_.erase(entry); |
| 208 job->HandleResponse(status, response_code, cookies, data); | 208 job->HandleResponse(status, response_code, cookies, data); |
| 209 } else { | 209 } else { |
| 210 NOTREACHED() << "Callback from foreign URL fetcher"; | 210 NOTREACHED() << "Callback from foreign URL fetcher"; |
| 211 } | 211 } |
| 212 delete source; | 212 delete source; |
| 213 } | 213 } |
| 214 | 214 |
| 215 } // namespace policy | 215 } // namespace policy |
| OLD | NEW |