Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(525)

Side by Side Diff: chrome/browser/spellchecker/misspelling.cc

Issue 1545223002: Switch to standard integer types in chrome/browser/, part 4 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // The |Misspelling| object stores the misspelling, a spellcheck suggestion for 5 // The |Misspelling| object stores the misspelling, a spellcheck suggestion for
6 // it, and user's action on it. The misspelling is stored as |context|, 6 // it, and user's action on it. The misspelling is stored as |context|,
7 // |location|, and |length| instead of only misspelled text, because the 7 // |location|, and |length| instead of only misspelled text, because the
8 // spellcheck algorithm uses the context. 8 // spellcheck algorithm uses the context.
9 9
10 #include "chrome/browser/spellchecker/misspelling.h" 10 #include "chrome/browser/spellchecker/misspelling.h"
(...skipping 20 matching lines...) Expand all
31 31
32 } // namespace 32 } // namespace
33 33
34 Misspelling::Misspelling() 34 Misspelling::Misspelling()
35 : location(0), length(0), hash(0), timestamp(base::Time::Now()) {} 35 : location(0), length(0), hash(0), timestamp(base::Time::Now()) {}
36 36
37 Misspelling::Misspelling(const base::string16& context, 37 Misspelling::Misspelling(const base::string16& context,
38 size_t location, 38 size_t location,
39 size_t length, 39 size_t length,
40 const std::vector<base::string16>& suggestions, 40 const std::vector<base::string16>& suggestions,
41 uint32 hash) 41 uint32_t hash)
42 : context(context), 42 : context(context),
43 location(location), 43 location(location),
44 length(length), 44 length(length),
45 suggestions(suggestions), 45 suggestions(suggestions),
46 hash(hash), 46 hash(hash),
47 timestamp(base::Time::Now()) {} 47 timestamp(base::Time::Now()) {}
48 48
49 Misspelling::~Misspelling() {} 49 Misspelling::~Misspelling() {}
50 50
51 base::DictionaryValue* SerializeMisspelling(const Misspelling& misspelling) { 51 base::DictionaryValue* SerializeMisspelling(const Misspelling& misspelling) {
(...skipping 19 matching lines...) Expand all
71 } 71 }
72 72
73 size_t ApproximateSerializedSize(const Misspelling& misspelling) { 73 size_t ApproximateSerializedSize(const Misspelling& misspelling) {
74 // Estimated by eyeballing JSON overhead. 74 // Estimated by eyeballing JSON overhead.
75 const size_t kNumberOfOverheadBytes = 180; 75 const size_t kNumberOfOverheadBytes = 180;
76 size_t result = misspelling.context.length() + kNumberOfOverheadBytes; 76 size_t result = misspelling.context.length() + kNumberOfOverheadBytes;
77 for (const base::string16& suggestion : misspelling.suggestions) 77 for (const base::string16& suggestion : misspelling.suggestions)
78 result += suggestion.size(); 78 result += suggestion.size();
79 return result; 79 return result;
80 } 80 }
OLDNEW
« no previous file with comments | « chrome/browser/spellchecker/misspelling.h ('k') | chrome/browser/spellchecker/spellcheck_action_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698