OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "chrome/browser/renderer_host/browser_render_process_host.h" | 8 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 OnUpdatedCacheStats) | 766 OnUpdatedCacheStats) |
767 IPC_MESSAGE_HANDLER(ViewHostMsg_SuddenTerminationChanged, | 767 IPC_MESSAGE_HANDLER(ViewHostMsg_SuddenTerminationChanged, |
768 SuddenTerminationChanged); | 768 SuddenTerminationChanged); |
769 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionAddListener, | 769 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionAddListener, |
770 OnExtensionAddListener) | 770 OnExtensionAddListener) |
771 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionRemoveListener, | 771 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionRemoveListener, |
772 OnExtensionRemoveListener) | 772 OnExtensionRemoveListener) |
773 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionCloseChannel, | 773 IPC_MESSAGE_HANDLER(ViewHostMsg_ExtensionCloseChannel, |
774 OnExtensionCloseChannel) | 774 OnExtensionCloseChannel) |
775 IPC_MESSAGE_HANDLER(ViewHostMsg_EstablishGpuChannel, | 775 IPC_MESSAGE_HANDLER(ViewHostMsg_EstablishGpuChannel, |
776 OnMsgEstablishGpuChannel) | 776 OnMsgEstablishGpuChannel) |
| 777 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_SynchronizeGpu, |
| 778 OnMsgSynchronizeGpu) |
777 IPC_MESSAGE_HANDLER(ViewHostMsg_SpellChecker_RequestDictionary, | 779 IPC_MESSAGE_HANDLER(ViewHostMsg_SpellChecker_RequestDictionary, |
778 OnSpellCheckerRequestDictionary) | 780 OnSpellCheckerRequestDictionary) |
779 IPC_MESSAGE_UNHANDLED_ERROR() | 781 IPC_MESSAGE_UNHANDLED_ERROR() |
780 IPC_END_MESSAGE_MAP_EX() | 782 IPC_END_MESSAGE_MAP_EX() |
781 | 783 |
782 if (!msg_is_ok) { | 784 if (!msg_is_ok) { |
783 // The message had a handler, but its de-serialization failed. | 785 // The message had a handler, but its de-serialization failed. |
784 // We consider this a capital crime. Kill the renderer if we have one. | 786 // We consider this a capital crime. Kill the renderer if we have one. |
785 ReceivedBadMessage(msg.type()); | 787 ReceivedBadMessage(msg.type()); |
786 } | 788 } |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 void BrowserRenderProcessHost::OnExtensionCloseChannel(int port_id) { | 977 void BrowserRenderProcessHost::OnExtensionCloseChannel(int port_id) { |
976 if (profile()->GetExtensionMessageService()) { | 978 if (profile()->GetExtensionMessageService()) { |
977 profile()->GetExtensionMessageService()->CloseChannel(port_id); | 979 profile()->GetExtensionMessageService()->CloseChannel(port_id); |
978 } | 980 } |
979 } | 981 } |
980 | 982 |
981 void BrowserRenderProcessHost::OnMsgEstablishGpuChannel() { | 983 void BrowserRenderProcessHost::OnMsgEstablishGpuChannel() { |
982 GpuProcessHost::Get()->EstablishGpuChannel(id()); | 984 GpuProcessHost::Get()->EstablishGpuChannel(id()); |
983 } | 985 } |
984 | 986 |
| 987 void BrowserRenderProcessHost::OnMsgSynchronizeGpu(IPC::Message* reply) { |
| 988 GpuProcessHost::Get()->Synchronize(id(), reply); |
| 989 } |
| 990 |
985 void BrowserRenderProcessHost::OnSpellCheckerRequestDictionary() { | 991 void BrowserRenderProcessHost::OnSpellCheckerRequestDictionary() { |
986 if (profile()->GetSpellCheckHost()) { | 992 if (profile()->GetSpellCheckHost()) { |
987 // The spellchecker initialization already started and finished; just send | 993 // The spellchecker initialization already started and finished; just send |
988 // it to the renderer. | 994 // it to the renderer. |
989 InitSpellChecker(); | 995 InitSpellChecker(); |
990 } else { | 996 } else { |
991 // We may have gotten multiple requests from different renderers. We don't | 997 // We may have gotten multiple requests from different renderers. We don't |
992 // want to initialize multiple times in this case, so we set |force| to | 998 // want to initialize multiple times in this case, so we set |force| to |
993 // false. | 999 // false. |
994 profile()->ReinitializeSpellCheckHost(false); | 1000 profile()->ReinitializeSpellCheckHost(false); |
(...skipping 29 matching lines...) Expand all Loading... |
1024 IPC::InvalidPlatformFileForTransit(), | 1030 IPC::InvalidPlatformFileForTransit(), |
1025 std::vector<std::string>(), | 1031 std::vector<std::string>(), |
1026 std::string(), | 1032 std::string(), |
1027 false)); | 1033 false)); |
1028 } | 1034 } |
1029 } | 1035 } |
1030 | 1036 |
1031 void BrowserRenderProcessHost::EnableAutoSpellCorrect(bool enable) { | 1037 void BrowserRenderProcessHost::EnableAutoSpellCorrect(bool enable) { |
1032 Send(new ViewMsg_SpellChecker_EnableAutoSpellCorrect(enable)); | 1038 Send(new ViewMsg_SpellChecker_EnableAutoSpellCorrect(enable)); |
1033 } | 1039 } |
OLD | NEW |