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

Side by Side Diff: chrome/renderer/spellchecker/custom_dictionary_engine.cc

Issue 1548153002: Switch to standard integer types in chrome/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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) 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 #include "chrome/renderer/spellchecker/custom_dictionary_engine.h" 5 #include "chrome/renderer/spellchecker/custom_dictionary_engine.h"
6 6
7 #include <stddef.h>
8
7 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
8 10
9 CustomDictionaryEngine::CustomDictionaryEngine() { 11 CustomDictionaryEngine::CustomDictionaryEngine() {
10 } 12 }
11 13
12 CustomDictionaryEngine::~CustomDictionaryEngine() { 14 CustomDictionaryEngine::~CustomDictionaryEngine() {
13 } 15 }
14 16
15 void CustomDictionaryEngine::Init(const std::set<std::string>& custom_words) { 17 void CustomDictionaryEngine::Init(const std::set<std::string>& custom_words) {
16 // SpellingMenuOberver calls UTF16ToUTF8(word) to convert words for storage, 18 // SpellingMenuOberver calls UTF16ToUTF8(word) to convert words for storage,
(...skipping 19 matching lines...) Expand all
36 int misspelling_start, 38 int misspelling_start,
37 int misspelling_len) { 39 int misspelling_len) {
38 // The text to be checked is empty on OSX(async) right now. 40 // The text to be checked is empty on OSX(async) right now.
39 // TODO(groby): Fix as part of async hook-up. (http://crbug.com/178241) 41 // TODO(groby): Fix as part of async hook-up. (http://crbug.com/178241)
40 return 42 return
41 misspelling_start >= 0 && 43 misspelling_start >= 0 &&
42 misspelling_len > 0 && 44 misspelling_len > 0 &&
43 size_t(misspelling_start + misspelling_len) <= text.length() && 45 size_t(misspelling_start + misspelling_len) <= text.length() &&
44 dictionary_.count(text.substr(misspelling_start, misspelling_len)) > 0; 46 dictionary_.count(text.substr(misspelling_start, misspelling_len)) > 0;
45 } 47 }
OLDNEW
« no previous file with comments | « chrome/renderer/security_filter_peer.cc ('k') | chrome/renderer/spellchecker/hunspell_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698