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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.h

Issue 2020633003: Revert of Add FrameHost mojo service (patchset #23 id:490001 of https://codereview.chromium.org/196… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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_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 11 matching lines...) Expand all
22 #include "base/time/time.h" 22 #include "base/time/time.h"
23 #include "build/build_config.h" 23 #include "build/build_config.h"
24 #include "content/browser/accessibility/browser_accessibility_manager.h" 24 #include "content/browser/accessibility/browser_accessibility_manager.h"
25 #include "content/browser/bad_message.h" 25 #include "content/browser/bad_message.h"
26 #include "content/browser/loader/global_routing_id.h" 26 #include "content/browser/loader/global_routing_id.h"
27 #include "content/browser/site_instance_impl.h" 27 #include "content/browser/site_instance_impl.h"
28 #include "content/browser/webui/web_ui_impl.h" 28 #include "content/browser/webui/web_ui_impl.h"
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_host.mojom.h"
33 #include "content/common/frame_message_enums.h" 32 #include "content/common/frame_message_enums.h"
34 #include "content/common/frame_replication_state.h" 33 #include "content/common/frame_replication_state.h"
35 #include "content/common/image_downloader/image_downloader.mojom.h" 34 #include "content/common/image_downloader/image_downloader.mojom.h"
36 #include "content/common/mojo/service_registry_impl.h" 35 #include "content/common/mojo/service_registry_impl.h"
37 #include "content/common/navigation_params.h" 36 #include "content/common/navigation_params.h"
38 #include "content/public/browser/render_frame_host.h" 37 #include "content/public/browser/render_frame_host.h"
39 #include "content/public/common/javascript_message_type.h" 38 #include "content/public/common/javascript_message_type.h"
40 #include "mojo/public/cpp/bindings/binding.h"
41 #include "mojo/public/cpp/bindings/interface_request.h"
42 #include "net/http/http_response_headers.h" 39 #include "net/http/http_response_headers.h"
43 #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h" 40 #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h"
44 #include "third_party/WebKit/public/web/WebTextDirection.h" 41 #include "third_party/WebKit/public/web/WebTextDirection.h"
45 #include "third_party/WebKit/public/web/WebTreeScopeType.h" 42 #include "third_party/WebKit/public/web/WebTreeScopeType.h"
46 #include "ui/accessibility/ax_node_data.h" 43 #include "ui/accessibility/ax_node_data.h"
47 #include "ui/base/page_transition_types.h" 44 #include "ui/base/page_transition_types.h"
48 45
49 #if defined(OS_ANDROID) 46 #if defined(OS_ANDROID)
50 #include "content/public/browser/android/service_registry_android.h" 47 #include "content/public/browser/android/service_registry_android.h"
51 #endif 48 #endif
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 class ResourceRequestBody; 89 class ResourceRequestBody;
93 class StreamHandle; 90 class StreamHandle;
94 class TimeoutMonitor; 91 class TimeoutMonitor;
95 class WebBluetoothServiceImpl; 92 class WebBluetoothServiceImpl;
96 struct ContentSecurityPolicyHeader; 93 struct ContentSecurityPolicyHeader;
97 struct ContextMenuParams; 94 struct ContextMenuParams;
98 struct GlobalRequestID; 95 struct GlobalRequestID;
99 struct Referrer; 96 struct Referrer;
100 struct ResourceResponse; 97 struct ResourceResponse;
101 98
102 class CONTENT_EXPORT RenderFrameHostImpl 99 class CONTENT_EXPORT RenderFrameHostImpl : public RenderFrameHost,
103 : public RenderFrameHost, 100 public BrowserAccessibilityDelegate,
104 NON_EXPORTED_BASE(public mojom::FrameHost), 101 public SiteInstanceImpl::Observer {
105 public BrowserAccessibilityDelegate,
106 public SiteInstanceImpl::Observer {
107 public: 102 public:
108 using AXTreeSnapshotCallback = 103 using AXTreeSnapshotCallback =
109 base::Callback<void( 104 base::Callback<void(
110 const ui::AXTreeUpdate&)>; 105 const ui::AXTreeUpdate&)>;
111 106
112 // An accessibility reset is only allowed to prevent very rare corner cases 107 // An accessibility reset is only allowed to prevent very rare corner cases
113 // or race conditions where the browser and renderer get out of sync. If 108 // or race conditions where the browser and renderer get out of sync. If
114 // this happens more than this many times, kill the renderer. 109 // this happens more than this many times, kill the renderer.
115 static const int kMaxAccessibilityResets = 5; 110 static const int kMaxAccessibilityResets = 5;
116 111
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 void ExecuteJavaScriptWithUserGestureForTests( 144 void ExecuteJavaScriptWithUserGestureForTests(
150 const base::string16& javascript) override; 145 const base::string16& javascript) override;
151 void ActivateFindInPageResultForAccessibility(int request_id) override; 146 void ActivateFindInPageResultForAccessibility(int request_id) override;
152 void InsertVisualStateCallback(const VisualStateCallback& callback) override; 147 void InsertVisualStateCallback(const VisualStateCallback& callback) override;
153 RenderViewHost* GetRenderViewHost() override; 148 RenderViewHost* GetRenderViewHost() override;
154 ServiceRegistry* GetServiceRegistry() override; 149 ServiceRegistry* GetServiceRegistry() override;
155 blink::WebPageVisibilityState GetVisibilityState() override; 150 blink::WebPageVisibilityState GetVisibilityState() override;
156 bool IsRenderFrameLive() override; 151 bool IsRenderFrameLive() override;
157 int GetProxyCount() override; 152 int GetProxyCount() override;
158 153
159 // mojom::FrameHost
160 void GetHostZoomLevel(const GURL& url,
161 const GetHostZoomLevelCallback& callback) override;
162
163 // IPC::Sender 154 // IPC::Sender
164 bool Send(IPC::Message* msg) override; 155 bool Send(IPC::Message* msg) override;
165 156
166 // IPC::Listener 157 // IPC::Listener
167 bool OnMessageReceived(const IPC::Message& msg) override; 158 bool OnMessageReceived(const IPC::Message& msg) override;
168 159
169 // BrowserAccessibilityDelegate 160 // BrowserAccessibilityDelegate
170 void AccessibilitySetFocus(int acc_obj_id) override; 161 void AccessibilitySetFocus(int acc_obj_id) override;
171 void AccessibilityDoDefaultAction(int acc_obj_id) override; 162 void AccessibilityDoDefaultAction(int acc_obj_id) override;
172 void AccessibilityShowContextMenu(int acc_obj_id) override; 163 void AccessibilityShowContextMenu(int acc_obj_id) override;
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 const content::StartNavigationParams& start_params, 742 const content::StartNavigationParams& start_params,
752 const content::RequestNavigationParams& request_params); 743 const content::RequestNavigationParams& request_params);
753 744
754 // Returns the child FrameTreeNode if |child_frame_routing_id| is an 745 // Returns the child FrameTreeNode if |child_frame_routing_id| is an
755 // immediate child of this FrameTreeNode. |child_frame_routing_id| is 746 // immediate child of this FrameTreeNode. |child_frame_routing_id| is
756 // considered untrusted, so the renderer process is killed if it refers to a 747 // considered untrusted, so the renderer process is killed if it refers to a
757 // FrameTreeNode that is not a child of this node. 748 // FrameTreeNode that is not a child of this node.
758 FrameTreeNode* FindAndVerifyChild(int32_t child_frame_routing_id, 749 FrameTreeNode* FindAndVerifyChild(int32_t child_frame_routing_id,
759 bad_message::BadMessageReason reason); 750 bad_message::BadMessageReason reason);
760 751
761 void BindFrameHostService(mojom::FrameHostRequest request);
762
763 // Creates a Web Bluetooth Service owned by the frame. 752 // Creates a Web Bluetooth Service owned by the frame.
764 void CreateWebBluetoothService( 753 void CreateWebBluetoothService(
765 mojo::InterfaceRequest<blink::mojom::WebBluetoothService> request); 754 mojo::InterfaceRequest<blink::mojom::WebBluetoothService> request);
766 755
767 // Deletes the Web Bluetooth Service owned by the frame. 756 // Deletes the Web Bluetooth Service owned by the frame.
768 void DeleteWebBluetoothService(); 757 void DeleteWebBluetoothService();
769 758
770 // Allows tests to disable the swapout event timer to simulate bugs that 759 // Allows tests to disable the swapout event timer to simulate bugs that
771 // happen before it fires (to avoid flakiness). 760 // happen before it fires (to avoid flakiness).
772 void DisableSwapOutTimerForTesting(); 761 void DisableSwapOutTimerForTesting();
773 762
774 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a 763 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a
775 // refcount that calls Shutdown when it reaches zero. This allows each 764 // refcount that calls Shutdown when it reaches zero. This allows each
776 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring 765 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring
777 // we have a RenderViewHost for each RenderFrameHost. 766 // we have a RenderViewHost for each RenderFrameHost.
778 // TODO(creis): RenderViewHost will eventually go away and be replaced with 767 // TODO(creis): RenderViewHost will eventually go away and be replaced with
779 // some form of page context. 768 // some form of page context.
780 RenderViewHostImpl* render_view_host_; 769 RenderViewHostImpl* render_view_host_;
781 770
782 RenderFrameHostDelegate* delegate_; 771 RenderFrameHostDelegate* delegate_;
783 772
784 mojo::Binding<mojom::FrameHost> frame_host_binding_;
785
786 // The SiteInstance associated with this RenderFrameHost. All content drawn 773 // The SiteInstance associated with this RenderFrameHost. All content drawn
787 // in this RenderFrameHost is part of this SiteInstance. Cannot change over 774 // in this RenderFrameHost is part of this SiteInstance. Cannot change over
788 // time. 775 // time.
789 scoped_refptr<SiteInstanceImpl> site_instance_; 776 scoped_refptr<SiteInstanceImpl> site_instance_;
790 777
791 // The renderer process this RenderFrameHost is associated with. It is 778 // The renderer process this RenderFrameHost is associated with. It is
792 // equivalent to the result of site_instance_->GetProcess(), but that 779 // equivalent to the result of site_instance_->GetProcess(), but that
793 // method has the side effect of creating the process if it doesn't exist. 780 // method has the side effect of creating the process if it doesn't exist.
794 // Cache a pointer to avoid unnecessary process creation. 781 // Cache a pointer to avoid unnecessary process creation.
795 RenderProcessHost* process_; 782 RenderProcessHost* process_;
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 977
991 // NOTE: This must be the last member. 978 // NOTE: This must be the last member.
992 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; 979 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_;
993 980
994 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); 981 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl);
995 }; 982 };
996 983
997 } // namespace content 984 } // namespace content
998 985
999 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 986 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « build/android/pylib/gtest/filter/content_browsertests_disabled ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698