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

Unified Diff: chrome/renderer/spellchecker/spellcheck.cc

Issue 397014: Revert 31875 to see whether it fixes reliability bot. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/spellchecker/spellcheck.h ('k') | ipc/ipc.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/spellchecker/spellcheck.cc
===================================================================
--- chrome/renderer/spellchecker/spellcheck.cc (revision 32064)
+++ chrome/renderer/spellchecker/spellcheck.cc (working copy)
@@ -16,8 +16,7 @@
using base::TimeTicks;
SpellCheck::SpellCheck()
- : file_(base::kInvalidPlatformFileValue),
- auto_spell_correct_turned_on_(false),
+ : auto_spell_correct_turned_on_(false),
// TODO(estade): initialize this properly.
is_using_platform_spelling_engine_(false),
initialized_(false) {
@@ -27,13 +26,13 @@
SpellCheck::~SpellCheck() {
}
-void SpellCheck::Init(base::PlatformFile file,
+void SpellCheck::Init(const base::FileDescriptor& fd,
const std::vector<std::string>& custom_words,
const std::string language) {
initialized_ = true;
hunspell_.reset();
bdict_file_.reset();
- file_ = file;
+ fd_ = fd;
character_attributes_.SetDefaultLanguage(language);
custom_words_.insert(custom_words_.end(),
@@ -58,7 +57,7 @@
return true;
// Do nothing if spell checking is disabled.
- if (initialized_ && file_ == base::kInvalidPlatformFileValue)
+ if (initialized_ && fd_.fd == -1)
return true;
*misspelling_start = 0;
@@ -165,7 +164,7 @@
bdict_file_.reset(new file_util::MemoryMappedFile);
- if (bdict_file_->Initialize(file_)) {
+ if (bdict_file_->Initialize(fd_)) {
TimeTicks start_time = TimeTicks::Now();
hunspell_.reset(
@@ -195,8 +194,7 @@
}
// Check if the platform spellchecker is being used.
- if (!is_using_platform_spelling_engine_ &&
- file_ != base::kInvalidPlatformFileValue) {
+ if (!is_using_platform_spelling_engine_ && fd_.fd != -1) {
// If it isn't, init hunspell.
InitializeHunspell();
}
« no previous file with comments | « chrome/renderer/spellchecker/spellcheck.h ('k') | ipc/ipc.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698