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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 63 |
63 // Returns a copy of all misspellings. | 64 // Returns a copy of all misspellings. |
64 std::vector<Misspelling> GetAllMisspellings() const; | 65 std::vector<Misspelling> GetAllMisspellings() const; |
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 typedef std::map<uint32, Misspelling> HashMisspellingMap; |
| 74 HashMisspellingMap misspellings_; |
73 | 75 |
74 // A map of renderer process ID to hashes that identify misspellings. | 76 // A map of renderer process ID to hashes that identify misspellings. |
75 std::map<int, std::vector<uint32> > hashes_; | 77 typedef std::set<uint32> HashCollection; |
| 78 typedef std::map<int, HashCollection> RendererHashesMap; |
| 79 RendererHashesMap hashes_; |
76 | 80 |
77 DISALLOW_COPY_AND_ASSIGN(Feedback); | 81 DISALLOW_COPY_AND_ASSIGN(Feedback); |
78 }; | 82 }; |
79 | 83 |
80 } // namespace spellcheck | 84 } // namespace spellcheck |
81 | 85 |
82 #endif // CHROME_BROWSER_SPELLCHECKER_FEEDBACK_H_ | 86 #endif // CHROME_BROWSER_SPELLCHECKER_FEEDBACK_H_ |
OLD | NEW |