| 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/chromeos/imageburner/burn_manager.h" | 5 #include "chrome/browser/chromeos/imageburner/burn_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 delegate->OnConfigFileFetched(config_file_, true); | 288 delegate->OnConfigFileFetched(config_file_, true); |
| 289 return; | 289 return; |
| 290 } | 290 } |
| 291 downloaders_.push_back(delegate->AsWeakPtr()); | 291 downloaders_.push_back(delegate->AsWeakPtr()); |
| 292 | 292 |
| 293 if (config_fetcher_.get()) | 293 if (config_fetcher_.get()) |
| 294 return; | 294 return; |
| 295 | 295 |
| 296 config_fetcher_.reset(content::URLFetcher::Create( | 296 config_fetcher_.reset(content::URLFetcher::Create( |
| 297 config_file_url_, content::URLFetcher::GET, this)); | 297 config_file_url_, content::URLFetcher::GET, this)); |
| 298 config_fetcher_->StartWithRequestContextGetter( | 298 config_fetcher_->SetRequestContext( |
| 299 g_browser_process->system_request_context()); | 299 g_browser_process->system_request_context()); |
| 300 config_fetcher_->Start(); |
| 300 } | 301 } |
| 301 | 302 |
| 302 void BurnManager::OnURLFetchComplete(const content::URLFetcher* source) { | 303 void BurnManager::OnURLFetchComplete(const content::URLFetcher* source) { |
| 303 if (source == config_fetcher_.get()) { | 304 if (source == config_fetcher_.get()) { |
| 304 std::string data; | 305 std::string data; |
| 305 const bool success = | 306 const bool success = |
| 306 source->GetStatus().status() == net::URLRequestStatus::SUCCESS; | 307 source->GetStatus().status() == net::URLRequestStatus::SUCCESS; |
| 307 if (success) | 308 if (success) |
| 308 config_fetcher_->GetResponseAsString(&data); | 309 config_fetcher_->GetResponseAsString(&data); |
| 309 config_fetcher_.reset(); | 310 config_fetcher_.reset(); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 current_listener != listener_range.second; | 391 current_listener != listener_range.second; |
| 391 ++current_listener) { | 392 ++current_listener) { |
| 392 if (current_listener->second) | 393 if (current_listener->second) |
| 393 current_listener->second->OnBurnDownloadStarted(success); | 394 current_listener->second->OnBurnDownloadStarted(success); |
| 394 } | 395 } |
| 395 listeners_.erase(listener_range.first, listener_range.second); | 396 listeners_.erase(listener_range.first, listener_range.second); |
| 396 } | 397 } |
| 397 | 398 |
| 398 } // namespace imageburner | 399 } // namespace imageburner |
| 399 } // namespace chromeos | 400 } // namespace chromeos |
| OLD | NEW |