| OLD | NEW |
| 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_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "content/common/accessibility_mode_enums.h" | 29 #include "content/common/accessibility_mode_enums.h" |
| 30 #include "content/common/ax_content_node_data.h" | 30 #include "content/common/ax_content_node_data.h" |
| 31 #include "content/common/content_export.h" | 31 #include "content/common/content_export.h" |
| 32 #include "content/common/frame.mojom.h" | 32 #include "content/common/frame.mojom.h" |
| 33 #include "content/common/frame_message_enums.h" | 33 #include "content/common/frame_message_enums.h" |
| 34 #include "content/common/frame_replication_state.h" | 34 #include "content/common/frame_replication_state.h" |
| 35 #include "content/common/image_downloader/image_downloader.mojom.h" | 35 #include "content/common/image_downloader/image_downloader.mojom.h" |
| 36 #include "content/common/navigation_params.h" | 36 #include "content/common/navigation_params.h" |
| 37 #include "content/public/browser/render_frame_host.h" | 37 #include "content/public/browser/render_frame_host.h" |
| 38 #include "content/public/common/javascript_message_type.h" | 38 #include "content/public/common/javascript_message_type.h" |
| 39 #include "content/public/common/routed_interface.mojom.h" |
| 39 #include "media/mojo/interfaces/service_factory.mojom.h" | 40 #include "media/mojo/interfaces/service_factory.mojom.h" |
| 40 #include "net/http/http_response_headers.h" | 41 #include "net/http/http_response_headers.h" |
| 41 #include "services/shell/public/cpp/interface_factory.h" | 42 #include "services/shell/public/cpp/interface_factory.h" |
| 42 #include "services/shell/public/cpp/interface_registry.h" | 43 #include "services/shell/public/cpp/interface_registry.h" |
| 43 #include "third_party/WebKit/public/platform/WebInsecureRequestPolicy.h" | 44 #include "third_party/WebKit/public/platform/WebInsecureRequestPolicy.h" |
| 44 #include "third_party/WebKit/public/web/WebTextDirection.h" | 45 #include "third_party/WebKit/public/web/WebTextDirection.h" |
| 45 #include "third_party/WebKit/public/web/WebTreeScopeType.h" | 46 #include "third_party/WebKit/public/web/WebTreeScopeType.h" |
| 46 #include "ui/accessibility/ax_node_data.h" | 47 #include "ui/accessibility/ax_node_data.h" |
| 47 #include "ui/base/page_transition_types.h" | 48 #include "ui/base/page_transition_types.h" |
| 48 | 49 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 struct FileChooserParams; | 101 struct FileChooserParams; |
| 101 struct Referrer; | 102 struct Referrer; |
| 102 struct ResourceResponse; | 103 struct ResourceResponse; |
| 103 | 104 |
| 104 class CONTENT_EXPORT RenderFrameHostImpl | 105 class CONTENT_EXPORT RenderFrameHostImpl |
| 105 : public RenderFrameHost, | 106 : public RenderFrameHost, |
| 106 NON_EXPORTED_BASE(public mojom::FrameHost), | 107 NON_EXPORTED_BASE(public mojom::FrameHost), |
| 107 public BrowserAccessibilityDelegate, | 108 public BrowserAccessibilityDelegate, |
| 108 public SiteInstanceImpl::Observer, | 109 public SiteInstanceImpl::Observer, |
| 109 public NON_EXPORTED_BASE( | 110 public NON_EXPORTED_BASE( |
| 110 shell::InterfaceFactory<media::mojom::ServiceFactory>) { | 111 shell::InterfaceFactory<media::mojom::ServiceFactory>), |
| 112 public NON_EXPORTED_BASE(mojom::RoutedInterfaceProvider) { |
| 111 public: | 113 public: |
| 112 using AXTreeSnapshotCallback = | 114 using AXTreeSnapshotCallback = |
| 113 base::Callback<void( | 115 base::Callback<void( |
| 114 const ui::AXTreeUpdate&)>; | 116 const ui::AXTreeUpdate&)>; |
| 115 | 117 |
| 116 // An accessibility reset is only allowed to prevent very rare corner cases | 118 // An accessibility reset is only allowed to prevent very rare corner cases |
| 117 // or race conditions where the browser and renderer get out of sync. If | 119 // or race conditions where the browser and renderer get out of sync. If |
| 118 // this happens more than this many times, kill the renderer. | 120 // this happens more than this many times, kill the renderer. |
| 119 static const int kMaxAccessibilityResets = 5; | 121 static const int kMaxAccessibilityResets = 5; |
| 120 | 122 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 const JavaScriptResultCallback& callback) override; | 154 const JavaScriptResultCallback& callback) override; |
| 153 void ExecuteJavaScriptWithUserGestureForTests( | 155 void ExecuteJavaScriptWithUserGestureForTests( |
| 154 const base::string16& javascript) override; | 156 const base::string16& javascript) override; |
| 155 void ActivateFindInPageResultForAccessibility(int request_id) override; | 157 void ActivateFindInPageResultForAccessibility(int request_id) override; |
| 156 void InsertVisualStateCallback(const VisualStateCallback& callback) override; | 158 void InsertVisualStateCallback(const VisualStateCallback& callback) override; |
| 157 void CopyImageAt(int x, int y) override; | 159 void CopyImageAt(int x, int y) override; |
| 158 void SaveImageAt(int x, int y) override; | 160 void SaveImageAt(int x, int y) override; |
| 159 RenderViewHost* GetRenderViewHost() override; | 161 RenderViewHost* GetRenderViewHost() override; |
| 160 shell::InterfaceRegistry* GetInterfaceRegistry() override; | 162 shell::InterfaceRegistry* GetInterfaceRegistry() override; |
| 161 shell::InterfaceProvider* GetRemoteInterfaces() override; | 163 shell::InterfaceProvider* GetRemoteInterfaces() override; |
| 164 void AddRoutedInterface(const base::StringPiece& name, |
| 165 const RoutedInterfaceFactory& factory) override; |
| 166 void RemoveRoutedInterface(const base::StringPiece& name) override; |
| 167 void GetRemoteRoutedInterface( |
| 168 const base::StringPiece& name, |
| 169 mojo::ScopedInterfaceEndpointHandle handle) override; |
| 162 blink::WebPageVisibilityState GetVisibilityState() override; | 170 blink::WebPageVisibilityState GetVisibilityState() override; |
| 163 bool IsRenderFrameLive() override; | 171 bool IsRenderFrameLive() override; |
| 164 int GetProxyCount() override; | 172 int GetProxyCount() override; |
| 165 void FilesSelectedInChooser(const std::vector<FileChooserFileInfo>& files, | 173 void FilesSelectedInChooser(const std::vector<FileChooserFileInfo>& files, |
| 166 FileChooserParams::Mode permissions) override; | 174 FileChooserParams::Mode permissions) override; |
| 167 void RequestTextSurroundingSelection( | 175 void RequestTextSurroundingSelection( |
| 168 const TextSurroundingSelectionCallback& callback, | 176 const TextSurroundingSelectionCallback& callback, |
| 169 int max_length) override; | 177 int max_length) override; |
| 170 | 178 |
| 171 // mojom::FrameHost | 179 // mojom::FrameHost |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 WebBluetoothServiceImpl* CreateWebBluetoothService( | 828 WebBluetoothServiceImpl* CreateWebBluetoothService( |
| 821 mojo::InterfaceRequest<blink::mojom::WebBluetoothService> request); | 829 mojo::InterfaceRequest<blink::mojom::WebBluetoothService> request); |
| 822 | 830 |
| 823 // Deletes the Web Bluetooth Service owned by the frame. | 831 // Deletes the Web Bluetooth Service owned by the frame. |
| 824 void DeleteWebBluetoothService(); | 832 void DeleteWebBluetoothService(); |
| 825 | 833 |
| 826 // Allows tests to disable the swapout event timer to simulate bugs that | 834 // Allows tests to disable the swapout event timer to simulate bugs that |
| 827 // happen before it fires (to avoid flakiness). | 835 // happen before it fires (to avoid flakiness). |
| 828 void DisableSwapOutTimerForTesting(); | 836 void DisableSwapOutTimerForTesting(); |
| 829 | 837 |
| 838 mojom::RoutedInterfaceProvider* GetRemoteRoutedInterfaces(); |
| 839 |
| 840 // mojom::RoutedInterfaceProvider: |
| 841 void GetRoutedInterface( |
| 842 const std::string& name, |
| 843 mojom::RoutedInterfaceAssociatedRequest request) override; |
| 844 |
| 830 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a | 845 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a |
| 831 // refcount that calls Shutdown when it reaches zero. This allows each | 846 // refcount that calls Shutdown when it reaches zero. This allows each |
| 832 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring | 847 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring |
| 833 // we have a RenderViewHost for each RenderFrameHost. | 848 // we have a RenderViewHost for each RenderFrameHost. |
| 834 // TODO(creis): RenderViewHost will eventually go away and be replaced with | 849 // TODO(creis): RenderViewHost will eventually go away and be replaced with |
| 835 // some form of page context. | 850 // some form of page context. |
| 836 RenderViewHostImpl* render_view_host_; | 851 RenderViewHostImpl* render_view_host_; |
| 837 | 852 |
| 838 RenderFrameHostDelegate* delegate_; | 853 RenderFrameHostDelegate* delegate_; |
| 839 | 854 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1048 | 1063 |
| 1049 mojo::Binding<mojom::FrameHost> frame_host_binding_; | 1064 mojo::Binding<mojom::FrameHost> frame_host_binding_; |
| 1050 mojom::FramePtr frame_; | 1065 mojom::FramePtr frame_; |
| 1051 | 1066 |
| 1052 // Callback for responding when | 1067 // Callback for responding when |
| 1053 // |FrameHostMsg_TextSurroundingSelectionResponse| message comes. | 1068 // |FrameHostMsg_TextSurroundingSelectionResponse| message comes. |
| 1054 TextSurroundingSelectionCallback text_surrounding_selection_callback_; | 1069 TextSurroundingSelectionCallback text_surrounding_selection_callback_; |
| 1055 | 1070 |
| 1056 std::vector<std::unique_ptr<shell::InterfaceRegistry>> media_registries_; | 1071 std::vector<std::unique_ptr<shell::InterfaceRegistry>> media_registries_; |
| 1057 | 1072 |
| 1073 std::map<std::string, RoutedInterfaceFactory> routed_interfaces_; |
| 1074 mojom::RoutedInterfaceProviderAssociatedPtr remote_routed_interfaces_; |
| 1075 |
| 1058 // NOTE: This must be the last member. | 1076 // NOTE: This must be the last member. |
| 1059 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 1077 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
| 1060 | 1078 |
| 1061 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 1079 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
| 1062 }; | 1080 }; |
| 1063 | 1081 |
| 1064 } // namespace content | 1082 } // namespace content |
| 1065 | 1083 |
| 1066 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 1084 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| OLD | NEW |