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

Side by Side Diff: components/policy/core/common/cloud/device_management_service.cc

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded Pass() calls Created 5 years, 7 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
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 "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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698