OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
592 WebFrame* main_frame = webview() ? webview()->mainFrame() : NULL; | 592 WebFrame* main_frame = webview() ? webview()->mainFrame() : NULL; |
593 if (main_frame) | 593 if (main_frame) |
594 content::GetContentClient()->SetActiveURL(main_frame->document().url()); | 594 content::GetContentClient()->SetActiveURL(main_frame->document().url()); |
595 | 595 |
596 ObserverListBase<RenderViewObserver>::Iterator it(observers_); | 596 ObserverListBase<RenderViewObserver>::Iterator it(observers_); |
597 RenderViewObserver* observer; | 597 RenderViewObserver* observer; |
598 while ((observer = it.GetNext()) != NULL) | 598 while ((observer = it.GetNext()) != NULL) |
599 if (observer->OnMessageReceived(message)) | 599 if (observer->OnMessageReceived(message)) |
600 return true; | 600 return true; |
601 | 601 |
602 // Pepper plugin delegate doesn't use observers mechanism to don't implement | |
603 // huge interface RenderViewObserver that receives notifications about | |
604 // everything. | |
jam
2011/12/05 18:07:49
None of RenderViewObserver's virtual methods are p
Dmitry Polukhin
2011/12/05 19:09:26
Done but it's inefficient and creates cyclic depen
jam
2011/12/05 19:24:43
I think only profiling can show us that this is sl
| |
605 if (pepper_delegate_.OnMessageReceived(message)) | |
606 return true; | |
607 | |
602 bool handled = true; | 608 bool handled = true; |
603 bool msg_is_ok = true; | 609 bool msg_is_ok = true; |
604 IPC_BEGIN_MESSAGE_MAP_EX(RenderViewImpl, message, msg_is_ok) | 610 IPC_BEGIN_MESSAGE_MAP_EX(RenderViewImpl, message, msg_is_ok) |
605 IPC_MESSAGE_HANDLER(ViewMsg_Navigate, OnNavigate) | 611 IPC_MESSAGE_HANDLER(ViewMsg_Navigate, OnNavigate) |
606 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) | 612 IPC_MESSAGE_HANDLER(ViewMsg_Stop, OnStop) |
607 IPC_MESSAGE_HANDLER(ViewMsg_ReloadFrame, OnReloadFrame) | 613 IPC_MESSAGE_HANDLER(ViewMsg_ReloadFrame, OnReloadFrame) |
608 IPC_MESSAGE_HANDLER(ViewMsg_Undo, OnUndo) | 614 IPC_MESSAGE_HANDLER(ViewMsg_Undo, OnUndo) |
609 IPC_MESSAGE_HANDLER(ViewMsg_Redo, OnRedo) | 615 IPC_MESSAGE_HANDLER(ViewMsg_Redo, OnRedo) |
610 IPC_MESSAGE_HANDLER(ViewMsg_Cut, OnCut) | 616 IPC_MESSAGE_HANDLER(ViewMsg_Cut, OnCut) |
611 IPC_MESSAGE_HANDLER(ViewMsg_Copy, OnCopy) | 617 IPC_MESSAGE_HANDLER(ViewMsg_Copy, OnCopy) |
(...skipping 4177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4789 return !!RenderThreadImpl::current()->compositor_thread(); | 4795 return !!RenderThreadImpl::current()->compositor_thread(); |
4790 } | 4796 } |
4791 | 4797 |
4792 void RenderViewImpl::OnJavaBridgeInit( | 4798 void RenderViewImpl::OnJavaBridgeInit( |
4793 const IPC::ChannelHandle& channel_handle) { | 4799 const IPC::ChannelHandle& channel_handle) { |
4794 DCHECK(!java_bridge_dispatcher_.get()); | 4800 DCHECK(!java_bridge_dispatcher_.get()); |
4795 #if defined(ENABLE_JAVA_BRIDGE) | 4801 #if defined(ENABLE_JAVA_BRIDGE) |
4796 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); | 4802 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); |
4797 #endif | 4803 #endif |
4798 } | 4804 } |
OLD | NEW |