| OLD | NEW | 
|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/content_hash_fetcher.h" | 5 #include "extensions/browser/content_hash_fetcher.h" | 
| 6 | 6 | 
| 7 #include <algorithm> | 7 #include <algorithm> | 
| 8 | 8 | 
| 9 #include "base/base64.h" | 9 #include "base/base64.h" | 
| 10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" | 
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 230 | 230 | 
| 231 void ContentHashFetcherJob::DoneCheckingForVerifiedContents(bool found) { | 231 void ContentHashFetcherJob::DoneCheckingForVerifiedContents(bool found) { | 
| 232   if (IsCancelled()) | 232   if (IsCancelled()) | 
| 233     return; | 233     return; | 
| 234   if (found) { | 234   if (found) { | 
| 235     VLOG(1) << "Found verified contents for " << extension_id_; | 235     VLOG(1) << "Found verified contents for " << extension_id_; | 
| 236     DoneFetchingVerifiedContents(true); | 236     DoneFetchingVerifiedContents(true); | 
| 237   } else { | 237   } else { | 
| 238     VLOG(1) << "Missing verified contents for " << extension_id_ | 238     VLOG(1) << "Missing verified contents for " << extension_id_ | 
| 239             << ", fetching..."; | 239             << ", fetching..."; | 
| 240     url_fetcher_.reset( | 240     url_fetcher_ = | 
| 241         net::URLFetcher::Create(fetch_url_, net::URLFetcher::GET, this)); | 241         net::URLFetcher::Create(fetch_url_, net::URLFetcher::GET, this); | 
| 242     url_fetcher_->SetRequestContext(request_context_); | 242     url_fetcher_->SetRequestContext(request_context_); | 
| 243     url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | | 243     url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | | 
| 244                                net::LOAD_DO_NOT_SAVE_COOKIES | | 244                                net::LOAD_DO_NOT_SAVE_COOKIES | | 
| 245                                net::LOAD_DISABLE_CACHE); | 245                                net::LOAD_DISABLE_CACHE); | 
| 246     url_fetcher_->SetAutomaticallyRetryOnNetworkChanges(3); | 246     url_fetcher_->SetAutomaticallyRetryOnNetworkChanges(3); | 
| 247     url_fetcher_->Start(); | 247     url_fetcher_->Start(); | 
| 248   } | 248   } | 
| 249 } | 249 } | 
| 250 | 250 | 
| 251 // Helper function to let us pass ownership of a string via base::Bind with the | 251 // Helper function to let us pass ownership of a string via base::Bind with the | 
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 496 | 496 | 
| 497   for (JobMap::iterator i = jobs_.begin(); i != jobs_.end(); ++i) { | 497   for (JobMap::iterator i = jobs_.begin(); i != jobs_.end(); ++i) { | 
| 498     if (i->second.get() == job) { | 498     if (i->second.get() == job) { | 
| 499       jobs_.erase(i); | 499       jobs_.erase(i); | 
| 500       break; | 500       break; | 
| 501     } | 501     } | 
| 502   } | 502   } | 
| 503 } | 503 } | 
| 504 | 504 | 
| 505 }  // namespace extensions | 505 }  // namespace extensions | 
| OLD | NEW | 
|---|