| 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/updater/manifest_fetch_data.h" | 5 #include "extensions/browser/updater/manifest_fetch_data.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 ping_value += "&"; | 136 ping_value += "&"; |
| 137 ping_value += "a=" + base::IntToString(ping_data->active_days); | 137 ping_value += "a=" + base::IntToString(ping_data->active_days); |
| 138 pings_[id].active_days = ping_data->active_days; | 138 pings_[id].active_days = ping_data->active_days; |
| 139 } | 139 } |
| 140 } | 140 } |
| 141 if (!ping_value.empty()) | 141 if (!ping_value.empty()) |
| 142 parts.push_back("ping=" + net::EscapeQueryParamValue(ping_value, true)); | 142 parts.push_back("ping=" + net::EscapeQueryParamValue(ping_value, true)); |
| 143 } | 143 } |
| 144 | 144 |
| 145 std::string extra = full_url_.has_query() ? "&" : "?"; | 145 std::string extra = full_url_.has_query() ? "&" : "?"; |
| 146 extra += | 146 extra += "x=" + net::EscapeQueryParamValue(JoinString(parts, '&'), true); |
| 147 "x=" + net::EscapeQueryParamValue(base::JoinString(parts, "&"), true); | |
| 148 | 147 |
| 149 // Check against our max url size, exempting the first extension added. | 148 // Check against our max url size, exempting the first extension added. |
| 150 int new_size = full_url_.possibly_invalid_spec().size() + extra.size(); | 149 int new_size = full_url_.possibly_invalid_spec().size() + extra.size(); |
| 151 if (!extension_ids_.empty() && new_size > kExtensionsManifestMaxURLSize) { | 150 if (!extension_ids_.empty() && new_size > kExtensionsManifestMaxURLSize) { |
| 152 UMA_HISTOGRAM_PERCENTAGE("Extensions.UpdateCheckHitUrlSizeLimit", 1); | 151 UMA_HISTOGRAM_PERCENTAGE("Extensions.UpdateCheckHitUrlSizeLimit", 1); |
| 153 return false; | 152 return false; |
| 154 } | 153 } |
| 155 UMA_HISTOGRAM_PERCENTAGE("Extensions.UpdateCheckHitUrlSizeLimit", 0); | 154 UMA_HISTOGRAM_PERCENTAGE("Extensions.UpdateCheckHitUrlSizeLimit", 0); |
| 156 | 155 |
| 157 // We have room so go ahead and add the extension. | 156 // We have room so go ahead and add the extension. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 182 void ManifestFetchData::Merge(const ManifestFetchData& other) { | 181 void ManifestFetchData::Merge(const ManifestFetchData& other) { |
| 183 DCHECK(full_url() == other.full_url()); | 182 DCHECK(full_url() == other.full_url()); |
| 184 request_ids_.insert(other.request_ids_.begin(), other.request_ids_.end()); | 183 request_ids_.insert(other.request_ids_.begin(), other.request_ids_.end()); |
| 185 } | 184 } |
| 186 | 185 |
| 187 bool ManifestFetchData::DidForceUpdate(const std::string& extension_id) const { | 186 bool ManifestFetchData::DidForceUpdate(const std::string& extension_id) const { |
| 188 return forced_updates_.find(extension_id) != forced_updates_.end(); | 187 return forced_updates_.find(extension_id) != forced_updates_.end(); |
| 189 } | 188 } |
| 190 | 189 |
| 191 } // namespace extensions | 190 } // namespace extensions |
| OLD | NEW |