| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/cloud/device_management_service.h" | 5 #include "chrome/browser/policy/cloud/device_management_service.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 } | 547 } |
| 548 | 548 |
| 549 DeviceManagementRequestJob* DeviceManagementService::CreateJob( | 549 DeviceManagementRequestJob* DeviceManagementService::CreateJob( |
| 550 DeviceManagementRequestJob::JobType type) { | 550 DeviceManagementRequestJob::JobType type) { |
| 551 return new DeviceManagementRequestJobImpl(type, this); | 551 return new DeviceManagementRequestJobImpl(type, this); |
| 552 } | 552 } |
| 553 | 553 |
| 554 void DeviceManagementService::ScheduleInitialization(int64 delay_milliseconds) { | 554 void DeviceManagementService::ScheduleInitialization(int64 delay_milliseconds) { |
| 555 if (initialized_) | 555 if (initialized_) |
| 556 return; | 556 return; |
| 557 MessageLoop::current()->PostDelayedTask( | 557 base::MessageLoop::current()->PostDelayedTask( |
| 558 FROM_HERE, | 558 FROM_HERE, |
| 559 base::Bind(&DeviceManagementService::Initialize, | 559 base::Bind(&DeviceManagementService::Initialize, |
| 560 weak_ptr_factory_.GetWeakPtr()), | 560 weak_ptr_factory_.GetWeakPtr()), |
| 561 base::TimeDelta::FromMilliseconds(delay_milliseconds)); | 561 base::TimeDelta::FromMilliseconds(delay_milliseconds)); |
| 562 } | 562 } |
| 563 | 563 |
| 564 void DeviceManagementService::Initialize() { | 564 void DeviceManagementService::Initialize() { |
| 565 if (initialized_) | 565 if (initialized_) |
| 566 return; | 566 return; |
| 567 DCHECK(!request_context_getter_); | 567 DCHECK(!request_context_getter_); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 } | 643 } |
| 644 } | 644 } |
| 645 | 645 |
| 646 const JobQueue::iterator elem = | 646 const JobQueue::iterator elem = |
| 647 std::find(queued_jobs_.begin(), queued_jobs_.end(), job); | 647 std::find(queued_jobs_.begin(), queued_jobs_.end(), job); |
| 648 if (elem != queued_jobs_.end()) | 648 if (elem != queued_jobs_.end()) |
| 649 queued_jobs_.erase(elem); | 649 queued_jobs_.erase(elem); |
| 650 } | 650 } |
| 651 | 651 |
| 652 } // namespace policy | 652 } // namespace policy |
| OLD | NEW |