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

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

Issue 2456493003: Add frame-specific InterfaceProviderSpec. (Closed)
Patch Set: . Created 4 years, 1 month 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
OLDNEW
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 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 #include "content/public/common/content_constants.h" 71 #include "content/public/common/content_constants.h"
72 #include "content/public/common/content_features.h" 72 #include "content/public/common/content_features.h"
73 #include "content/public/common/content_switches.h" 73 #include "content/public/common/content_switches.h"
74 #include "content/public/common/context_menu_params.h" 74 #include "content/public/common/context_menu_params.h"
75 #include "content/public/common/file_chooser_file_info.h" 75 #include "content/public/common/file_chooser_file_info.h"
76 #include "content/public/common/file_chooser_params.h" 76 #include "content/public/common/file_chooser_params.h"
77 #include "content/public/common/isolated_world_ids.h" 77 #include "content/public/common/isolated_world_ids.h"
78 #include "content/public/common/page_state.h" 78 #include "content/public/common/page_state.h"
79 #include "content/public/common/resource_response.h" 79 #include "content/public/common/resource_response.h"
80 #include "content/public/common/service_manager_connection.h" 80 #include "content/public/common/service_manager_connection.h"
81 #include "content/public/common/service_names.h"
81 #include "content/public/common/url_constants.h" 82 #include "content/public/common/url_constants.h"
82 #include "content/public/common/url_utils.h" 83 #include "content/public/common/url_utils.h"
83 #include "content/public/renderer/browser_plugin_delegate.h" 84 #include "content/public/renderer/browser_plugin_delegate.h"
84 #include "content/public/renderer/content_renderer_client.h" 85 #include "content/public/renderer/content_renderer_client.h"
85 #include "content/public/renderer/context_menu_client.h" 86 #include "content/public/renderer/context_menu_client.h"
86 #include "content/public/renderer/document_state.h" 87 #include "content/public/renderer/document_state.h"
87 #include "content/public/renderer/navigation_state.h" 88 #include "content/public/renderer/navigation_state.h"
88 #include "content/public/renderer/render_frame_observer.h" 89 #include "content/public/renderer/render_frame_observer.h"
89 #include "content/public/renderer/renderer_ppapi_host.h" 90 #include "content/public/renderer/renderer_ppapi_host.h"
90 #include "content/renderer/accessibility/render_accessibility_impl.h" 91 #include "content/renderer/accessibility/render_accessibility_impl.h"
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 focused_pepper_plugin_(nullptr), 1116 focused_pepper_plugin_(nullptr),
1116 pepper_last_mouse_event_target_(nullptr), 1117 pepper_last_mouse_event_target_(nullptr),
1117 #endif 1118 #endif
1118 frame_binding_(this), 1119 frame_binding_(this),
1119 has_accessed_initial_document_(false), 1120 has_accessed_initial_document_(false),
1120 weak_factory_(this) { 1121 weak_factory_(this) {
1121 // We don't have a service_manager::Connection at this point, so use empty 1122 // We don't have a service_manager::Connection at this point, so use empty
1122 // identity/specs. 1123 // identity/specs.
1123 // TODO(beng): We should fix this, so we can apply policy about which 1124 // TODO(beng): We should fix this, so we can apply policy about which
1124 // interfaces get exposed. 1125 // interfaces get exposed.
1125 interface_registry_ = base::MakeUnique<service_manager::InterfaceRegistry>( 1126 interface_registry_ = base::MakeUnique<service_manager::InterfaceRegistry>();
1126 service_manager::Identity(), service_manager::InterfaceProviderSpec());
1127 service_manager::mojom::InterfaceProviderPtr remote_interfaces; 1127 service_manager::mojom::InterfaceProviderPtr remote_interfaces;
1128 pending_remote_interface_provider_request_ = GetProxy(&remote_interfaces); 1128 pending_remote_interface_provider_request_ = GetProxy(&remote_interfaces);
1129 remote_interfaces_.reset(new service_manager::InterfaceProvider); 1129 remote_interfaces_.reset(new service_manager::InterfaceProvider);
1130 remote_interfaces_->Bind(std::move(remote_interfaces)); 1130 remote_interfaces_->Bind(std::move(remote_interfaces));
1131 blink_interface_provider_.reset(new BlinkInterfaceProviderImpl( 1131 blink_interface_provider_.reset(new BlinkInterfaceProviderImpl(
1132 remote_interfaces_->GetWeakPtr())); 1132 remote_interfaces_->GetWeakPtr()));
1133 blink_interface_registry_.reset( 1133 blink_interface_registry_.reset(
1134 new BlinkInterfaceRegistryImpl(interface_registry_->GetWeakPtr())); 1134 new BlinkInterfaceRegistryImpl(interface_registry_->GetWeakPtr()));
1135 1135
1136 std::pair<RoutingIDFrameMap::iterator, bool> result = 1136 std::pair<RoutingIDFrameMap::iterator, bool> result =
(...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after
2625 } 2625 }
2626 2626
2627 bool RenderFrameImpl::IsPasting() const { 2627 bool RenderFrameImpl::IsPasting() const {
2628 return is_pasting_; 2628 return is_pasting_;
2629 } 2629 }
2630 2630
2631 // mojom::Frame implementation ------------------------------------------------- 2631 // mojom::Frame implementation -------------------------------------------------
2632 2632
2633 void RenderFrameImpl::GetInterfaceProvider( 2633 void RenderFrameImpl::GetInterfaceProvider(
2634 service_manager::mojom::InterfaceProviderRequest request) { 2634 service_manager::mojom::InterfaceProviderRequest request) {
2635 interface_registry_->Bind(std::move(request), 2635 service_manager::ServiceInfo child_info =
2636 service_manager::Identity(), 2636 ChildThreadImpl::current()->GetChildServiceInfo();
2637 service_manager::InterfaceProviderSpec()); 2637 service_manager::ServiceInfo browser_info =
2638 ChildThreadImpl::current()->GetBrowserServiceInfo();
2639
2640 service_manager::InterfaceProviderSpec child_spec, browser_spec;
2641 // TODO(beng): CHECK these return true.
2642 service_manager::GetInterfaceProviderSpec(
2643 mojom::kNavigation_FrameSpec, child_info.interface_provider_specs,
2644 &child_spec);
2645 service_manager::GetInterfaceProviderSpec(
2646 mojom::kNavigation_FrameSpec, browser_info.interface_provider_specs,
2647 &browser_spec);
2648 interface_registry_->Bind(std::move(request), child_info.identity, child_spec,
2649 browser_info.identity, browser_spec);
2638 } 2650 }
2639 2651
2640 // blink::WebFrameClient implementation ---------------------------------------- 2652 // blink::WebFrameClient implementation ----------------------------------------
2641 2653
2642 blink::WebPlugin* RenderFrameImpl::createPlugin( 2654 blink::WebPlugin* RenderFrameImpl::createPlugin(
2643 blink::WebLocalFrame* frame, 2655 blink::WebLocalFrame* frame,
2644 const blink::WebPluginParams& params) { 2656 const blink::WebPluginParams& params) {
2645 DCHECK_EQ(frame_, frame); 2657 DCHECK_EQ(frame_, frame);
2646 blink::WebPlugin* plugin = NULL; 2658 blink::WebPlugin* plugin = NULL;
2647 if (GetContentClient()->renderer()->OverrideCreatePlugin( 2659 if (GetContentClient()->renderer()->OverrideCreatePlugin(
(...skipping 3935 matching lines...) Expand 10 before | Expand all | Expand 10 after
6583 // event target. Potentially a Pepper plugin will receive the event. 6595 // event target. Potentially a Pepper plugin will receive the event.
6584 // In order to tell whether a plugin gets the last mouse event and which it 6596 // In order to tell whether a plugin gets the last mouse event and which it
6585 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6597 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6586 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6598 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6587 // |pepper_last_mouse_event_target_|. 6599 // |pepper_last_mouse_event_target_|.
6588 pepper_last_mouse_event_target_ = nullptr; 6600 pepper_last_mouse_event_target_ = nullptr;
6589 #endif 6601 #endif
6590 } 6602 }
6591 6603
6592 } // namespace content 6604 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698