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