| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 GetContentClient()->SetActiveURL(frame_->document().url()); | 638 GetContentClient()->SetActiveURL(frame_->document().url()); |
| 639 | 639 |
| 640 ObserverListBase<RenderFrameObserver>::Iterator it(observers_); | 640 ObserverListBase<RenderFrameObserver>::Iterator it(observers_); |
| 641 RenderFrameObserver* observer; | 641 RenderFrameObserver* observer; |
| 642 while ((observer = it.GetNext()) != NULL) { | 642 while ((observer = it.GetNext()) != NULL) { |
| 643 if (observer->OnMessageReceived(msg)) | 643 if (observer->OnMessageReceived(msg)) |
| 644 return true; | 644 return true; |
| 645 } | 645 } |
| 646 | 646 |
| 647 bool handled = true; | 647 bool handled = true; |
| 648 bool msg_is_ok = true; | 648 IPC_BEGIN_MESSAGE_MAP(RenderFrameImpl, msg) |
| 649 IPC_BEGIN_MESSAGE_MAP_EX(RenderFrameImpl, msg, msg_is_ok) | |
| 650 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) | 649 IPC_MESSAGE_HANDLER(FrameMsg_Navigate, OnNavigate) |
| 651 IPC_MESSAGE_HANDLER(FrameMsg_BeforeUnload, OnBeforeUnload) | 650 IPC_MESSAGE_HANDLER(FrameMsg_BeforeUnload, OnBeforeUnload) |
| 652 IPC_MESSAGE_HANDLER(FrameMsg_SwapOut, OnSwapOut) | 651 IPC_MESSAGE_HANDLER(FrameMsg_SwapOut, OnSwapOut) |
| 653 IPC_MESSAGE_HANDLER(FrameMsg_BuffersSwapped, OnBuffersSwapped) | 652 IPC_MESSAGE_HANDLER(FrameMsg_BuffersSwapped, OnBuffersSwapped) |
| 654 IPC_MESSAGE_HANDLER_GENERIC(FrameMsg_CompositorFrameSwapped, | 653 IPC_MESSAGE_HANDLER_GENERIC(FrameMsg_CompositorFrameSwapped, |
| 655 OnCompositorFrameSwapped(msg)) | 654 OnCompositorFrameSwapped(msg)) |
| 656 IPC_MESSAGE_HANDLER(FrameMsg_ChildFrameProcessGone, OnChildFrameProcessGone) | 655 IPC_MESSAGE_HANDLER(FrameMsg_ChildFrameProcessGone, OnChildFrameProcessGone) |
| 657 IPC_MESSAGE_HANDLER(FrameMsg_ContextMenuClosed, OnContextMenuClosed) | 656 IPC_MESSAGE_HANDLER(FrameMsg_ContextMenuClosed, OnContextMenuClosed) |
| 658 IPC_MESSAGE_HANDLER(FrameMsg_CustomContextMenuAction, | 657 IPC_MESSAGE_HANDLER(FrameMsg_CustomContextMenuAction, |
| 659 OnCustomContextMenuAction) | 658 OnCustomContextMenuAction) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 675 IPC_MESSAGE_HANDLER(FrameMsg_SetEditableSelectionOffsets, | 674 IPC_MESSAGE_HANDLER(FrameMsg_SetEditableSelectionOffsets, |
| 676 OnSetEditableSelectionOffsets) | 675 OnSetEditableSelectionOffsets) |
| 677 IPC_MESSAGE_HANDLER(FrameMsg_SetCompositionFromExistingText, | 676 IPC_MESSAGE_HANDLER(FrameMsg_SetCompositionFromExistingText, |
| 678 OnSetCompositionFromExistingText) | 677 OnSetCompositionFromExistingText) |
| 679 IPC_MESSAGE_HANDLER(FrameMsg_ExtendSelectionAndDelete, | 678 IPC_MESSAGE_HANDLER(FrameMsg_ExtendSelectionAndDelete, |
| 680 OnExtendSelectionAndDelete) | 679 OnExtendSelectionAndDelete) |
| 681 #if defined(OS_MACOSX) | 680 #if defined(OS_MACOSX) |
| 682 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) | 681 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) |
| 683 #endif | 682 #endif |
| 684 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) | 683 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) |
| 685 IPC_END_MESSAGE_MAP_EX() | 684 IPC_END_MESSAGE_MAP() |
| 686 | |
| 687 if (!msg_is_ok) { | |
| 688 // The message had a handler, but its deserialization failed. | |
| 689 // Kill the renderer to avoid potential spoofing attacks. | |
| 690 int id = msg.type(); | |
| 691 CHECK(false) << "Unable to deserialize " << id << " in RenderFrameImpl."; | |
| 692 } | |
| 693 | 685 |
| 694 return handled; | 686 return handled; |
| 695 } | 687 } |
| 696 | 688 |
| 697 void RenderFrameImpl::OnNavigate(const FrameMsg_Navigate_Params& params) { | 689 void RenderFrameImpl::OnNavigate(const FrameMsg_Navigate_Params& params) { |
| 698 MaybeHandleDebugURL(params.url); | 690 MaybeHandleDebugURL(params.url); |
| 699 if (!render_view_->webview()) | 691 if (!render_view_->webview()) |
| 700 return; | 692 return; |
| 701 | 693 |
| 702 render_view_->OnNavigate(params); | 694 render_view_->OnNavigate(params); |
| (...skipping 2767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3470 weak_factory_.GetWeakPtr(), | 3462 weak_factory_.GetWeakPtr(), |
| 3471 render_view_->media_player_manager_, | 3463 render_view_->media_player_manager_, |
| 3472 stream_texture_factory, | 3464 stream_texture_factory, |
| 3473 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), | 3465 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(), |
| 3474 new RenderMediaLog()); | 3466 new RenderMediaLog()); |
| 3475 } | 3467 } |
| 3476 | 3468 |
| 3477 #endif | 3469 #endif |
| 3478 | 3470 |
| 3479 } // namespace content | 3471 } // namespace content |
| OLD | NEW |