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 "net/base/sdch_manager.h" | 5 #include "net/base/sdch_manager.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 if (entry.second->data.Expired()) | 275 if (entry.second->data.Expired()) |
276 continue; | 276 continue; |
277 ++count; | 277 ++count; |
278 result->AddDictionary(entry.first, entry.second); | 278 result->AddDictionary(entry.first, entry.second); |
279 } | 279 } |
280 | 280 |
281 if (count == 0) | 281 if (count == 0) |
282 return NULL; | 282 return NULL; |
283 | 283 |
284 UMA_HISTOGRAM_COUNTS("Sdch3.Advertisement_Count", count); | 284 UMA_HISTOGRAM_COUNTS("Sdch3.Advertisement_Count", count); |
| 285 UMA_HISTOGRAM_BOOLEAN("Sdch3.AdvertisedWithSecureScheme", |
| 286 target_url.SchemeIsSecure()); |
285 | 287 |
286 return result.Pass(); | 288 return result.Pass(); |
287 } | 289 } |
288 | 290 |
289 scoped_ptr<SdchManager::DictionarySet> | 291 scoped_ptr<SdchManager::DictionarySet> |
290 SdchManager::GetDictionarySetByHash( | 292 SdchManager::GetDictionarySetByHash( |
291 const GURL& target_url, | 293 const GURL& target_url, |
292 const std::string& server_hash, | 294 const std::string& server_hash, |
293 SdchProblemCode* problem_code) { | 295 SdchProblemCode* problem_code) { |
294 scoped_ptr<SdchManager::DictionarySet> result; | 296 scoped_ptr<SdchManager::DictionarySet> result; |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 entry_dict->SetInteger("tries", it->second.count); | 519 entry_dict->SetInteger("tries", it->second.count); |
518 entry_dict->SetInteger("reason", it->second.reason); | 520 entry_dict->SetInteger("reason", it->second.reason); |
519 entry_list->Append(entry_dict); | 521 entry_list->Append(entry_dict); |
520 } | 522 } |
521 value->Set("blacklisted", entry_list); | 523 value->Set("blacklisted", entry_list); |
522 | 524 |
523 return value; | 525 return value; |
524 } | 526 } |
525 | 527 |
526 } // namespace net | 528 } // namespace net |
OLD | NEW |