diff options
author | groby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-12 22:26:24 +0000 |
---|---|---|
committer | groby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-12 22:26:24 +0000 |
commit | cea54ee919ff03ebbc5c2a88881e4f1cc6edc235 (patch) | |
tree | e57268de20fb0b7261214fe72c914295a045abd1 | |
parent | e9d2ba6f66503b29f50fae511b57500a3d782ae1 (diff) | |
download | chromium_src-cea54ee919ff03ebbc5c2a88881e4f1cc6edc235.zip chromium_src-cea54ee919ff03ebbc5c2a88881e4f1cc6edc235.tar.gz chromium_src-cea54ee919ff03ebbc5c2a88881e4f1cc6edc235.tar.bz2 |
[Spellcheck] Remove dead IPC message
The DocumentClosed message could never be sent, since the IPC::Sender
is already gone by the time we know we need to send this.
In detail: SpellcheckProvider is a RenderViewObserver. When a
RenderView goes away, it goes through these steps:
1) Call RenderViewObserver::RenderViewGone()
This sets RenderViewObserver::render_view_ to NULL
2) Call RenderViewObserver::OnDestruct();
3) delete RenderViewObserver()
render_view_ is needed to send an IPC message, but RenderViewGone is
not overrideable. That means we cannot send a notification to the
browser that a RenderView has left the building.
TBR=tsepez@chromium.org
R=rlp@chromium.org
BUG=none
Review URL: https://chromiumcodereview.appspot.com/13966004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194028 0039d316-1c4b-4281-b951-d872f2087c98
4 files changed, 4 insertions, 17 deletions
diff --git a/chrome/browser/spellchecker/spellcheck_message_filter_mac.cc b/chrome/browser/spellchecker/spellcheck_message_filter_mac.cc index 6428b5c..88c7cbb 100644 --- a/chrome/browser/spellchecker/spellcheck_message_filter_mac.cc +++ b/chrome/browser/spellchecker/spellcheck_message_filter_mac.cc @@ -19,8 +19,6 @@ bool SpellCheckMessageFilterMac::OnMessageReceived(const IPC::Message& message, OnCheckSpelling) IPC_MESSAGE_HANDLER(SpellCheckHostMsg_FillSuggestionList, OnFillSuggestionList) - IPC_MESSAGE_HANDLER(SpellCheckHostMsg_DocumentClosed, - OnDocumentClosed) IPC_MESSAGE_HANDLER(SpellCheckHostMsg_ShowSpellingPanel, OnShowSpellingPanel) IPC_MESSAGE_HANDLER(SpellCheckHostMsg_UpdateSpellingPanelWithMisspelledWord, @@ -46,12 +44,6 @@ void SpellCheckMessageFilterMac::OnFillSuggestionList( spellcheck_mac::FillSuggestionList(word, suggestions); } - -void SpellCheckMessageFilterMac::OnDocumentClosed(int route_id) { - spellcheck_mac::CloseDocumentWithTag(ToDocumentTag(route_id)); - RetireDocumentTag(route_id); -} - void SpellCheckMessageFilterMac::OnShowSpellingPanel(bool show) { spellcheck_mac::ShowSpellingPanel(show); } @@ -75,7 +67,11 @@ int SpellCheckMessageFilterMac::ToDocumentTag(int route_id) { return tag_map_[route_id]; } +// TODO(groby): We are currently not notified of retired tags. We need +// to track destruction of RenderViewHosts on the browser process side +// to update our mappings when a document goes away. void SpellCheckMessageFilterMac::RetireDocumentTag(int route_id) { + spellcheck_mac::CloseDocumentWithTag(ToDocumentTag(route_id)); tag_map_.erase(route_id); } diff --git a/chrome/browser/spellchecker/spellcheck_message_filter_mac.h b/chrome/browser/spellchecker/spellcheck_message_filter_mac.h index 3c98cbe..d5071db 100644 --- a/chrome/browser/spellchecker/spellcheck_message_filter_mac.h +++ b/chrome/browser/spellchecker/spellcheck_message_filter_mac.h @@ -27,7 +27,6 @@ class SpellCheckMessageFilterMac : public content::BrowserMessageFilter { void OnCheckSpelling(const string16& word, int route_id, bool* correct); void OnFillSuggestionList(const string16& word, std::vector<string16>* suggestions); - void OnDocumentClosed(int route_id); void OnShowSpellingPanel(bool show); void OnUpdateSpellingPanelWithMisspelledWord(const string16& word); void OnRequestTextCheck(int route_id, diff --git a/chrome/common/spellcheck_messages.h b/chrome/common/spellcheck_messages.h index 171d30f..c201311 100644 --- a/chrome/common/spellcheck_messages.h +++ b/chrome/common/spellcheck_messages.h @@ -95,11 +95,6 @@ IPC_MESSAGE_CONTROL3(SpellCheckHostMsg_CallSpellingService, #endif #if defined(OS_MACOSX) -// This message tells the spellchecker that a document has been closed and all -// of the ignored words for that document can be forgotten. -IPC_MESSAGE_ROUTED1(SpellCheckHostMsg_DocumentClosed, - int /* route_id to identify document */) - // Tells the browser to display or not display the SpellingPanel IPC_MESSAGE_ROUTED1(SpellCheckHostMsg_ShowSpellingPanel, bool /* if true, then show it, otherwise hide it*/) diff --git a/chrome/renderer/spellchecker/spellcheck_provider.cc b/chrome/renderer/spellchecker/spellcheck_provider.cc index 8b989c4..ff6e9a9 100644 --- a/chrome/renderer/spellchecker/spellcheck_provider.cc +++ b/chrome/renderer/spellchecker/spellcheck_provider.cc @@ -57,9 +57,6 @@ SpellCheckProvider::SpellCheckProvider( } SpellCheckProvider::~SpellCheckProvider() { -#if defined(OS_MACOSX) - Send(new SpellCheckHostMsg_DocumentClosed(routing_id(), routing_id())); -#endif } void SpellCheckProvider::RequestTextChecking( |