| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extensions/extension_updater.h" | 5 #include "chrome/browser/extensions/extension_updater.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 updater.get(), &ExtensionUpdater::OnCRXFileWritten, extension_id, | 350 updater.get(), &ExtensionUpdater::OnCRXFileWritten, extension_id, |
| 351 path, download_url)); | 351 path, download_url)); |
| 352 } | 352 } |
| 353 | 353 |
| 354 private: | 354 private: |
| 355 friend class base::RefCountedThreadSafe<ExtensionUpdaterFileHandler>; | 355 friend class base::RefCountedThreadSafe<ExtensionUpdaterFileHandler>; |
| 356 | 356 |
| 357 ~ExtensionUpdaterFileHandler() {} | 357 ~ExtensionUpdaterFileHandler() {} |
| 358 }; | 358 }; |
| 359 | 359 |
| 360 ExtensionUpdater::ExtensionFetch::ExtensionFetch() |
| 361 : id(""), |
| 362 url(), |
| 363 package_hash(""), |
| 364 version("") {} |
| 365 |
| 366 ExtensionUpdater::ExtensionFetch::ExtensionFetch(const std::string& i, |
| 367 const GURL& u, |
| 368 const std::string& h, |
| 369 const std::string& v) |
| 370 : id(i), url(u), package_hash(h), version(v) {} |
| 371 |
| 372 ExtensionUpdater::ExtensionFetch::~ExtensionFetch() {} |
| 373 |
| 360 ExtensionUpdater::ExtensionUpdater(ExtensionUpdateService* service, | 374 ExtensionUpdater::ExtensionUpdater(ExtensionUpdateService* service, |
| 361 PrefService* prefs, | 375 PrefService* prefs, |
| 362 int frequency_seconds) | 376 int frequency_seconds) |
| 363 : alive_(false), service_(service), frequency_seconds_(frequency_seconds), | 377 : alive_(false), service_(service), frequency_seconds_(frequency_seconds), |
| 364 prefs_(prefs), file_handler_(new ExtensionUpdaterFileHandler()), | 378 prefs_(prefs), file_handler_(new ExtensionUpdaterFileHandler()), |
| 365 blacklist_checks_enabled_(true) { | 379 blacklist_checks_enabled_(true) { |
| 366 Init(); | 380 Init(); |
| 367 } | 381 } |
| 368 | 382 |
| 369 void ExtensionUpdater::Init() { | 383 void ExtensionUpdater::Init() { |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 925 URLFetcher::Create(kExtensionFetcherId, url, URLFetcher::GET, this)); | 939 URLFetcher::Create(kExtensionFetcherId, url, URLFetcher::GET, this)); |
| 926 extension_fetcher_->set_request_context( | 940 extension_fetcher_->set_request_context( |
| 927 Profile::GetDefaultRequestContext()); | 941 Profile::GetDefaultRequestContext()); |
| 928 extension_fetcher_->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES | | 942 extension_fetcher_->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES | |
| 929 net::LOAD_DO_NOT_SAVE_COOKIES | | 943 net::LOAD_DO_NOT_SAVE_COOKIES | |
| 930 net::LOAD_DISABLE_CACHE); | 944 net::LOAD_DISABLE_CACHE); |
| 931 extension_fetcher_->Start(); | 945 extension_fetcher_->Start(); |
| 932 current_extension_fetch_ = ExtensionFetch(id, url, hash, version); | 946 current_extension_fetch_ = ExtensionFetch(id, url, hash, version); |
| 933 } | 947 } |
| 934 } | 948 } |
| OLD | NEW |