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 | 17 |
18 // From third_party/smhasher/src/City.h; that file can't be included here due | 18 // From third_party/smhasher/src/City.h; that file can't be included here due |
19 // to macro redefinitions (of UINT8_C, etc.) on Windows. | 19 // to macro redefinitions (of UINT8_C, etc.) on Windows. |
20 // TODO(mvrable): Clean up City.h so it can be included directly. | 20 // TODO(mvrable): Clean up City.h so it can be included directly. |
21 uint64 CityHash64(const char *buf, size_t len); | 21 uint64 CityHash64(const char *buf, size_t len); |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 for (extensions::ExtensionSet::const_iterator it = extensions->begin(); | 97 for (extensions::ExtensionSet::const_iterator it = extensions->begin(); |
98 it != extensions->end(); ++it) { | 98 it != extensions->end(); ++it) { |
99 buckets.insert(HashExtension((*it)->id(), client_key_)); | 99 buckets.insert(HashExtension((*it)->id(), client_key_)); |
100 } | 100 } |
101 | 101 |
102 for (std::set<int>::const_iterator it = buckets.begin(); | 102 for (std::set<int>::const_iterator it = buckets.begin(); |
103 it != buckets.end(); ++it) { | 103 it != buckets.end(); ++it) { |
104 system_profile->add_occupied_extension_bucket(*it); | 104 system_profile->add_occupied_extension_bucket(*it); |
105 } | 105 } |
106 } | 106 } |
OLD | NEW |