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 "chrome/browser/metrics/extension_metrics.h" | 5 #include "chrome/browser/metrics/extension_metrics.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
14 #include "chrome/common/metrics/proto/system_profile.pb.h" | 14 #include "components/metrics/proto/system_profile.pb.h" |
15 #include "extensions/browser/extension_registry.h" | 15 #include "extensions/browser/extension_registry.h" |
16 #include "extensions/common/extension_set.h" | 16 #include "extensions/common/extension_set.h" |
17 #include "third_party/smhasher/src/City.h" | 17 #include "third_party/smhasher/src/City.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 // The number of possible hash keys that a client may use. The UMA client_id | 21 // The number of possible hash keys that a client may use. The UMA client_id |
22 // value is reduced modulo this value to produce the key used by that | 22 // value is reduced modulo this value to produce the key used by that |
23 // particular client. | 23 // particular client. |
24 const size_t kExtensionListClientKeys = 4096; | 24 const size_t kExtensionListClientKeys = 4096; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 for (extensions::ExtensionSet::const_iterator it = extensions->begin(); | 93 for (extensions::ExtensionSet::const_iterator it = extensions->begin(); |
94 it != extensions->end(); ++it) { | 94 it != extensions->end(); ++it) { |
95 buckets.insert(HashExtension((*it)->id(), client_key_)); | 95 buckets.insert(HashExtension((*it)->id(), client_key_)); |
96 } | 96 } |
97 | 97 |
98 for (std::set<int>::const_iterator it = buckets.begin(); | 98 for (std::set<int>::const_iterator it = buckets.begin(); |
99 it != buckets.end(); ++it) { | 99 it != buckets.end(); ++it) { |
100 system_profile->add_occupied_extension_bucket(*it); | 100 system_profile->add_occupied_extension_bucket(*it); |
101 } | 101 } |
102 } | 102 } |
OLD | NEW |