| Index: chrome/renderer/spellchecker/spellcheck.cc
|
| ===================================================================
|
| --- chrome/renderer/spellchecker/spellcheck.cc (revision 32085)
|
| +++ chrome/renderer/spellchecker/spellcheck.cc (working copy)
|
| @@ -16,7 +16,8 @@
|
| using base::TimeTicks;
|
|
|
| SpellCheck::SpellCheck()
|
| - : auto_spell_correct_turned_on_(false),
|
| + : file_(base::kInvalidPlatformFileValue),
|
| + auto_spell_correct_turned_on_(false),
|
| // TODO(estade): initialize this properly.
|
| is_using_platform_spelling_engine_(false),
|
| initialized_(false) {
|
| @@ -26,13 +27,13 @@
|
| SpellCheck::~SpellCheck() {
|
| }
|
|
|
| -void SpellCheck::Init(const base::FileDescriptor& fd,
|
| +void SpellCheck::Init(base::PlatformFile file,
|
| const std::vector<std::string>& custom_words,
|
| const std::string language) {
|
| initialized_ = true;
|
| hunspell_.reset();
|
| bdict_file_.reset();
|
| - fd_ = fd;
|
| + file_ = file;
|
| character_attributes_.SetDefaultLanguage(language);
|
|
|
| custom_words_.insert(custom_words_.end(),
|
| @@ -57,7 +58,7 @@
|
| return true;
|
|
|
| // Do nothing if spell checking is disabled.
|
| - if (initialized_ && fd_.fd == -1)
|
| + if (initialized_ && file_ == base::kInvalidPlatformFileValue)
|
| return true;
|
|
|
| *misspelling_start = 0;
|
| @@ -164,7 +165,7 @@
|
|
|
| bdict_file_.reset(new file_util::MemoryMappedFile);
|
|
|
| - if (bdict_file_->Initialize(fd_)) {
|
| + if (bdict_file_->Initialize(file_)) {
|
| TimeTicks start_time = TimeTicks::Now();
|
|
|
| hunspell_.reset(
|
| @@ -194,7 +195,8 @@
|
| }
|
|
|
| // Check if the platform spellchecker is being used.
|
| - if (!is_using_platform_spelling_engine_ && fd_.fd != -1) {
|
| + if (!is_using_platform_spelling_engine_ &&
|
| + file_ != base::kInvalidPlatformFileValue) {
|
| // If it isn't, init hunspell.
|
| InitializeHunspell();
|
| }
|
|
|