OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 }; | 511 }; |
512 | 512 |
513 | 513 |
514 void ExtensionUpdater::OnManifestFetchComplete(const GURL& url, | 514 void ExtensionUpdater::OnManifestFetchComplete(const GURL& url, |
515 const URLRequestStatus& status, | 515 const URLRequestStatus& status, |
516 int response_code, | 516 int response_code, |
517 const std::string& data) { | 517 const std::string& data) { |
518 // We want to try parsing the manifest, and if it indicates updates are | 518 // We want to try parsing the manifest, and if it indicates updates are |
519 // available, we want to fire off requests to fetch those updates. | 519 // available, we want to fire off requests to fetch those updates. |
520 if (status.status() == URLRequestStatus::SUCCESS && response_code == 200) { | 520 if (status.status() == URLRequestStatus::SUCCESS && response_code == 200) { |
521 scoped_refptr<SafeManifestParser> safe_parser = | 521 scoped_refptr<SafeManifestParser> safe_parser( |
522 new SafeManifestParser(data, current_manifest_fetch_.release(), this); | 522 new SafeManifestParser(data, current_manifest_fetch_.release(), this)); |
523 safe_parser->Start(); | 523 safe_parser->Start(); |
524 } else { | 524 } else { |
525 // TODO(asargent) Do exponential backoff here. (http://crbug.com/12546). | 525 // TODO(asargent) Do exponential backoff here. (http://crbug.com/12546). |
526 VLOG(1) << "Failed to fetch manifest '" << url.possibly_invalid_spec() | 526 VLOG(1) << "Failed to fetch manifest '" << url.possibly_invalid_spec() |
527 << "' response code:" << response_code; | 527 << "' response code:" << response_code; |
528 } | 528 } |
529 manifest_fetcher_.reset(); | 529 manifest_fetcher_.reset(); |
530 current_manifest_fetch_.reset(); | 530 current_manifest_fetch_.reset(); |
531 | 531 |
532 // If we have any pending manifest requests, fire off the next one. | 532 // If we have any pending manifest requests, fire off the next one. |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 extension_fetcher_.reset( | 858 extension_fetcher_.reset( |
859 URLFetcher::Create(kExtensionFetcherId, url, URLFetcher::GET, this)); | 859 URLFetcher::Create(kExtensionFetcherId, url, URLFetcher::GET, this)); |
860 extension_fetcher_->set_request_context( | 860 extension_fetcher_->set_request_context( |
861 Profile::GetDefaultRequestContext()); | 861 Profile::GetDefaultRequestContext()); |
862 extension_fetcher_->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES | | 862 extension_fetcher_->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES | |
863 net::LOAD_DO_NOT_SAVE_COOKIES); | 863 net::LOAD_DO_NOT_SAVE_COOKIES); |
864 extension_fetcher_->Start(); | 864 extension_fetcher_->Start(); |
865 current_extension_fetch_ = ExtensionFetch(id, url, hash, version); | 865 current_extension_fetch_ = ExtensionFetch(id, url, hash, version); |
866 } | 866 } |
867 } | 867 } |
OLD | NEW |