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

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

Issue 2310563002: Adds routed interface support between RenderFrameHost and RenderFrame (Closed)
Patch Set: Created 4 years, 3 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
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 #ifndef CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ 5 #ifndef CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ 6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 10 matching lines...) Expand all
21 #include "base/memory/weak_ptr.h" 21 #include "base/memory/weak_ptr.h"
22 #include "base/observer_list.h" 22 #include "base/observer_list.h"
23 #include "base/process/process_handle.h" 23 #include "base/process/process_handle.h"
24 #include "build/build_config.h" 24 #include "build/build_config.h"
25 #include "content/common/accessibility_mode_enums.h" 25 #include "content/common/accessibility_mode_enums.h"
26 #include "content/common/frame.mojom.h" 26 #include "content/common/frame.mojom.h"
27 #include "content/common/frame_message_enums.h" 27 #include "content/common/frame_message_enums.h"
28 #include "content/public/common/console_message_level.h" 28 #include "content/public/common/console_message_level.h"
29 #include "content/public/common/javascript_message_type.h" 29 #include "content/public/common/javascript_message_type.h"
30 #include "content/public/common/referrer.h" 30 #include "content/public/common/referrer.h"
31 #include "content/public/common/routed_interface.mojom.h"
31 #include "content/public/common/stop_find_action.h" 32 #include "content/public/common/stop_find_action.h"
32 #include "content/public/renderer/render_frame.h" 33 #include "content/public/renderer/render_frame.h"
33 #include "content/renderer/frame_blame_context.h" 34 #include "content/renderer/frame_blame_context.h"
34 #include "content/renderer/mojo/blink_interface_provider_impl.h" 35 #include "content/renderer/mojo/blink_interface_provider_impl.h"
35 #include "content/renderer/renderer_webcookiejar_impl.h" 36 #include "content/renderer/renderer_webcookiejar_impl.h"
36 #include "ipc/ipc_message.h" 37 #include "ipc/ipc_message.h"
37 #include "ipc/ipc_platform_file.h" 38 #include "ipc/ipc_platform_file.h"
38 #include "media/blink/webmediaplayer_delegate.h" 39 #include "media/blink/webmediaplayer_delegate.h"
39 #include "media/blink/webmediaplayer_params.h" 40 #include "media/blink/webmediaplayer_params.h"
40 #include "mojo/public/cpp/bindings/binding.h" 41 #include "mojo/public/cpp/bindings/binding.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 struct NavigationParams; 161 struct NavigationParams;
161 struct RequestNavigationParams; 162 struct RequestNavigationParams;
162 struct ResourceResponseHead; 163 struct ResourceResponseHead;
163 struct StartNavigationParams; 164 struct StartNavigationParams;
164 struct StreamOverrideParameters; 165 struct StreamOverrideParameters;
165 166
166 class CONTENT_EXPORT RenderFrameImpl 167 class CONTENT_EXPORT RenderFrameImpl
167 : public RenderFrame, 168 : public RenderFrame,
168 NON_EXPORTED_BASE(mojom::Frame), 169 NON_EXPORTED_BASE(mojom::Frame),
169 NON_EXPORTED_BASE(public blink::WebFrameClient), 170 NON_EXPORTED_BASE(public blink::WebFrameClient),
170 NON_EXPORTED_BASE(public blink::WebFrameSerializerClient) { 171 NON_EXPORTED_BASE(public blink::WebFrameSerializerClient),
172 NON_EXPORTED_BASE(public mojom::RoutedInterfaceProvider) {
171 public: 173 public:
172 // Creates a new RenderFrame as the main frame of |render_view|. 174 // Creates a new RenderFrame as the main frame of |render_view|.
173 static RenderFrameImpl* CreateMainFrame( 175 static RenderFrameImpl* CreateMainFrame(
174 RenderViewImpl* render_view, 176 RenderViewImpl* render_view,
175 int32_t routing_id, 177 int32_t routing_id,
176 int32_t widget_routing_id, 178 int32_t widget_routing_id,
177 bool hidden, 179 bool hidden,
178 const blink::WebScreenInfo& screen_info, 180 const blink::WebScreenInfo& screen_info,
179 CompositorDependencies* compositor_deps, 181 CompositorDependencies* compositor_deps,
180 blink::WebFrame* opener); 182 blink::WebFrame* opener);
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 const WebPluginInfo& info, 401 const WebPluginInfo& info,
400 const blink::WebPluginParams& params, 402 const blink::WebPluginParams& params,
401 std::unique_ptr<PluginInstanceThrottler> throttler) override; 403 std::unique_ptr<PluginInstanceThrottler> throttler) override;
402 void LoadURLExternally(const blink::WebURLRequest& request, 404 void LoadURLExternally(const blink::WebURLRequest& request,
403 blink::WebNavigationPolicy policy) override; 405 blink::WebNavigationPolicy policy) override;
404 void ExecuteJavaScript(const base::string16& javascript) override; 406 void ExecuteJavaScript(const base::string16& javascript) override;
405 bool IsMainFrame() override; 407 bool IsMainFrame() override;
406 bool IsHidden() override; 408 bool IsHidden() override;
407 shell::InterfaceRegistry* GetInterfaceRegistry() override; 409 shell::InterfaceRegistry* GetInterfaceRegistry() override;
408 shell::InterfaceProvider* GetRemoteInterfaces() override; 410 shell::InterfaceProvider* GetRemoteInterfaces() override;
411 void AddRoutedInterface(
412 const base::StringPiece& name,
413 const GenericRoutedInterfaceFactory& factory) override;
414 void RemoveRoutedInterface(const base::StringPiece& name) override;
415 void GetRemoteRoutedInterface(
416 const base::StringPiece& name,
417 mojo::ScopedInterfaceEndpointHandle handle) override;
409 #if defined(ENABLE_PLUGINS) 418 #if defined(ENABLE_PLUGINS)
410 void RegisterPeripheralPlugin( 419 void RegisterPeripheralPlugin(
411 const url::Origin& content_origin, 420 const url::Origin& content_origin,
412 const base::Closure& unthrottle_callback) override; 421 const base::Closure& unthrottle_callback) override;
413 RenderFrame::PeripheralContentStatus GetPeripheralContentStatus( 422 RenderFrame::PeripheralContentStatus GetPeripheralContentStatus(
414 const url::Origin& main_frame_origin, 423 const url::Origin& main_frame_origin,
415 const url::Origin& content_origin, 424 const url::Origin& content_origin,
416 const gfx::Size& unobscured_size, 425 const gfx::Size& unobscured_size,
417 RecordPeripheralDecision record_decision) const override; 426 RecordPeripheralDecision record_decision) const override;
418 void WhitelistContentOrigin(const url::Origin& content_origin) override; 427 void WhitelistContentOrigin(const url::Origin& content_origin) override;
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 1016
1008 #if defined(ENABLE_MOJO_MEDIA) 1017 #if defined(ENABLE_MOJO_MEDIA)
1009 shell::mojom::InterfaceProvider* GetMediaInterfaceProvider(); 1018 shell::mojom::InterfaceProvider* GetMediaInterfaceProvider();
1010 #endif 1019 #endif
1011 1020
1012 media::CdmFactory* GetCdmFactory(); 1021 media::CdmFactory* GetCdmFactory();
1013 media::DecoderFactory* GetDecoderFactory(); 1022 media::DecoderFactory* GetDecoderFactory();
1014 1023
1015 void RegisterMojoInterfaces(); 1024 void RegisterMojoInterfaces();
1016 1025
1026 mojom::RoutedInterfaceProvider* GetRemoteRoutedInterfaces();
1027
1017 // Connect to an interface provided by the service registry. 1028 // Connect to an interface provided by the service registry.
1018 template <typename Interface> 1029 template <typename Interface>
1019 void GetInterface(mojo::InterfaceRequest<Interface> request); 1030 void GetInterface(mojo::InterfaceRequest<Interface> request);
1020 1031
1021 // Returns the media delegate for WebMediaPlayer usage. If 1032 // Returns the media delegate for WebMediaPlayer usage. If
1022 // |media_player_delegate_| is NULL, one is created. 1033 // |media_player_delegate_| is NULL, one is created.
1023 media::RendererWebMediaPlayerDelegate* GetWebMediaPlayerDelegate(); 1034 media::RendererWebMediaPlayerDelegate* GetWebMediaPlayerDelegate();
1024 1035
1025 // Called to get the WebPlugin to handle find requests in the document. 1036 // Called to get the WebPlugin to handle find requests in the document.
1026 // Returns nullptr if there is no such WebPlugin. 1037 // Returns nullptr if there is no such WebPlugin.
1027 blink::WebPlugin* GetWebPluginForFind(); 1038 blink::WebPlugin* GetWebPluginForFind();
1028 1039
1029 // Sends a reply to the current find operation handling if it was a 1040 // Sends a reply to the current find operation handling if it was a
1030 // synchronous find request. 1041 // synchronous find request.
1031 void SendFindReply(int request_id, 1042 void SendFindReply(int request_id,
1032 int match_count, 1043 int match_count,
1033 int ordinal, 1044 int ordinal,
1034 const blink::WebRect& selection_rect, 1045 const blink::WebRect& selection_rect,
1035 bool final_status_update); 1046 bool final_status_update);
1036 1047
1037 void InitializeBlameContext(RenderFrameImpl* parent_frame); 1048 void InitializeBlameContext(RenderFrameImpl* parent_frame);
1038 1049
1050 // mojom::RoutedInterfaceProvider:
1051 void GetRoutedInterface(
1052 const std::string& name,
1053 mojom::RoutedInterfaceAssociatedRequest request) override;
1054
1039 // Stores the WebLocalFrame we are associated with. This is null from the 1055 // Stores the WebLocalFrame we are associated with. This is null from the
1040 // constructor until BindToWebFrame is called, and it is null after 1056 // constructor until BindToWebFrame is called, and it is null after
1041 // frameDetached is called until destruction (which is asynchronous in the 1057 // frameDetached is called until destruction (which is asynchronous in the
1042 // case of the main frame, but not subframes). 1058 // case of the main frame, but not subframes).
1043 blink::WebLocalFrame* frame_; 1059 blink::WebLocalFrame* frame_;
1044 1060
1045 // Boolean value indicating whether this RenderFrameImpl object is for the 1061 // Boolean value indicating whether this RenderFrameImpl object is for the
1046 // main frame or not. It remains accurate during destruction, even when 1062 // main frame or not. It remains accurate during destruction, even when
1047 // |frame_| has been invalidated. 1063 // |frame_| has been invalidated.
1048 bool is_main_frame_; 1064 bool is_main_frame_;
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 // the RenderFrameImpl to NULL it out when it destructs. 1284 // the RenderFrameImpl to NULL it out when it destructs.
1269 PepperPluginInstanceImpl* pepper_last_mouse_event_target_; 1285 PepperPluginInstanceImpl* pepper_last_mouse_event_target_;
1270 #endif 1286 #endif
1271 1287
1272 mojo::Binding<mojom::Frame> frame_binding_; 1288 mojo::Binding<mojom::Frame> frame_binding_;
1273 mojom::FrameHostPtr frame_host_; 1289 mojom::FrameHostPtr frame_host_;
1274 1290
1275 // Indicates whether |didAccessInitialDocument| was called. 1291 // Indicates whether |didAccessInitialDocument| was called.
1276 bool has_accessed_initial_document_; 1292 bool has_accessed_initial_document_;
1277 1293
1294 std::map<std::string, GenericRoutedInterfaceFactory> routed_interfaces_;
1295 mojom::RoutedInterfaceProviderAssociatedPtr remote_routed_interfaces_;
1296
1278 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; 1297 base::WeakPtrFactory<RenderFrameImpl> weak_factory_;
1279 1298
1280 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); 1299 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl);
1281 }; 1300 };
1282 1301
1283 } // namespace content 1302 } // namespace content
1284 1303
1285 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ 1304 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698