| 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 // An object to record and send user feedback to spelling service. The spelling | 5 // An object to record and send user feedback to spelling service. The spelling |
| 6 // service uses the feedback to improve its suggestions. | 6 // service uses the feedback to improve its suggestions. |
| 7 // | 7 // |
| 8 // Assigns uint32_t hash identifiers to spelling suggestions from spelling | 8 // Assigns uint32_t hash identifiers to spelling suggestions from spelling |
| 9 // service and stores these suggestions. Records user's actions on these | 9 // service and stores these suggestions. Records user's actions on these |
| 10 // suggestions. Periodically sends batches of user feedback to the spelling | 10 // suggestions. Periodically sends batches of user feedback to the spelling |
| 11 // service. | 11 // service. |
| 12 | 12 |
| 13 #ifndef COMPONENTS_SPELLCHECK_BROWSER_FEEDBACK_SENDER_H_ | 13 #ifndef COMPONENTS_SPELLCHECK_BROWSER_FEEDBACK_SENDER_H_ |
| 14 #define COMPONENTS_SPELLCHECK_BROWSER_FEEDBACK_SENDER_H_ | 14 #define COMPONENTS_SPELLCHECK_BROWSER_FEEDBACK_SENDER_H_ |
| 15 | 15 |
| 16 #include <stddef.h> | 16 #include <stddef.h> |
| 17 #include <stdint.h> | 17 #include <stdint.h> |
| 18 | 18 |
| 19 #include <array> | 19 #include <array> |
| 20 #include <climits> | 20 #include <climits> |
| 21 #include <map> | 21 #include <map> |
| 22 #include <set> | 22 #include <set> |
| 23 #include <vector> | 23 #include <vector> |
| 24 | 24 |
| 25 #include "base/macros.h" | 25 #include "base/macros.h" |
| 26 #include "base/memory/scoped_vector.h" | |
| 27 #include "base/memory/weak_ptr.h" | 26 #include "base/memory/weak_ptr.h" |
| 28 #include "base/timer/timer.h" | 27 #include "base/timer/timer.h" |
| 29 #include "components/spellcheck/browser/feedback.h" | 28 #include "components/spellcheck/browser/feedback.h" |
| 30 #include "components/spellcheck/browser/misspelling.h" | 29 #include "components/spellcheck/browser/misspelling.h" |
| 31 #include "net/url_request/url_fetcher_delegate.h" | 30 #include "net/url_request/url_fetcher_delegate.h" |
| 32 #include "url/gurl.h" | 31 #include "url/gurl.h" |
| 33 | 32 |
| 34 class SpellCheckMarker; | 33 class SpellCheckMarker; |
| 35 struct SpellCheckResult; | 34 struct SpellCheckResult; |
| 36 | 35 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 178 |
| 180 // A timer to periodically request a list of document spelling markers from | 179 // A timer to periodically request a list of document spelling markers from |
| 181 // all of the renderers. The timer starts in StartFeedbackCollection() and | 180 // all of the renderers. The timer starts in StartFeedbackCollection() and |
| 182 // stops in StopFeedbackCollection(). The timer stops and abandons its tasks | 181 // stops in StopFeedbackCollection(). The timer stops and abandons its tasks |
| 183 // on destruction. | 182 // on destruction. |
| 184 base::RepeatingTimer timer_; | 183 base::RepeatingTimer timer_; |
| 185 | 184 |
| 186 // Feedback senders that need to stay alive for the duration of sending data. | 185 // Feedback senders that need to stay alive for the duration of sending data. |
| 187 // If a sender is destroyed before it finishes, then sending feedback will be | 186 // If a sender is destroyed before it finishes, then sending feedback will be |
| 188 // canceled. | 187 // canceled. |
| 189 ScopedVector<net::URLFetcher> senders_; | 188 std::vector<std::unique_ptr<net::URLFetcher>> senders_; |
| 190 | 189 |
| 191 DISALLOW_COPY_AND_ASSIGN(FeedbackSender); | 190 DISALLOW_COPY_AND_ASSIGN(FeedbackSender); |
| 192 }; | 191 }; |
| 193 | 192 |
| 194 } // namespace spellcheck | 193 } // namespace spellcheck |
| 195 | 194 |
| 196 #endif // COMPONENTS_SPELLCHECK_BROWSER_FEEDBACK_SENDER_H_ | 195 #endif // COMPONENTS_SPELLCHECK_BROWSER_FEEDBACK_SENDER_H_ |
| OLD | NEW |