Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 9968097: Browser Plugin: Renderer-side changes (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Make RefCounted<GuestToEmbedderChannel> a friend Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/test/render_view_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "content/public/common/content_switches.h" 48 #include "content/public/common/content_switches.h"
49 #include "content/public/common/context_menu_params.h" 49 #include "content/public/common/context_menu_params.h"
50 #include "content/public/common/file_chooser_params.h" 50 #include "content/public/common/file_chooser_params.h"
51 #include "content/public/common/selected_file_info.h" 51 #include "content/public/common/selected_file_info.h"
52 #include "content/public/common/url_constants.h" 52 #include "content/public/common/url_constants.h"
53 #include "content/public/renderer/content_renderer_client.h" 53 #include "content/public/renderer/content_renderer_client.h"
54 #include "content/public/renderer/document_state.h" 54 #include "content/public/renderer/document_state.h"
55 #include "content/public/renderer/navigation_state.h" 55 #include "content/public/renderer/navigation_state.h"
56 #include "content/public/renderer/render_view_observer.h" 56 #include "content/public/renderer/render_view_observer.h"
57 #include "content/public/renderer/render_view_visitor.h" 57 #include "content/public/renderer/render_view_visitor.h"
58 #include "content/renderer/browser_plugin/guest_to_embedder_channel.h"
58 #include "content/renderer/device_orientation_dispatcher.h" 59 #include "content/renderer/device_orientation_dispatcher.h"
59 #include "content/renderer/devtools_agent.h" 60 #include "content/renderer/devtools_agent.h"
60 #include "content/renderer/dom_automation_controller.h" 61 #include "content/renderer/dom_automation_controller.h"
61 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" 62 #include "content/renderer/dom_storage/webstoragenamespace_impl.h"
62 #include "content/renderer/external_popup_menu.h" 63 #include "content/renderer/external_popup_menu.h"
63 #include "content/renderer/geolocation_dispatcher.h" 64 #include "content/renderer/geolocation_dispatcher.h"
64 #include "content/renderer/gpu/compositor_thread.h" 65 #include "content/renderer/gpu/compositor_thread.h"
65 #include "content/renderer/idle_user_detector.h" 66 #include "content/renderer/idle_user_detector.h"
66 #include "content/renderer/input_tag_speech_dispatcher.h" 67 #include "content/renderer/input_tag_speech_dispatcher.h"
67 #include "content/renderer/java/java_bridge_dispatcher.h" 68 #include "content/renderer/java/java_bridge_dispatcher.h"
68 #include "content/renderer/load_progress_tracker.h" 69 #include "content/renderer/load_progress_tracker.h"
69 #include "content/renderer/media/audio_message_filter.h" 70 #include "content/renderer/media/audio_message_filter.h"
70 #include "content/renderer/media/media_stream_dependency_factory.h" 71 #include "content/renderer/media/media_stream_dependency_factory.h"
71 #include "content/renderer/media/media_stream_dispatcher.h" 72 #include "content/renderer/media/media_stream_dispatcher.h"
72 #include "content/renderer/media/media_stream_impl.h" 73 #include "content/renderer/media/media_stream_impl.h"
73 #include "content/renderer/media/render_audiosourceprovider.h" 74 #include "content/renderer/media/render_audiosourceprovider.h"
74 #include "content/renderer/media/render_media_log.h" 75 #include "content/renderer/media/render_media_log.h"
75 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" 76 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h"
76 #include "content/renderer/mhtml_generator.h" 77 #include "content/renderer/mhtml_generator.h"
77 #include "content/renderer/mouse_lock_dispatcher.h" 78 #include "content/renderer/mouse_lock_dispatcher.h"
78 #include "content/renderer/notification_provider.h" 79 #include "content/renderer/notification_provider.h"
79 #include "content/renderer/p2p/socket_dispatcher.h" 80 #include "content/renderer/p2p/socket_dispatcher.h"
80 #include "content/renderer/plugin_channel_host.h" 81 #include "content/renderer/plugin_channel_host.h"
82 #include "content/renderer/browser_plugin/browser_plugin.h"
81 #include "content/renderer/browser_plugin/browser_plugin_constants.h" 83 #include "content/renderer/browser_plugin/browser_plugin_constants.h"
82 #include "content/renderer/browser_plugin/browser_plugin_placeholder.h"
83 #include "content/renderer/render_process.h" 84 #include "content/renderer/render_process.h"
84 #include "content/renderer/render_thread_impl.h" 85 #include "content/renderer/render_thread_impl.h"
85 #include "content/renderer/render_widget_fullscreen_pepper.h" 86 #include "content/renderer/render_widget_fullscreen_pepper.h"
86 #include "content/renderer/renderer_accessibility.h" 87 #include "content/renderer/renderer_accessibility.h"
87 #include "content/renderer/renderer_webapplicationcachehost_impl.h" 88 #include "content/renderer/renderer_webapplicationcachehost_impl.h"
88 #include "content/renderer/renderer_webcolorchooser_impl.h" 89 #include "content/renderer/renderer_webcolorchooser_impl.h"
89 #include "content/renderer/text_input_client_observer.h" 90 #include "content/renderer/text_input_client_observer.h"
90 #include "content/renderer/v8_value_converter_impl.h" 91 #include "content/renderer/v8_value_converter_impl.h"
91 #include "content/renderer/web_intents_host.h" 92 #include "content/renderer/web_intents_host.h"
92 #include "content/renderer/web_ui_bindings.h" 93 #include "content/renderer/web_ui_bindings.h"
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 const WebPreferences& webkit_prefs, 490 const WebPreferences& webkit_prefs,
490 SharedRenderViewCounter* counter, 491 SharedRenderViewCounter* counter,
491 int32 routing_id, 492 int32 routing_id,
492 int32 surface_id, 493 int32 surface_id,
493 int64 session_storage_namespace_id, 494 int64 session_storage_namespace_id,
494 const string16& frame_name, 495 const string16& frame_name,
495 bool is_renderer_created, 496 bool is_renderer_created,
496 bool swapped_out, 497 bool swapped_out,
497 int32 next_page_id, 498 int32 next_page_id,
498 const WebKit::WebScreenInfo& screen_info, 499 const WebKit::WebScreenInfo& screen_info,
499 bool guest, 500 content::GuestToEmbedderChannel* guest_to_embedder_channel,
500 AccessibilityMode accessibility_mode) 501 AccessibilityMode accessibility_mode)
501 : RenderWidget(WebKit::WebPopupTypeNone, screen_info, swapped_out), 502 : RenderWidget(WebKit::WebPopupTypeNone, screen_info, swapped_out),
502 webkit_preferences_(webkit_prefs), 503 webkit_preferences_(webkit_prefs),
503 send_content_state_immediately_(false), 504 send_content_state_immediately_(false),
504 enabled_bindings_(0), 505 enabled_bindings_(0),
505 send_preferred_size_changes_(false), 506 send_preferred_size_changes_(false),
506 is_loading_(false), 507 is_loading_(false),
507 navigation_gesture_(NavigationGestureUnknown), 508 navigation_gesture_(NavigationGestureUnknown),
508 opened_by_user_gesture_(true), 509 opened_by_user_gesture_(true),
509 opener_suppressed_(false), 510 opener_suppressed_(false),
(...skipping 20 matching lines...) Expand all
530 p2p_socket_dispatcher_(NULL), 531 p2p_socket_dispatcher_(NULL),
531 devtools_agent_(NULL), 532 devtools_agent_(NULL),
532 renderer_accessibility_(NULL), 533 renderer_accessibility_(NULL),
533 java_bridge_dispatcher_(NULL), 534 java_bridge_dispatcher_(NULL),
534 mouse_lock_dispatcher_(NULL), 535 mouse_lock_dispatcher_(NULL),
535 session_storage_namespace_id_(session_storage_namespace_id), 536 session_storage_namespace_id_(session_storage_namespace_id),
536 handling_select_range_(false), 537 handling_select_range_(false),
537 #if defined(OS_WIN) 538 #if defined(OS_WIN)
538 focused_plugin_id_(-1), 539 focused_plugin_id_(-1),
539 #endif 540 #endif
540 guest_(guest), 541 guest_to_embedder_channel_(guest_to_embedder_channel),
542 guest_pp_instance_(0),
543 guest_uninitialized_context_(NULL),
541 accessibility_mode_(accessibility_mode), 544 accessibility_mode_(accessibility_mode),
542 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)) { 545 ALLOW_THIS_IN_INITIALIZER_LIST(pepper_delegate_(this)) {
543 routing_id_ = routing_id; 546 routing_id_ = routing_id;
544 surface_id_ = surface_id; 547 surface_id_ = surface_id;
545 if (opener_id != MSG_ROUTING_NONE && is_renderer_created) 548 if (opener_id != MSG_ROUTING_NONE && is_renderer_created)
546 opener_id_ = opener_id; 549 opener_id_ = opener_id;
547 550
548 // Ensure we start with a valid next_page_id_ from the browser. 551 // Ensure we start with a valid next_page_id_ from the browser.
549 DCHECK_GE(next_page_id_, 0); 552 DCHECK_GE(next_page_id_, 0);
550 553
(...skipping 17 matching lines...) Expand all
568 decrement_shared_popup_at_destruction_ = false; 571 decrement_shared_popup_at_destruction_ = false;
569 } 572 }
570 573
571 RenderThread::Get()->AddRoute(routing_id_, this); 574 RenderThread::Get()->AddRoute(routing_id_, this);
572 // Take a reference on behalf of the RenderThread. This will be balanced 575 // Take a reference on behalf of the RenderThread. This will be balanced
573 // when we receive ViewMsg_ClosePage. 576 // when we receive ViewMsg_ClosePage.
574 AddRef(); 577 AddRef();
575 578
576 // If this is a popup, we must wait for the CreatingNew_ACK message before 579 // If this is a popup, we must wait for the CreatingNew_ACK message before
577 // completing initialization. Otherwise, we can finish it now. 580 // completing initialization. Otherwise, we can finish it now.
578 if (opener_id_ == MSG_ROUTING_NONE) { 581 if (!guest_to_embedder_channel && opener_id_ == MSG_ROUTING_NONE) {
579 did_show_ = true; 582 did_show_ = true;
580 CompleteInit(parent_hwnd); 583 CompleteInit(parent_hwnd);
581 } 584 }
582 585
583 g_view_map.Get().insert(std::make_pair(webview(), this)); 586 g_view_map.Get().insert(std::make_pair(webview(), this));
584 webkit_preferences_.Apply(webview()); 587 webkit_preferences_.Apply(webview());
585 webview()->initializeMainFrame(this); 588 webview()->initializeMainFrame(this);
586 if (!frame_name.empty()) 589 if (!frame_name.empty())
587 webview()->mainFrame()->setName(frame_name); 590 webview()->mainFrame()->setName(frame_name);
588 webview()->settings()->setMinimumTimerInterval( 591 webview()->settings()->setMinimumTimerInterval(
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 const WebPreferences& webkit_prefs, 709 const WebPreferences& webkit_prefs,
707 SharedRenderViewCounter* counter, 710 SharedRenderViewCounter* counter,
708 int32 routing_id, 711 int32 routing_id,
709 int32 surface_id, 712 int32 surface_id,
710 int64 session_storage_namespace_id, 713 int64 session_storage_namespace_id,
711 const string16& frame_name, 714 const string16& frame_name,
712 bool is_renderer_created, 715 bool is_renderer_created,
713 bool swapped_out, 716 bool swapped_out,
714 int32 next_page_id, 717 int32 next_page_id,
715 const WebKit::WebScreenInfo& screen_info, 718 const WebKit::WebScreenInfo& screen_info,
716 bool guest, 719 content::GuestToEmbedderChannel* guest_to_embedder_channel,
717 AccessibilityMode accessibility_mode) { 720 AccessibilityMode accessibility_mode) {
718 DCHECK(routing_id != MSG_ROUTING_NONE); 721 DCHECK(routing_id != MSG_ROUTING_NONE);
719 return new RenderViewImpl( 722 return new RenderViewImpl(
720 parent_hwnd, 723 parent_hwnd,
721 opener_id, 724 opener_id,
722 renderer_prefs, 725 renderer_prefs,
723 webkit_prefs, 726 webkit_prefs,
724 counter, 727 counter,
725 routing_id, 728 routing_id,
726 surface_id, 729 surface_id,
727 session_storage_namespace_id, 730 session_storage_namespace_id,
728 frame_name, 731 frame_name,
729 is_renderer_created, 732 is_renderer_created,
730 swapped_out, 733 swapped_out,
731 next_page_id, 734 next_page_id,
732 screen_info, 735 screen_info,
733 guest, 736 guest_to_embedder_channel,
734 accessibility_mode); 737 accessibility_mode);
735 } 738 }
736 739
737 WebPeerConnectionHandler* RenderViewImpl::CreatePeerConnectionHandler( 740 WebPeerConnectionHandler* RenderViewImpl::CreatePeerConnectionHandler(
738 WebPeerConnectionHandlerClient* client) { 741 WebPeerConnectionHandlerClient* client) {
739 EnsureMediaStreamImpl(); 742 EnsureMediaStreamImpl();
740 if (!media_stream_impl_) 743 if (!media_stream_impl_)
741 return NULL; 744 return NULL;
742 return media_stream_impl_->CreatePeerConnectionHandler(client); 745 return media_stream_impl_->CreatePeerConnectionHandler(client);
743 } 746 }
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 webkit_preferences_, 1596 webkit_preferences_,
1594 shared_popup_counter_, 1597 shared_popup_counter_,
1595 routing_id, 1598 routing_id,
1596 surface_id, 1599 surface_id,
1597 cloned_session_storage_namespace_id, 1600 cloned_session_storage_namespace_id,
1598 frame_name, 1601 frame_name,
1599 true, 1602 true,
1600 false, 1603 false,
1601 1, 1604 1,
1602 screen_info_, 1605 screen_info_,
1603 guest_, 1606 guest_to_embedder_channel_,
1604 accessibility_mode_); 1607 accessibility_mode_);
1605 view->opened_by_user_gesture_ = params.user_gesture; 1608 view->opened_by_user_gesture_ = params.user_gesture;
1606 1609
1607 // Record whether the creator frame is trying to suppress the opener field. 1610 // Record whether the creator frame is trying to suppress the opener field.
1608 view->opener_suppressed_ = params.opener_suppressed; 1611 view->opener_suppressed_ = params.opener_suppressed;
1609 1612
1610 // Record the security origin of the creator. 1613 // Record the security origin of the creator.
1611 GURL creator_url(creator->document().securityOrigin().toString().utf8()); 1614 GURL creator_url(creator->document().securityOrigin().toString().utf8());
1612 if (!creator_url.is_valid() || !creator_url.IsStandard()) 1615 if (!creator_url.is_valid() || !creator_url.IsStandard())
1613 creator_url = GURL(); 1616 creator_url = GURL();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1650 unsigned quota) { 1653 unsigned quota) {
1651 CHECK(session_storage_namespace_id_ != 1654 CHECK(session_storage_namespace_id_ !=
1652 dom_storage::kInvalidSessionStorageNamespaceId); 1655 dom_storage::kInvalidSessionStorageNamespaceId);
1653 return new WebStorageNamespaceImpl(session_storage_namespace_id_); 1656 return new WebStorageNamespaceImpl(session_storage_namespace_id_);
1654 } 1657 }
1655 1658
1656 WebGraphicsContext3D* RenderViewImpl::createGraphicsContext3D( 1659 WebGraphicsContext3D* RenderViewImpl::createGraphicsContext3D(
1657 const WebGraphicsContext3D::Attributes& attributes) { 1660 const WebGraphicsContext3D::Attributes& attributes) {
1658 if (!webview()) 1661 if (!webview())
1659 return NULL; 1662 return NULL;
1663
1664 if (guest_to_embedder_channel()) {
1665 WebGraphicsContext3DCommandBufferImpl* context =
1666 guest_to_embedder_channel()->CreateWebGraphicsContext3D(
1667 this, attributes, false);
1668 if (!guest_pp_instance()) {
1669 guest_uninitialized_context_ = context;
1670 guest_attributes_ = attributes;
1671 }
1672 return context;
1673 }
1674
1660 // The WebGraphicsContext3DInProcessImpl code path is used for 1675 // The WebGraphicsContext3DInProcessImpl code path is used for
1661 // layout tests (though not through this code) as well as for 1676 // layout tests (though not through this code) as well as for
1662 // debugging and bringing up new ports. 1677 // debugging and bringing up new ports.
1663 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { 1678 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) {
1664 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( 1679 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView(
1665 attributes, true); 1680 attributes, true);
1666 } else { 1681 } else {
1667 GURL url; 1682 GURL url;
1668 if (webview()->mainFrame()) 1683 if (webview()->mainFrame())
1669 url = GURL(webview()->mainFrame()->document().url()); 1684 url = GURL(webview()->mainFrame()->document().url());
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
2173 compositor_thread->AddInputHandler( 2188 compositor_thread->AddInputHandler(
2174 routing_id_, input_handler_identifier, AsWeakPtr()); 2189 routing_id_, input_handler_identifier, AsWeakPtr());
2175 2190
2176 RenderWidget::didActivateCompositor(input_handler_identifier); 2191 RenderWidget::didActivateCompositor(input_handler_identifier);
2177 } 2192 }
2178 2193
2179 // WebKit::WebFrameClient ----------------------------------------------------- 2194 // WebKit::WebFrameClient -----------------------------------------------------
2180 2195
2181 WebPlugin* RenderViewImpl::createPlugin(WebFrame* frame, 2196 WebPlugin* RenderViewImpl::createPlugin(WebFrame* frame,
2182 const WebPluginParams& params) { 2197 const WebPluginParams& params) {
2183 // The browser plugin is a special kind of pepper plugin
2184 // that loads asynchronously. We first create a placeholder here.
2185 // When a guest is ready to be displayed, we swap out the placeholder
2186 // with the guest.
2187 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 2198 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
2188 if (command_line.HasSwitch(switches::kEnableBrowserPlugin) && 2199 if (command_line.HasSwitch(switches::kEnableBrowserPlugin) &&
2189 UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) 2200 UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType)
2190 return BrowserPluginPlaceholder::Create(this, frame, params); 2201 return BrowserPlugin::Create(this, frame, params);
2191 2202
2192 WebPlugin* plugin = NULL; 2203 WebPlugin* plugin = NULL;
2193 if (content::GetContentClient()->renderer()->OverrideCreatePlugin( 2204 if (content::GetContentClient()->renderer()->OverrideCreatePlugin(
2194 this, frame, params, &plugin)) { 2205 this, frame, params, &plugin)) {
2195 return plugin; 2206 return plugin;
2196 } 2207 }
2197 2208
2198 webkit::WebPluginInfo info; 2209 webkit::WebPluginInfo info;
2199 std::string mime_type; 2210 std::string mime_type;
2200 bool found = GetPluginInfo(params.url, frame->top()->document().url(), 2211 bool found = GetPluginInfo(params.url, frame->top()->document().url(),
(...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after
3691 if (node.isContentEditable()) { 3702 if (node.isContentEditable()) {
3692 is_editable_node = true; 3703 is_editable_node = true;
3693 } else if (node.isElementNode()) { 3704 } else if (node.isElementNode()) {
3694 is_editable_node = 3705 is_editable_node =
3695 node.toConst<WebElement>().isTextFormControlElement(); 3706 node.toConst<WebElement>().isTextFormControlElement();
3696 } 3707 }
3697 } 3708 }
3698 return is_editable_node; 3709 return is_editable_node;
3699 } 3710 }
3700 3711
3712 void RenderViewImpl::GuestReady(PP_Instance instance) {
3713 guest_pp_instance_ = instance;
3714 if (guest_uninitialized_context_) {
3715 bool success = guest_to_embedder_channel()->CreateGraphicsContext(
3716 guest_uninitialized_context_,
3717 guest_attributes_,
3718 false,
3719 this);
3720 DCHECK(success);
3721 }
3722 CompleteInit(host_window_);
3723 }
3724
3725 webkit::ppapi::WebPluginImpl* RenderViewImpl::CreateBrowserPlugin(
3726 const IPC::ChannelHandle& channel_handle,
3727 int guest_process_id,
3728 const WebKit::WebPluginParams& params) {
3729 scoped_refptr<webkit::ppapi::PluginModule> pepper_module(
3730 pepper_delegate_.CreateBrowserPluginModule(channel_handle,
3731 guest_process_id));
3732 return new webkit::ppapi::WebPluginImpl(
3733 pepper_module.get(), params, pepper_delegate_.AsWeakPtr());
3734 }
3735
3701 WebKit::WebPlugin* RenderViewImpl::CreatePlugin( 3736 WebKit::WebPlugin* RenderViewImpl::CreatePlugin(
3702 WebKit::WebFrame* frame, 3737 WebKit::WebFrame* frame,
3703 const webkit::WebPluginInfo& info, 3738 const webkit::WebPluginInfo& info,
3704 const WebKit::WebPluginParams& params) { 3739 const WebKit::WebPluginParams& params) {
3705 bool pepper_plugin_was_registered = false; 3740 bool pepper_plugin_was_registered = false;
3706 scoped_refptr<webkit::ppapi::PluginModule> pepper_module( 3741 scoped_refptr<webkit::ppapi::PluginModule> pepper_module(
3707 pepper_delegate_.CreatePepperPluginModule(info, 3742 pepper_delegate_.CreatePepperPluginModule(info,
3708 &pepper_plugin_was_registered)); 3743 &pepper_plugin_was_registered));
3709 if (pepper_plugin_was_registered) { 3744 if (pepper_plugin_was_registered) {
3710 if (!pepper_module) 3745 if (!pepper_module)
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after
4784 } 4819 }
4785 4820
4786 void RenderViewImpl::WillInitiatePaint() { 4821 void RenderViewImpl::WillInitiatePaint() {
4787 // Notify the pepper plugins that we're about to paint. 4822 // Notify the pepper plugins that we're about to paint.
4788 pepper_delegate_.ViewWillInitiatePaint(); 4823 pepper_delegate_.ViewWillInitiatePaint();
4789 } 4824 }
4790 4825
4791 void RenderViewImpl::DidInitiatePaint() { 4826 void RenderViewImpl::DidInitiatePaint() {
4792 // Notify the pepper plugins that we've painted, and are waiting to flush. 4827 // Notify the pepper plugins that we've painted, and are waiting to flush.
4793 pepper_delegate_.ViewInitiatedPaint(); 4828 pepper_delegate_.ViewInitiatedPaint();
4829 if (guest_to_embedder_channel())
4830 guest_to_embedder_channel()->IssueSwapBuffers(guest_graphics_resource());
4794 } 4831 }
4795 4832
4796 void RenderViewImpl::DidFlushPaint() { 4833 void RenderViewImpl::DidFlushPaint() {
4797 // Notify any pepper plugins that we painted. This will call into the plugin, 4834 // Notify any pepper plugins that we painted. This will call into the plugin,
4798 // and we it may ask to close itself as a result. This will, in turn, modify 4835 // and we it may ask to close itself as a result. This will, in turn, modify
4799 // our set, possibly invalidating the iterator. So we iterate on a copy that 4836 // our set, possibly invalidating the iterator. So we iterate on a copy that
4800 // won't change out from under us. 4837 // won't change out from under us.
4801 pepper_delegate_.ViewFlushedPaint(); 4838 pepper_delegate_.ViewFlushedPaint();
4802 4839
4803 // If the RenderWidget is closing down then early-exit, otherwise we'll crash. 4840 // If the RenderWidget is closing down then early-exit, otherwise we'll crash.
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
5435 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 5472 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
5436 return !!RenderThreadImpl::current()->compositor_thread(); 5473 return !!RenderThreadImpl::current()->compositor_thread();
5437 } 5474 }
5438 5475
5439 void RenderViewImpl::OnJavaBridgeInit() { 5476 void RenderViewImpl::OnJavaBridgeInit() {
5440 DCHECK(!java_bridge_dispatcher_); 5477 DCHECK(!java_bridge_dispatcher_);
5441 #if defined(ENABLE_JAVA_BRIDGE) 5478 #if defined(ENABLE_JAVA_BRIDGE)
5442 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); 5479 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this);
5443 #endif 5480 #endif
5444 } 5481 }
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/test/render_view_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698