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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 } | 550 } |
551 | 551 |
552 DeviceManagementRequestJob* DeviceManagementService::CreateJob( | 552 DeviceManagementRequestJob* DeviceManagementService::CreateJob( |
553 DeviceManagementRequestJob::JobType type) { | 553 DeviceManagementRequestJob::JobType type) { |
554 return new DeviceManagementRequestJobImpl(type, this); | 554 return new DeviceManagementRequestJobImpl(type, this); |
555 } | 555 } |
556 | 556 |
557 void DeviceManagementService::ScheduleInitialization(int64 delay_milliseconds) { | 557 void DeviceManagementService::ScheduleInitialization(int64 delay_milliseconds) { |
558 if (initialized_) | 558 if (initialized_) |
559 return; | 559 return; |
560 MessageLoop::current()->PostDelayedTask( | 560 base::MessageLoop::current()->PostDelayedTask( |
561 FROM_HERE, | 561 FROM_HERE, |
562 base::Bind(&DeviceManagementService::Initialize, | 562 base::Bind(&DeviceManagementService::Initialize, |
563 weak_ptr_factory_.GetWeakPtr()), | 563 weak_ptr_factory_.GetWeakPtr()), |
564 base::TimeDelta::FromMilliseconds(delay_milliseconds)); | 564 base::TimeDelta::FromMilliseconds(delay_milliseconds)); |
565 } | 565 } |
566 | 566 |
567 void DeviceManagementService::Initialize() { | 567 void DeviceManagementService::Initialize() { |
568 if (initialized_) | 568 if (initialized_) |
569 return; | 569 return; |
570 DCHECK(!request_context_getter_); | 570 DCHECK(!request_context_getter_); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 } | 646 } |
647 } | 647 } |
648 | 648 |
649 const JobQueue::iterator elem = | 649 const JobQueue::iterator elem = |
650 std::find(queued_jobs_.begin(), queued_jobs_.end(), job); | 650 std::find(queued_jobs_.begin(), queued_jobs_.end(), job); |
651 if (elem != queued_jobs_.end()) | 651 if (elem != queued_jobs_.end()) |
652 queued_jobs_.erase(elem); | 652 queued_jobs_.erase(elem); |
653 } | 653 } |
654 | 654 |
655 } // namespace policy | 655 } // namespace policy |
OLD | NEW |