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

Side by Side Diff: chrome/browser/chromeos/customization/customization_document.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 "chrome/browser/chromeos/customization/customization_document.h" 5 #include "chrome/browser/chromeos/customization/customization_document.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 fetch_started_ = false; 560 fetch_started_ = false;
561 } 561 }
562 562
563 void ServicesCustomizationDocument::StartFileFetch() { 563 void ServicesCustomizationDocument::StartFileFetch() {
564 DelayNetworkCall(network_delay_, 564 DelayNetworkCall(network_delay_,
565 base::Bind(&ServicesCustomizationDocument::DoStartFileFetch, 565 base::Bind(&ServicesCustomizationDocument::DoStartFileFetch,
566 weak_ptr_factory_.GetWeakPtr())); 566 weak_ptr_factory_.GetWeakPtr()));
567 } 567 }
568 568
569 void ServicesCustomizationDocument::DoStartFileFetch() { 569 void ServicesCustomizationDocument::DoStartFileFetch() {
570 url_fetcher_.reset(net::URLFetcher::Create( 570 url_fetcher_ = net::URLFetcher::Create(url_, net::URLFetcher::GET, this);
571 url_, net::URLFetcher::GET, this));
572 url_fetcher_->SetRequestContext(g_browser_process->system_request_context()); 571 url_fetcher_->SetRequestContext(g_browser_process->system_request_context());
573 url_fetcher_->AddExtraRequestHeader("Accept: application/json"); 572 url_fetcher_->AddExtraRequestHeader("Accept: application/json");
574 url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | 573 url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
575 net::LOAD_DO_NOT_SAVE_COOKIES | 574 net::LOAD_DO_NOT_SAVE_COOKIES |
576 net::LOAD_DISABLE_CACHE | 575 net::LOAD_DISABLE_CACHE |
577 net::LOAD_DO_NOT_SEND_AUTH_DATA); 576 net::LOAD_DO_NOT_SEND_AUTH_DATA);
578 url_fetcher_->Start(); 577 url_fetcher_->Start();
579 } 578 }
580 579
581 bool ServicesCustomizationDocument::LoadManifestFromString( 580 bool ServicesCustomizationDocument::LoadManifestFromString(
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 apply_tasks_success_ += success; 954 apply_tasks_success_ += success;
956 955
957 if (apply_tasks_started_ != apply_tasks_finished_) 956 if (apply_tasks_started_ != apply_tasks_finished_)
958 return; 957 return;
959 958
960 if (apply_tasks_success_ == apply_tasks_finished_) 959 if (apply_tasks_success_ == apply_tasks_finished_)
961 SetApplied(true); 960 SetApplied(true);
962 } 961 }
963 962
964 } // namespace chromeos 963 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698