OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_BROWSER_SPELLCHECKER_FEEDBACK_H_ | 5 #ifndef CHROME_BROWSER_SPELLCHECKER_FEEDBACK_H_ |
6 #define CHROME_BROWSER_SPELLCHECKER_FEEDBACK_H_ | 6 #define CHROME_BROWSER_SPELLCHECKER_FEEDBACK_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
| 9 #include <set> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "chrome/browser/spellchecker/misspelling.h" | 12 #include "chrome/browser/spellchecker/misspelling.h" |
12 | 13 |
13 namespace spellcheck { | 14 namespace spellcheck { |
14 | 15 |
15 // Stores feedback for the spelling service in |Misspelling| objects. Each | 16 // Stores feedback for the spelling service in |Misspelling| objects. Each |
16 // |Misspelling| object is identified by a |hash| and corresponds to a document | 17 // |Misspelling| object is identified by a |hash| and corresponds to a document |
17 // marker with the same |hash| identifier in the renderer. | 18 // marker with the same |hash| identifier in the renderer. |
18 class Feedback { | 19 class Feedback { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 66 |
66 // Removes all misspellings. | 67 // Removes all misspellings. |
67 void Clear(); | 68 void Clear(); |
68 | 69 |
69 private: | 70 private: |
70 // A map of hashes that identify document markers to feedback data to be sent | 71 // A map of hashes that identify document markers to feedback data to be sent |
71 // to spelling service. | 72 // to spelling service. |
72 std::map<uint32, Misspelling> misspellings_; | 73 std::map<uint32, Misspelling> misspellings_; |
73 | 74 |
74 // A map of renderer process ID to hashes that identify misspellings. | 75 // A map of renderer process ID to hashes that identify misspellings. |
75 std::map<int, std::vector<uint32> > hashes_; | 76 std::map<int, std::set<uint32> > hashes_; |
76 | 77 |
77 DISALLOW_COPY_AND_ASSIGN(Feedback); | 78 DISALLOW_COPY_AND_ASSIGN(Feedback); |
78 }; | 79 }; |
79 | 80 |
80 } // namespace spellcheck | 81 } // namespace spellcheck |
81 | 82 |
82 #endif // CHROME_BROWSER_SPELLCHECKER_FEEDBACK_H_ | 83 #endif // CHROME_BROWSER_SPELLCHECKER_FEEDBACK_H_ |
OLD | NEW |