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

Unified Diff: chrome/browser/spellchecker/spellcheck_service.cc

Issue 121523002: [Spellcheck] Unify dictionary handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/spellchecker/spellcheck_service.cc
diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc
index 2bb13aebe3f747f25e292106606dee5dbc40e1bf..0e79ee05f3087b3296f4618df3db1d5a358e5a78 100644
--- a/chrome/browser/spellchecker/spellcheck_service.cc
+++ b/chrome/browser/spellchecker/spellcheck_service.cc
@@ -168,19 +168,8 @@ void SpellcheckService::InitForRenderer(content::RenderProcessHost* process) {
if (hunspell_dictionary_->GetDictionaryFile() !=
base::kInvalidPlatformFileValue) {
-#if defined(OS_POSIX)
- file = base::FileDescriptor(hunspell_dictionary_->GetDictionaryFile(),
- false);
-#elif defined(OS_WIN)
- BOOL ok = ::DuplicateHandle(::GetCurrentProcess(),
- hunspell_dictionary_->GetDictionaryFile(),
- process->GetHandle(),
- &file,
- 0,
- false,
- DUPLICATE_SAME_ACCESS);
- DCHECK(ok) << ::GetLastError();
-#endif
+ file = IPC::GetFileHandleForProcess(
+ hunspell_dictionary_->GetDictionaryFile(), process->GetHandle(), false);
please use gerrit instead 2013/12/30 17:21:24 DHCECK(file != base::kInvalidPlatformFileValue)
groby-ooo-7-16 2014/01/02 17:48:44 Which error is this supposed to catch?
please use gerrit instead 2014/01/02 17:54:25 This would catch ::DuplicateHandle() returning fal
groby-ooo-7-16 2014/01/02 19:15:28 Technically, DCHECK should document invalid states
}
process->Send(new SpellCheckMsg_Init(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698