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 "extensions/browser/updater/extension_downloader.h" | 5 #include "extensions/browser/updater/extension_downloader.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 bool is_secure = fetch->url.SchemeIsCryptographic(); | 741 bool is_secure = fetch->url.SchemeIsCryptographic(); |
742 if (fetch->credentials != ExtensionFetch::CREDENTIALS_COOKIES || !is_secure) { | 742 if (fetch->credentials != ExtensionFetch::CREDENTIALS_COOKIES || !is_secure) { |
743 load_flags |= net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES; | 743 load_flags |= net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES; |
744 } | 744 } |
745 extension_fetcher_->SetLoadFlags(load_flags); | 745 extension_fetcher_->SetLoadFlags(load_flags); |
746 | 746 |
747 // Download CRX files to a temp file. The blacklist is small and will be | 747 // Download CRX files to a temp file. The blacklist is small and will be |
748 // processed in memory, so it is fetched into a string. | 748 // processed in memory, so it is fetched into a string. |
749 if (fetch->id != kBlacklistAppID) { | 749 if (fetch->id != kBlacklistAppID) { |
750 extension_fetcher_->SaveResponseToTemporaryFile( | 750 extension_fetcher_->SaveResponseToTemporaryFile( |
751 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); | 751 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)); |
752 } | 752 } |
753 | 753 |
754 if (fetch->credentials == ExtensionFetch::CREDENTIALS_OAUTH2_TOKEN && | 754 if (fetch->credentials == ExtensionFetch::CREDENTIALS_OAUTH2_TOKEN && |
755 is_secure) { | 755 is_secure) { |
756 if (access_token_.empty()) { | 756 if (access_token_.empty()) { |
757 // We should try OAuth2, but we have no token cached. This | 757 // We should try OAuth2, but we have no token cached. This |
758 // ExtensionFetcher will be started once the token fetch is complete, | 758 // ExtensionFetcher will be started once the token fetch is complete, |
759 // in either OnTokenFetchSuccess or OnTokenFetchFailure. | 759 // in either OnTokenFetchSuccess or OnTokenFetchFailure. |
760 DCHECK(identity_provider_.get()); | 760 DCHECK(identity_provider_.get()); |
761 OAuth2TokenService::ScopeSet webstore_scopes; | 761 OAuth2TokenService::ScopeSet webstore_scopes; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 const GURL& update_url, | 940 const GURL& update_url, |
941 int request_id) { | 941 int request_id) { |
942 ManifestFetchData::PingMode ping_mode = ManifestFetchData::NO_PING; | 942 ManifestFetchData::PingMode ping_mode = ManifestFetchData::NO_PING; |
943 if (update_url.DomainIs(ping_enabled_domain_.c_str())) | 943 if (update_url.DomainIs(ping_enabled_domain_.c_str())) |
944 ping_mode = ManifestFetchData::PING_WITH_ENABLED_STATE; | 944 ping_mode = ManifestFetchData::PING_WITH_ENABLED_STATE; |
945 return new ManifestFetchData( | 945 return new ManifestFetchData( |
946 update_url, request_id, brand_code_, manifest_query_params_, ping_mode); | 946 update_url, request_id, brand_code_, manifest_query_params_, ping_mode); |
947 } | 947 } |
948 | 948 |
949 } // namespace extensions | 949 } // namespace extensions |
OLD | NEW |