OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #include "content/public/common/content_switches.h" | 47 #include "content/public/common/content_switches.h" |
48 #include "content/public/common/context_menu_params.h" | 48 #include "content/public/common/context_menu_params.h" |
49 #include "content/public/common/file_chooser_params.h" | 49 #include "content/public/common/file_chooser_params.h" |
50 #include "content/public/common/selected_file_info.h" | 50 #include "content/public/common/selected_file_info.h" |
51 #include "content/public/common/url_constants.h" | 51 #include "content/public/common/url_constants.h" |
52 #include "content/public/renderer/content_renderer_client.h" | 52 #include "content/public/renderer/content_renderer_client.h" |
53 #include "content/public/renderer/document_state.h" | 53 #include "content/public/renderer/document_state.h" |
54 #include "content/public/renderer/navigation_state.h" | 54 #include "content/public/renderer/navigation_state.h" |
55 #include "content/public/renderer/render_view_observer.h" | 55 #include "content/public/renderer/render_view_observer.h" |
56 #include "content/public/renderer/render_view_visitor.h" | 56 #include "content/public/renderer/render_view_visitor.h" |
| 57 #include "content/renderer/browser_plugin/guest_to_embedder_channel.h" |
57 #include "content/renderer/device_orientation_dispatcher.h" | 58 #include "content/renderer/device_orientation_dispatcher.h" |
58 #include "content/renderer/devtools_agent.h" | 59 #include "content/renderer/devtools_agent.h" |
59 #include "content/renderer/dom_automation_controller.h" | 60 #include "content/renderer/dom_automation_controller.h" |
60 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 61 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
61 #include "content/renderer/external_popup_menu.h" | 62 #include "content/renderer/external_popup_menu.h" |
62 #include "content/renderer/geolocation_dispatcher.h" | 63 #include "content/renderer/geolocation_dispatcher.h" |
63 #include "content/renderer/gpu/compositor_thread.h" | 64 #include "content/renderer/gpu/compositor_thread.h" |
64 #include "content/renderer/idle_user_detector.h" | 65 #include "content/renderer/idle_user_detector.h" |
65 #include "content/renderer/input_tag_speech_dispatcher.h" | 66 #include "content/renderer/input_tag_speech_dispatcher.h" |
66 #include "content/renderer/java/java_bridge_dispatcher.h" | 67 #include "content/renderer/java/java_bridge_dispatcher.h" |
67 #include "content/renderer/load_progress_tracker.h" | 68 #include "content/renderer/load_progress_tracker.h" |
68 #include "content/renderer/media/audio_message_filter.h" | 69 #include "content/renderer/media/audio_message_filter.h" |
69 #include "content/renderer/media/media_stream_dependency_factory.h" | 70 #include "content/renderer/media/media_stream_dependency_factory.h" |
70 #include "content/renderer/media/media_stream_dispatcher.h" | 71 #include "content/renderer/media/media_stream_dispatcher.h" |
71 #include "content/renderer/media/media_stream_impl.h" | 72 #include "content/renderer/media/media_stream_impl.h" |
72 #include "content/renderer/media/render_audiosourceprovider.h" | 73 #include "content/renderer/media/render_audiosourceprovider.h" |
73 #include "content/renderer/media/render_media_log.h" | 74 #include "content/renderer/media/render_media_log.h" |
74 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" | 75 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" |
75 #include "content/renderer/mhtml_generator.h" | 76 #include "content/renderer/mhtml_generator.h" |
76 #include "content/renderer/mouse_lock_dispatcher.h" | 77 #include "content/renderer/mouse_lock_dispatcher.h" |
77 #include "content/renderer/notification_provider.h" | 78 #include "content/renderer/notification_provider.h" |
78 #include "content/renderer/p2p/socket_dispatcher.h" | 79 #include "content/renderer/p2p/socket_dispatcher.h" |
79 #include "content/renderer/plugin_channel_host.h" | 80 #include "content/renderer/plugin_channel_host.h" |
| 81 #include "content/renderer/browser_plugin/browser_plugin.h" |
80 #include "content/renderer/browser_plugin/browser_plugin_constants.h" | 82 #include "content/renderer/browser_plugin/browser_plugin_constants.h" |
81 #include "content/renderer/browser_plugin/browser_plugin_placeholder.h" | |
82 #include "content/renderer/render_process.h" | 83 #include "content/renderer/render_process.h" |
83 #include "content/renderer/render_thread_impl.h" | 84 #include "content/renderer/render_thread_impl.h" |
84 #include "content/renderer/render_widget_fullscreen_pepper.h" | 85 #include "content/renderer/render_widget_fullscreen_pepper.h" |
85 #include "content/renderer/renderer_accessibility.h" | 86 #include "content/renderer/renderer_accessibility.h" |
86 #include "content/renderer/renderer_webapplicationcachehost_impl.h" | 87 #include "content/renderer/renderer_webapplicationcachehost_impl.h" |
87 #include "content/renderer/renderer_webcolorchooser_impl.h" | 88 #include "content/renderer/renderer_webcolorchooser_impl.h" |
88 #include "content/renderer/text_input_client_observer.h" | 89 #include "content/renderer/text_input_client_observer.h" |
89 #include "content/renderer/v8_value_converter_impl.h" | 90 #include "content/renderer/v8_value_converter_impl.h" |
90 #include "content/renderer/web_intents_host.h" | 91 #include "content/renderer/web_intents_host.h" |
91 #include "content/renderer/web_ui_bindings.h" | 92 #include "content/renderer/web_ui_bindings.h" |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 const WebPreferences& webkit_prefs, | 447 const WebPreferences& webkit_prefs, |
447 SharedRenderViewCounter* counter, | 448 SharedRenderViewCounter* counter, |
448 int32 routing_id, | 449 int32 routing_id, |
449 int32 surface_id, | 450 int32 surface_id, |
450 int64 session_storage_namespace_id, | 451 int64 session_storage_namespace_id, |
451 const string16& frame_name, | 452 const string16& frame_name, |
452 bool is_renderer_created, | 453 bool is_renderer_created, |
453 bool swapped_out, | 454 bool swapped_out, |
454 int32 next_page_id, | 455 int32 next_page_id, |
455 const WebKit::WebScreenInfo& screen_info, | 456 const WebKit::WebScreenInfo& screen_info, |
456 bool guest, | 457 content::GuestToEmbedderChannel* guest_to_embedder_channel, |
457 AccessibilityMode accessibility_mode) | 458 AccessibilityMode accessibility_mode) |
458 : RenderWidget(WebKit::WebPopupTypeNone, screen_info, swapped_out), | 459 : RenderWidget(WebKit::WebPopupTypeNone, screen_info, swapped_out), |
459 webkit_preferences_(webkit_prefs), | 460 webkit_preferences_(webkit_prefs), |
460 send_content_state_immediately_(false), | 461 send_content_state_immediately_(false), |
461 enabled_bindings_(0), | 462 enabled_bindings_(0), |
462 send_preferred_size_changes_(false), | 463 send_preferred_size_changes_(false), |
463 is_loading_(false), | 464 is_loading_(false), |
464 navigation_gesture_(NavigationGestureUnknown), | 465 navigation_gesture_(NavigationGestureUnknown), |
465 opened_by_user_gesture_(true), | 466 opened_by_user_gesture_(true), |
466 opener_suppressed_(false), | 467 opener_suppressed_(false), |
(...skipping 20 matching lines...) Expand all Loading... |
487 p2p_socket_dispatcher_(NULL), | 488 p2p_socket_dispatcher_(NULL), |
488 devtools_agent_(NULL), | 489 devtools_agent_(NULL), |
489 renderer_accessibility_(NULL), | 490 renderer_accessibility_(NULL), |
490 java_bridge_dispatcher_(NULL), | 491 java_bridge_dispatcher_(NULL), |
491 mouse_lock_dispatcher_(NULL), | 492 mouse_lock_dispatcher_(NULL), |
492 session_storage_namespace_id_(session_storage_namespace_id), | 493 session_storage_namespace_id_(session_storage_namespace_id), |
493 handling_select_range_(false), | 494 handling_select_range_(false), |
494 #if defined(OS_WIN) | 495 #if defined(OS_WIN) |
495 focused_plugin_id_(-1), | 496 focused_plugin_id_(-1), |
496 #endif | 497 #endif |
497 guest_(guest), | 498 guest_to_embedder_channel_(guest_to_embedder_channel), |
| 499 guest_pp_instance_(0), |
| 500 guest_uninitialized_context_(NULL), |
498 accessibility_mode_(accessibility_mode), | 501 accessibility_mode_(accessibility_mode), |
499 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)) { | 502 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)) { |
500 routing_id_ = routing_id; | 503 routing_id_ = routing_id; |
501 surface_id_ = surface_id; | 504 surface_id_ = surface_id; |
502 if (opener_id != MSG_ROUTING_NONE && is_renderer_created) | 505 if (opener_id != MSG_ROUTING_NONE && is_renderer_created) |
503 opener_id_ = opener_id; | 506 opener_id_ = opener_id; |
504 | 507 |
505 // Ensure we start with a valid next_page_id_ from the browser. | 508 // Ensure we start with a valid next_page_id_ from the browser. |
506 DCHECK_GE(next_page_id_, 0); | 509 DCHECK_GE(next_page_id_, 0); |
507 | 510 |
(...skipping 17 matching lines...) Expand all Loading... |
525 decrement_shared_popup_at_destruction_ = false; | 528 decrement_shared_popup_at_destruction_ = false; |
526 } | 529 } |
527 | 530 |
528 RenderThread::Get()->AddRoute(routing_id_, this); | 531 RenderThread::Get()->AddRoute(routing_id_, this); |
529 // Take a reference on behalf of the RenderThread. This will be balanced | 532 // Take a reference on behalf of the RenderThread. This will be balanced |
530 // when we receive ViewMsg_ClosePage. | 533 // when we receive ViewMsg_ClosePage. |
531 AddRef(); | 534 AddRef(); |
532 | 535 |
533 // If this is a popup, we must wait for the CreatingNew_ACK message before | 536 // If this is a popup, we must wait for the CreatingNew_ACK message before |
534 // completing initialization. Otherwise, we can finish it now. | 537 // completing initialization. Otherwise, we can finish it now. |
535 if (opener_id_ == MSG_ROUTING_NONE) { | 538 if (!guest_to_embedder_channel && opener_id_ == MSG_ROUTING_NONE) { |
536 did_show_ = true; | 539 did_show_ = true; |
537 CompleteInit(parent_hwnd); | 540 CompleteInit(parent_hwnd); |
538 } | 541 } |
539 | 542 |
540 g_view_map.Get().insert(std::make_pair(webview(), this)); | 543 g_view_map.Get().insert(std::make_pair(webview(), this)); |
541 webkit_preferences_.Apply(webview()); | 544 webkit_preferences_.Apply(webview()); |
542 webview()->initializeMainFrame(this); | 545 webview()->initializeMainFrame(this); |
543 if (!frame_name.empty()) | 546 if (!frame_name.empty()) |
544 webview()->mainFrame()->setName(frame_name); | 547 webview()->mainFrame()->setName(frame_name); |
545 webview()->settings()->setMinimumTimerInterval( | 548 webview()->settings()->setMinimumTimerInterval( |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 const WebPreferences& webkit_prefs, | 666 const WebPreferences& webkit_prefs, |
664 SharedRenderViewCounter* counter, | 667 SharedRenderViewCounter* counter, |
665 int32 routing_id, | 668 int32 routing_id, |
666 int32 surface_id, | 669 int32 surface_id, |
667 int64 session_storage_namespace_id, | 670 int64 session_storage_namespace_id, |
668 const string16& frame_name, | 671 const string16& frame_name, |
669 bool is_renderer_created, | 672 bool is_renderer_created, |
670 bool swapped_out, | 673 bool swapped_out, |
671 int32 next_page_id, | 674 int32 next_page_id, |
672 const WebKit::WebScreenInfo& screen_info, | 675 const WebKit::WebScreenInfo& screen_info, |
673 bool guest, | 676 content::GuestToEmbedderChannel* guest_to_embedder_channel, |
674 AccessibilityMode accessibility_mode) { | 677 AccessibilityMode accessibility_mode) { |
675 DCHECK(routing_id != MSG_ROUTING_NONE); | 678 DCHECK(routing_id != MSG_ROUTING_NONE); |
676 return new RenderViewImpl( | 679 return new RenderViewImpl( |
677 parent_hwnd, | 680 parent_hwnd, |
678 opener_id, | 681 opener_id, |
679 renderer_prefs, | 682 renderer_prefs, |
680 webkit_prefs, | 683 webkit_prefs, |
681 counter, | 684 counter, |
682 routing_id, | 685 routing_id, |
683 surface_id, | 686 surface_id, |
684 session_storage_namespace_id, | 687 session_storage_namespace_id, |
685 frame_name, | 688 frame_name, |
686 is_renderer_created, | 689 is_renderer_created, |
687 swapped_out, | 690 swapped_out, |
688 next_page_id, | 691 next_page_id, |
689 screen_info, | 692 screen_info, |
690 guest, | 693 guest_to_embedder_channel, |
691 accessibility_mode); | 694 accessibility_mode); |
692 } | 695 } |
693 | 696 |
694 WebPeerConnectionHandler* RenderViewImpl::CreatePeerConnectionHandler( | 697 WebPeerConnectionHandler* RenderViewImpl::CreatePeerConnectionHandler( |
695 WebPeerConnectionHandlerClient* client) { | 698 WebPeerConnectionHandlerClient* client) { |
696 EnsureMediaStreamImpl(); | 699 EnsureMediaStreamImpl(); |
697 if (!media_stream_impl_) | 700 if (!media_stream_impl_) |
698 return NULL; | 701 return NULL; |
699 return media_stream_impl_->CreatePeerConnectionHandler(client); | 702 return media_stream_impl_->CreatePeerConnectionHandler(client); |
700 } | 703 } |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1550 webkit_preferences_, | 1553 webkit_preferences_, |
1551 shared_popup_counter_, | 1554 shared_popup_counter_, |
1552 routing_id, | 1555 routing_id, |
1553 surface_id, | 1556 surface_id, |
1554 cloned_session_storage_namespace_id, | 1557 cloned_session_storage_namespace_id, |
1555 frame_name, | 1558 frame_name, |
1556 true, | 1559 true, |
1557 false, | 1560 false, |
1558 1, | 1561 1, |
1559 screen_info_, | 1562 screen_info_, |
1560 guest_, | 1563 guest_to_embedder_channel_, |
1561 accessibility_mode_); | 1564 accessibility_mode_); |
1562 view->opened_by_user_gesture_ = params.user_gesture; | 1565 view->opened_by_user_gesture_ = params.user_gesture; |
1563 | 1566 |
1564 // Record whether the creator frame is trying to suppress the opener field. | 1567 // Record whether the creator frame is trying to suppress the opener field. |
1565 view->opener_suppressed_ = params.opener_suppressed; | 1568 view->opener_suppressed_ = params.opener_suppressed; |
1566 | 1569 |
1567 // Record the security origin of the creator. | 1570 // Record the security origin of the creator. |
1568 GURL creator_url(creator->document().securityOrigin().toString().utf8()); | 1571 GURL creator_url(creator->document().securityOrigin().toString().utf8()); |
1569 if (!creator_url.is_valid() || !creator_url.IsStandard()) | 1572 if (!creator_url.is_valid() || !creator_url.IsStandard()) |
1570 creator_url = GURL(); | 1573 creator_url = GURL(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1607 unsigned quota) { | 1610 unsigned quota) { |
1608 CHECK(session_storage_namespace_id_ != | 1611 CHECK(session_storage_namespace_id_ != |
1609 dom_storage::kInvalidSessionStorageNamespaceId); | 1612 dom_storage::kInvalidSessionStorageNamespaceId); |
1610 return new WebStorageNamespaceImpl(session_storage_namespace_id_); | 1613 return new WebStorageNamespaceImpl(session_storage_namespace_id_); |
1611 } | 1614 } |
1612 | 1615 |
1613 WebGraphicsContext3D* RenderViewImpl::createGraphicsContext3D( | 1616 WebGraphicsContext3D* RenderViewImpl::createGraphicsContext3D( |
1614 const WebGraphicsContext3D::Attributes& attributes) { | 1617 const WebGraphicsContext3D::Attributes& attributes) { |
1615 if (!webview()) | 1618 if (!webview()) |
1616 return NULL; | 1619 return NULL; |
| 1620 |
| 1621 if (guest_to_embedder_channel()) { |
| 1622 WebGraphicsContext3DCommandBufferImpl* context = |
| 1623 guest_to_embedder_channel()->CreateWebGraphicsContext3D( |
| 1624 this, attributes, false); |
| 1625 if (!guest_pp_instance()) { |
| 1626 guest_uninitialized_context_ = context; |
| 1627 guest_attributes_ = attributes; |
| 1628 } |
| 1629 return context; |
| 1630 } |
| 1631 |
1617 // The WebGraphicsContext3DInProcessImpl code path is used for | 1632 // The WebGraphicsContext3DInProcessImpl code path is used for |
1618 // layout tests (though not through this code) as well as for | 1633 // layout tests (though not through this code) as well as for |
1619 // debugging and bringing up new ports. | 1634 // debugging and bringing up new ports. |
1620 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { | 1635 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { |
1621 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( | 1636 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( |
1622 attributes, true); | 1637 attributes, true); |
1623 } else { | 1638 } else { |
1624 GURL url; | 1639 GURL url; |
1625 if (webview()->mainFrame()) | 1640 if (webview()->mainFrame()) |
1626 url = GURL(webview()->mainFrame()->document().url()); | 1641 url = GURL(webview()->mainFrame()->document().url()); |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2129 compositor_thread->AddInputHandler( | 2144 compositor_thread->AddInputHandler( |
2130 routing_id_, input_handler_identifier, AsWeakPtr()); | 2145 routing_id_, input_handler_identifier, AsWeakPtr()); |
2131 | 2146 |
2132 RenderWidget::didActivateCompositor(input_handler_identifier); | 2147 RenderWidget::didActivateCompositor(input_handler_identifier); |
2133 } | 2148 } |
2134 | 2149 |
2135 // WebKit::WebFrameClient ----------------------------------------------------- | 2150 // WebKit::WebFrameClient ----------------------------------------------------- |
2136 | 2151 |
2137 WebPlugin* RenderViewImpl::createPlugin(WebFrame* frame, | 2152 WebPlugin* RenderViewImpl::createPlugin(WebFrame* frame, |
2138 const WebPluginParams& params) { | 2153 const WebPluginParams& params) { |
2139 // The browser plugin is a special kind of pepper plugin | |
2140 // that loads asynchronously. We first create a placeholder here. | |
2141 // When a guest is ready to be displayed, we swap out the placeholder | |
2142 // with the guest. | |
2143 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 2154 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
2144 if (command_line.HasSwitch(switches::kEnableBrowserPlugin) && | 2155 if (command_line.HasSwitch(switches::kEnableBrowserPlugin) && |
2145 UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) | 2156 UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) |
2146 return BrowserPluginPlaceholder::Create(this, frame, params); | 2157 return BrowserPlugin::Create(this, frame, params); |
2147 | 2158 |
2148 WebPlugin* plugin = NULL; | 2159 WebPlugin* plugin = NULL; |
2149 if (content::GetContentClient()->renderer()->OverrideCreatePlugin( | 2160 if (content::GetContentClient()->renderer()->OverrideCreatePlugin( |
2150 this, frame, params, &plugin)) { | 2161 this, frame, params, &plugin)) { |
2151 return plugin; | 2162 return plugin; |
2152 } | 2163 } |
2153 | 2164 |
2154 webkit::WebPluginInfo info; | 2165 webkit::WebPluginInfo info; |
2155 std::string mime_type; | 2166 std::string mime_type; |
2156 bool found = GetPluginInfo(params.url, frame->top()->document().url(), | 2167 bool found = GetPluginInfo(params.url, frame->top()->document().url(), |
(...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3631 if (node.isContentEditable()) { | 3642 if (node.isContentEditable()) { |
3632 is_editable_node = true; | 3643 is_editable_node = true; |
3633 } else if (node.isElementNode()) { | 3644 } else if (node.isElementNode()) { |
3634 is_editable_node = | 3645 is_editable_node = |
3635 node.toConst<WebElement>().isTextFormControlElement(); | 3646 node.toConst<WebElement>().isTextFormControlElement(); |
3636 } | 3647 } |
3637 } | 3648 } |
3638 return is_editable_node; | 3649 return is_editable_node; |
3639 } | 3650 } |
3640 | 3651 |
| 3652 void RenderViewImpl::GuestReady(PP_Instance instance) { |
| 3653 guest_pp_instance_ = instance; |
| 3654 if (guest_uninitialized_context_) { |
| 3655 bool success = guest_to_embedder_channel()->CreateGraphicsContext( |
| 3656 guest_uninitialized_context_, |
| 3657 guest_attributes_, |
| 3658 false, |
| 3659 this); |
| 3660 DCHECK(success); |
| 3661 } |
| 3662 CompleteInit(host_window_); |
| 3663 } |
| 3664 |
| 3665 webkit::ppapi::WebPluginImpl* RenderViewImpl::CreateBrowserPlugin( |
| 3666 const IPC::ChannelHandle& channel_handle, |
| 3667 int guest_process_id, |
| 3668 const WebKit::WebPluginParams& params) { |
| 3669 scoped_refptr<webkit::ppapi::PluginModule> pepper_module( |
| 3670 pepper_delegate_.CreateBrowserPluginModule(channel_handle, |
| 3671 guest_process_id)); |
| 3672 return new webkit::ppapi::WebPluginImpl( |
| 3673 pepper_module.get(), params, pepper_delegate_.AsWeakPtr()); |
| 3674 } |
| 3675 |
3641 WebKit::WebPlugin* RenderViewImpl::CreatePlugin( | 3676 WebKit::WebPlugin* RenderViewImpl::CreatePlugin( |
3642 WebKit::WebFrame* frame, | 3677 WebKit::WebFrame* frame, |
3643 const webkit::WebPluginInfo& info, | 3678 const webkit::WebPluginInfo& info, |
3644 const WebKit::WebPluginParams& params) { | 3679 const WebKit::WebPluginParams& params) { |
3645 bool pepper_plugin_was_registered = false; | 3680 bool pepper_plugin_was_registered = false; |
3646 scoped_refptr<webkit::ppapi::PluginModule> pepper_module( | 3681 scoped_refptr<webkit::ppapi::PluginModule> pepper_module( |
3647 pepper_delegate_.CreatePepperPluginModule(info, | 3682 pepper_delegate_.CreatePepperPluginModule(info, |
3648 &pepper_plugin_was_registered)); | 3683 &pepper_plugin_was_registered)); |
3649 if (pepper_plugin_was_registered) { | 3684 if (pepper_plugin_was_registered) { |
3650 if (!pepper_module) | 3685 if (!pepper_module) |
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4719 } | 4754 } |
4720 | 4755 |
4721 void RenderViewImpl::WillInitiatePaint() { | 4756 void RenderViewImpl::WillInitiatePaint() { |
4722 // Notify the pepper plugins that we're about to paint. | 4757 // Notify the pepper plugins that we're about to paint. |
4723 pepper_delegate_.ViewWillInitiatePaint(); | 4758 pepper_delegate_.ViewWillInitiatePaint(); |
4724 } | 4759 } |
4725 | 4760 |
4726 void RenderViewImpl::DidInitiatePaint() { | 4761 void RenderViewImpl::DidInitiatePaint() { |
4727 // Notify the pepper plugins that we've painted, and are waiting to flush. | 4762 // Notify the pepper plugins that we've painted, and are waiting to flush. |
4728 pepper_delegate_.ViewInitiatedPaint(); | 4763 pepper_delegate_.ViewInitiatedPaint(); |
| 4764 if (guest_to_embedder_channel()) |
| 4765 guest_to_embedder_channel()->IssueSwapBuffers(guest_graphics_resource()); |
4729 } | 4766 } |
4730 | 4767 |
4731 void RenderViewImpl::DidFlushPaint() { | 4768 void RenderViewImpl::DidFlushPaint() { |
4732 // Notify any pepper plugins that we painted. This will call into the plugin, | 4769 // Notify any pepper plugins that we painted. This will call into the plugin, |
4733 // and we it may ask to close itself as a result. This will, in turn, modify | 4770 // and we it may ask to close itself as a result. This will, in turn, modify |
4734 // our set, possibly invalidating the iterator. So we iterate on a copy that | 4771 // our set, possibly invalidating the iterator. So we iterate on a copy that |
4735 // won't change out from under us. | 4772 // won't change out from under us. |
4736 pepper_delegate_.ViewFlushedPaint(); | 4773 pepper_delegate_.ViewFlushedPaint(); |
4737 | 4774 |
4738 // If the RenderWidget is closing down then early-exit, otherwise we'll crash. | 4775 // If the RenderWidget is closing down then early-exit, otherwise we'll crash. |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5391 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5428 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5392 return !!RenderThreadImpl::current()->compositor_thread(); | 5429 return !!RenderThreadImpl::current()->compositor_thread(); |
5393 } | 5430 } |
5394 | 5431 |
5395 void RenderViewImpl::OnJavaBridgeInit() { | 5432 void RenderViewImpl::OnJavaBridgeInit() { |
5396 DCHECK(!java_bridge_dispatcher_); | 5433 DCHECK(!java_bridge_dispatcher_); |
5397 #if defined(ENABLE_JAVA_BRIDGE) | 5434 #if defined(ENABLE_JAVA_BRIDGE) |
5398 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); | 5435 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); |
5399 #endif | 5436 #endif |
5400 } | 5437 } |
OLD | NEW |