Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: chrome/browser/policy/cloud/device_management_service.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698