| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 base::StringToInt(value_string, &user_index); | 129 base::StringToInt(value_string, &user_index); |
| 130 } else { | 130 } else { |
| 131 new_query_parts.push_back(base::StringPrintf( | 131 new_query_parts.push_back(base::StringPrintf( |
| 132 "%s=%s", key_string.c_str(), value_string.c_str())); | 132 "%s=%s", key_string.c_str(), value_string.c_str())); |
| 133 } | 133 } |
| 134 } | 134 } |
| 135 if (user_index >= kMaxAuthUserValue) | 135 if (user_index >= kMaxAuthUserValue) |
| 136 return false; | 136 return false; |
| 137 new_query_parts.push_back( | 137 new_query_parts.push_back( |
| 138 base::StringPrintf("%s=%d", kAuthUserQueryKey, user_index + 1)); | 138 base::StringPrintf("%s=%d", kAuthUserQueryKey, user_index + 1)); |
| 139 std::string new_query_string = base::JoinString(new_query_parts, "&"); | 139 std::string new_query_string = JoinString(new_query_parts, '&'); |
| 140 url::Component new_query(0, new_query_string.size()); | 140 url::Component new_query(0, new_query_string.size()); |
| 141 url::Replacements<char> replacements; | 141 url::Replacements<char> replacements; |
| 142 replacements.SetQuery(new_query_string.c_str(), new_query); | 142 replacements.SetQuery(new_query_string.c_str(), new_query); |
| 143 *url = url->ReplaceComponents(replacements); | 143 *url = url->ReplaceComponents(replacements); |
| 144 return true; | 144 return true; |
| 145 } | 145 } |
| 146 | 146 |
| 147 } // namespace | 147 } // namespace |
| 148 | 148 |
| 149 UpdateDetails::UpdateDetails(const std::string& id, const Version& version) | 149 UpdateDetails::UpdateDetails(const std::string& id, const Version& version) |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 | 462 |
| 463 manifests_queue_.ScheduleRequest(fetch_data.Pass()); | 463 manifests_queue_.ScheduleRequest(fetch_data.Pass()); |
| 464 } | 464 } |
| 465 } | 465 } |
| 466 | 466 |
| 467 void ExtensionDownloader::CreateManifestFetcher() { | 467 void ExtensionDownloader::CreateManifestFetcher() { |
| 468 if (VLOG_IS_ON(2)) { | 468 if (VLOG_IS_ON(2)) { |
| 469 std::vector<std::string> id_vector( | 469 std::vector<std::string> id_vector( |
| 470 manifests_queue_.active_request()->extension_ids().begin(), | 470 manifests_queue_.active_request()->extension_ids().begin(), |
| 471 manifests_queue_.active_request()->extension_ids().end()); | 471 manifests_queue_.active_request()->extension_ids().end()); |
| 472 std::string id_list = base::JoinString(id_vector, ","); | 472 std::string id_list = JoinString(id_vector, ','); |
| 473 VLOG(2) << "Fetching " << manifests_queue_.active_request()->full_url() | 473 VLOG(2) << "Fetching " << manifests_queue_.active_request()->full_url() |
| 474 << " for " << id_list; | 474 << " for " << id_list; |
| 475 } | 475 } |
| 476 | 476 |
| 477 manifest_fetcher_ = net::URLFetcher::Create( | 477 manifest_fetcher_ = net::URLFetcher::Create( |
| 478 kManifestFetcherId, manifests_queue_.active_request()->full_url(), | 478 kManifestFetcherId, manifests_queue_.active_request()->full_url(), |
| 479 net::URLFetcher::GET, this); | 479 net::URLFetcher::GET, this); |
| 480 manifest_fetcher_->SetRequestContext(request_context_.get()); | 480 manifest_fetcher_->SetRequestContext(request_context_.get()); |
| 481 manifest_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | | 481 manifest_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | |
| 482 net::LOAD_DO_NOT_SAVE_COOKIES | | 482 net::LOAD_DO_NOT_SAVE_COOKIES | |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 const GURL& update_url, | 968 const GURL& update_url, |
| 969 int request_id) { | 969 int request_id) { |
| 970 ManifestFetchData::PingMode ping_mode = ManifestFetchData::NO_PING; | 970 ManifestFetchData::PingMode ping_mode = ManifestFetchData::NO_PING; |
| 971 if (update_url.DomainIs(ping_enabled_domain_.c_str())) | 971 if (update_url.DomainIs(ping_enabled_domain_.c_str())) |
| 972 ping_mode = ManifestFetchData::PING_WITH_ENABLED_STATE; | 972 ping_mode = ManifestFetchData::PING_WITH_ENABLED_STATE; |
| 973 return new ManifestFetchData( | 973 return new ManifestFetchData( |
| 974 update_url, request_id, brand_code_, manifest_query_params_, ping_mode); | 974 update_url, request_id, brand_code_, manifest_query_params_, ping_mode); |
| 975 } | 975 } |
| 976 | 976 |
| 977 } // namespace extensions | 977 } // namespace extensions |
| OLD | NEW |