| 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 #ifndef CHROME_COMMON_EXTENSIONS_VALUE_COUNTER_H_ | 5 #ifndef EXTENSIONS_COMMON_VALUE_COUNTER_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_VALUE_COUNTER_H_ | 6 #define EXTENSIONS_COMMON_VALUE_COUNTER_H_ |
| 7 |
| 8 #include <vector> |
| 7 | 9 |
| 8 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
| 9 | 11 |
| 10 #include <vector> | |
| 11 | |
| 12 namespace base { | 12 namespace base { |
| 13 class Value; | 13 class Value; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace extensions { | 16 namespace extensions { |
| 17 | 17 |
| 18 // Keeps a running count of Values, like map<Value, int>. Adding / removing | 18 // Keeps a running count of Values, like map<Value, int>. Adding / removing |
| 19 // values increments / decrements the count associated with a given Value. | 19 // values increments / decrements the count associated with a given Value. |
| 20 // | 20 // |
| 21 // Add() and Remove() are linear in the number of Values in the ValueCounter, | 21 // Add() and Remove() are linear in the number of Values in the ValueCounter, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 int AddImpl(const base::Value& value, bool increment); | 62 int AddImpl(const base::Value& value, bool increment); |
| 63 | 63 |
| 64 EntryList entries_; | 64 EntryList entries_; |
| 65 | 65 |
| 66 DISALLOW_COPY_AND_ASSIGN(ValueCounter); | 66 DISALLOW_COPY_AND_ASSIGN(ValueCounter); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } // namespace extensions | 69 } // namespace extensions |
| 70 | 70 |
| 71 #endif // CHROME_COMMON_EXTENSIONS_VALUE_COUNTER_H_ | 71 #endif // EXTENSIONS_COMMON_VALUE_COUNTER_H_ |
| OLD | NEW |