OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/render_thread.h" | 5 #include "chrome/renderer/render_thread.h" |
6 | 6 |
7 #include <v8.h> | 7 #include <v8.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 #include "chrome/renderer/render_process.h" | 51 #include "chrome/renderer/render_process.h" |
52 #include "chrome/renderer/render_view.h" | 52 #include "chrome/renderer/render_view.h" |
53 #include "chrome/renderer/renderer_webkitclient_impl.h" | 53 #include "chrome/renderer/renderer_webkitclient_impl.h" |
54 #include "chrome/renderer/renderer_web_database_observer.h" | 54 #include "chrome/renderer/renderer_web_database_observer.h" |
55 #include "chrome/renderer/socket_stream_dispatcher.h" | 55 #include "chrome/renderer/socket_stream_dispatcher.h" |
56 #if defined(SPELLCHECKER_IN_RENDERER) | 56 #if defined(SPELLCHECKER_IN_RENDERER) |
57 #include "chrome/renderer/spellchecker/spellcheck.h" | 57 #include "chrome/renderer/spellchecker/spellcheck.h" |
58 #endif | 58 #endif |
59 #include "chrome/renderer/user_script_slave.h" | 59 #include "chrome/renderer/user_script_slave.h" |
60 #include "ipc/ipc_message.h" | 60 #include "ipc/ipc_message.h" |
| 61 #include "ipc/ipc_platform_file.h" |
61 #include "third_party/tcmalloc/tcmalloc/src/google/malloc_extension.h" | 62 #include "third_party/tcmalloc/tcmalloc/src/google/malloc_extension.h" |
62 #include "third_party/WebKit/WebKit/chromium/public/WebCache.h" | 63 #include "third_party/WebKit/WebKit/chromium/public/WebCache.h" |
63 #include "third_party/WebKit/WebKit/chromium/public/WebColor.h" | 64 #include "third_party/WebKit/WebKit/chromium/public/WebColor.h" |
64 #include "third_party/WebKit/WebKit/chromium/public/WebCrossOriginPreflightResul
tCache.h" | 65 #include "third_party/WebKit/WebKit/chromium/public/WebCrossOriginPreflightResul
tCache.h" |
65 #include "third_party/WebKit/WebKit/chromium/public/WebDatabase.h" | 66 #include "third_party/WebKit/WebKit/chromium/public/WebDatabase.h" |
66 #include "third_party/WebKit/WebKit/chromium/public/WebFontCache.h" | 67 #include "third_party/WebKit/WebKit/chromium/public/WebFontCache.h" |
67 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" | 68 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" |
68 #include "third_party/WebKit/WebKit/chromium/public/WebRuntimeFeatures.h" | 69 #include "third_party/WebKit/WebKit/chromium/public/WebRuntimeFeatures.h" |
69 #include "third_party/WebKit/WebKit/chromium/public/WebScriptController.h" | 70 #include "third_party/WebKit/WebKit/chromium/public/WebScriptController.h" |
70 #include "third_party/WebKit/WebKit/chromium/public/WebSecurityPolicy.h" | 71 #include "third_party/WebKit/WebKit/chromium/public/WebSecurityPolicy.h" |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 // point we already know that the browser has refreshed its list, so disable | 654 // point we already know that the browser has refreshed its list, so disable |
654 // refresh temporarily to prevent each renderer process causing the list to be | 655 // refresh temporarily to prevent each renderer process causing the list to be |
655 // regenerated. | 656 // regenerated. |
656 plugin_refresh_allowed_ = false; | 657 plugin_refresh_allowed_ = false; |
657 WebKit::resetPluginCache(reload_pages); | 658 WebKit::resetPluginCache(reload_pages); |
658 plugin_refresh_allowed_ = true; | 659 plugin_refresh_allowed_ = true; |
659 } | 660 } |
660 | 661 |
661 #if defined(SPELLCHECKER_IN_RENDERER) | 662 #if defined(SPELLCHECKER_IN_RENDERER) |
662 void RenderThread::OnInitSpellChecker( | 663 void RenderThread::OnInitSpellChecker( |
663 const base::FileDescriptor& bdict_fd, | 664 IPC::PlatformFileForTransit bdict_file, |
664 const std::vector<std::string>& custom_words, | 665 const std::vector<std::string>& custom_words, |
665 const std::string& language, | 666 const std::string& language, |
666 bool auto_spell_correct) { | 667 bool auto_spell_correct) { |
667 spellchecker_->Init(bdict_fd, custom_words, language); | 668 spellchecker_->Init(IPC::PlatformFileForTransitToPlatformFile(bdict_file), |
| 669 custom_words, language); |
668 spellchecker_->EnableAutoSpellCorrect(auto_spell_correct); | 670 spellchecker_->EnableAutoSpellCorrect(auto_spell_correct); |
669 } | 671 } |
670 | 672 |
671 void RenderThread::OnSpellCheckWordAdded(const std::string& word) { | 673 void RenderThread::OnSpellCheckWordAdded(const std::string& word) { |
672 spellchecker_->WordAdded(word); | 674 spellchecker_->WordAdded(word); |
673 } | 675 } |
674 | 676 |
675 void RenderThread::OnSpellCheckEnableAutoSpellCorrect(bool enable) { | 677 void RenderThread::OnSpellCheckEnableAutoSpellCorrect(bool enable) { |
676 spellchecker_->EnableAutoSpellCorrect(enable); | 678 spellchecker_->EnableAutoSpellCorrect(enable); |
677 } | 679 } |
678 #endif | 680 #endif |
OLD | NEW |