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 "components/policy/core/common/cloud/device_management_service.h" | 5 #include "components/policy/core/common/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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 DeviceManagementService::DeviceManagementService( | 468 DeviceManagementService::DeviceManagementService( |
469 scoped_ptr<Configuration> configuration) | 469 scoped_ptr<Configuration> configuration) |
470 : configuration_(configuration.Pass()), | 470 : configuration_(configuration.Pass()), |
471 initialized_(false), | 471 initialized_(false), |
472 weak_ptr_factory_(this) { | 472 weak_ptr_factory_(this) { |
473 DCHECK(configuration_); | 473 DCHECK(configuration_); |
474 } | 474 } |
475 | 475 |
476 void DeviceManagementService::StartJob(DeviceManagementRequestJobImpl* job) { | 476 void DeviceManagementService::StartJob(DeviceManagementRequestJobImpl* job) { |
477 std::string server_url = GetServerUrl(); | 477 std::string server_url = GetServerUrl(); |
478 net::URLFetcher* fetcher = net::URLFetcher::Create( | 478 net::URLFetcher* fetcher = |
479 kURLFetcherID, job->GetURL(server_url), net::URLFetcher::POST, this); | 479 net::URLFetcher::Create(kURLFetcherID, job->GetURL(server_url), |
| 480 net::URLFetcher::POST, this).release(); |
480 job->ConfigureRequest(fetcher); | 481 job->ConfigureRequest(fetcher); |
481 pending_jobs_[fetcher] = job; | 482 pending_jobs_[fetcher] = job; |
482 fetcher->Start(); | 483 fetcher->Start(); |
483 } | 484 } |
484 | 485 |
485 std::string DeviceManagementService::GetServerUrl() { | 486 std::string DeviceManagementService::GetServerUrl() { |
486 return configuration_->GetServerUrl(); | 487 return configuration_->GetServerUrl(); |
487 } | 488 } |
488 | 489 |
489 void DeviceManagementService::OnURLFetchComplete( | 490 void DeviceManagementService::OnURLFetchComplete( |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 } | 529 } |
529 } | 530 } |
530 | 531 |
531 const JobQueue::iterator elem = | 532 const JobQueue::iterator elem = |
532 std::find(queued_jobs_.begin(), queued_jobs_.end(), job); | 533 std::find(queued_jobs_.begin(), queued_jobs_.end(), job); |
533 if (elem != queued_jobs_.end()) | 534 if (elem != queued_jobs_.end()) |
534 queued_jobs_.erase(elem); | 535 queued_jobs_.erase(elem); |
535 } | 536 } |
536 | 537 |
537 } // namespace policy | 538 } // namespace policy |
OLD | NEW |