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 += "x=" + net::EscapeQueryParamValue(JoinString(parts, '&'), true); | 146 extra += |
| 147 "x=" + net::EscapeQueryParamValue(base::JoinString(parts, "&"), true); |
147 | 148 |
148 // Check against our max url size, exempting the first extension added. | 149 // Check against our max url size, exempting the first extension added. |
149 int new_size = full_url_.possibly_invalid_spec().size() + extra.size(); | 150 int new_size = full_url_.possibly_invalid_spec().size() + extra.size(); |
150 if (!extension_ids_.empty() && new_size > kExtensionsManifestMaxURLSize) { | 151 if (!extension_ids_.empty() && new_size > kExtensionsManifestMaxURLSize) { |
151 UMA_HISTOGRAM_PERCENTAGE("Extensions.UpdateCheckHitUrlSizeLimit", 1); | 152 UMA_HISTOGRAM_PERCENTAGE("Extensions.UpdateCheckHitUrlSizeLimit", 1); |
152 return false; | 153 return false; |
153 } | 154 } |
154 UMA_HISTOGRAM_PERCENTAGE("Extensions.UpdateCheckHitUrlSizeLimit", 0); | 155 UMA_HISTOGRAM_PERCENTAGE("Extensions.UpdateCheckHitUrlSizeLimit", 0); |
155 | 156 |
156 // We have room so go ahead and add the extension. | 157 // We have room so go ahead and add the extension. |
(...skipping 24 matching lines...) Expand all Loading... |
181 void ManifestFetchData::Merge(const ManifestFetchData& other) { | 182 void ManifestFetchData::Merge(const ManifestFetchData& other) { |
182 DCHECK(full_url() == other.full_url()); | 183 DCHECK(full_url() == other.full_url()); |
183 request_ids_.insert(other.request_ids_.begin(), other.request_ids_.end()); | 184 request_ids_.insert(other.request_ids_.begin(), other.request_ids_.end()); |
184 } | 185 } |
185 | 186 |
186 bool ManifestFetchData::DidForceUpdate(const std::string& extension_id) const { | 187 bool ManifestFetchData::DidForceUpdate(const std::string& extension_id) const { |
187 return forced_updates_.find(extension_id) != forced_updates_.end(); | 188 return forced_updates_.find(extension_id) != forced_updates_.end(); |
188 } | 189 } |
189 | 190 |
190 } // namespace extensions | 191 } // namespace extensions |
OLD | NEW |