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
3 // found in the LICENSE file.
4 
5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_
6 #define CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_
7 
8 #include <string>
9 #include <vector>
10 
11 #include "base/callback_forward.h"
12 #include "base/containers/flat_set.h"
13 #include "base/feature_list.h"
14 #include "base/optional.h"
15 #include "build/build_config.h"
16 #include "content/common/content_export.h"
17 #include "content/public/browser/global_routing_id.h"
18 #include "content/public/common/browser_controls_state.h"
19 #include "content/public/common/isolated_world_ids.h"
20 #include "content/public/common/page_visibility_state.h"
21 #include "ipc/ipc_listener.h"
22 #include "ipc/ipc_sender.h"
23 #include "mojo/public/cpp/bindings/pending_receiver.h"
24 #include "mojo/public/cpp/bindings/remote.h"
25 #include "services/network/public/mojom/url_loader_factory.mojom-forward.h"
26 #include "third_party/blink/public/common/feature_policy/document_policy.h"
27 #include "third_party/blink/public/common/feature_policy/feature_policy.h"
28 #include "third_party/blink/public/common/frame/frame_owner_element_type.h"
29 #include "third_party/blink/public/common/frame/sandbox_flags.h"
30 #include "third_party/blink/public/common/scheduler/web_scheduler_tracked_feature.h"
31 #include "third_party/blink/public/mojom/ad_tagging/ad_frame.mojom-forward.h"
32 #include "third_party/blink/public/mojom/devtools/console_message.mojom.h"
33 #include "third_party/blink/public/mojom/frame/frame.mojom.h"
34 #include "third_party/blink/public/mojom/frame/sudden_termination_disabler_type.mojom.h"
35 #include "third_party/blink/public/mojom/loader/pause_subresource_loading_handle.mojom-forward.h"
36 #include "third_party/blink/public/mojom/webauthn/authenticator.mojom.h"
37 #include "ui/accessibility/ax_tree_id.h"
38 #include "ui/gfx/geometry/rect.h"
39 #include "ui/gfx/native_widget_types.h"
40 #include "url/gurl.h"
41 #include "url/origin.h"
42 
43 namespace blink {
44 class AssociatedInterfaceProvider;
45 namespace mojom {
46 enum class FeaturePolicyFeature;
47 }  // namespace mojom
48 }  // namespace blink
49 
50 namespace base {
51 class UnguessableToken;
52 class Value;
53 }
54 
55 namespace features {
56 CONTENT_EXPORT extern const base::Feature kCrashReporting;
57 }  // namespace features
58 
59 namespace net {
60 class NetworkIsolationKey;
61 }
62 
63 namespace service_manager {
64 class InterfaceProvider;
65 }
66 
67 namespace ui {
68 struct AXActionData;
69 }
70 
71 namespace content {
72 
73 class RenderProcessHost;
74 class RenderViewHost;
75 class RenderWidgetHostView;
76 class SiteInstance;
77 
78 // The interface provides a communication conduit with a frame in the renderer.
79 class CONTENT_EXPORT RenderFrameHost : public IPC::Listener,
80                                        public IPC::Sender {
81  public:
82   // Constant used to denote that a lookup of a FrameTreeNode ID has failed.
83   static const int kNoFrameTreeNodeId = -1;
84 
85   // Returns the RenderFrameHost given its ID and the ID of its render process.
86   // Returns nullptr if the IDs do not correspond to a live RenderFrameHost.
87   static RenderFrameHost* FromID(GlobalFrameRoutingId id);
88   static RenderFrameHost* FromID(int render_process_id, int render_frame_id);
89 
90   // Globally allows for injecting JavaScript into the main world. This feature
91   // is present only to support Android WebView, WebLayer, Fuchsia web.Contexts,
92   // and CastOS content shell. It must not be used in other configurations.
93   static void AllowInjectingJavaScript();
94 
95   // Returns a RenderFrameHost given its accessibility tree ID.
96   static RenderFrameHost* FromAXTreeID(ui::AXTreeID ax_tree_id);
97 
98   // Returns the FrameTreeNode ID corresponding to the specified |process_id|
99   // and |routing_id|. This routing ID pair may represent a placeholder for
100   // frame that is currently rendered in a different process than |process_id|.
101   static int GetFrameTreeNodeIdForRoutingId(int process_id, int routing_id);
102 
103   // Returns the RenderFrameHost corresponding to the |placeholder_routing_id|
104   // in the given |render_process_id|. The returned RenderFrameHost will always
105   // be in a different process.  It may be null if the placeholder is not found
106   // in the given process, which may happen if the frame was recently deleted
107   // or swapped to |render_process_id| itself.
108   static RenderFrameHost* FromPlaceholderId(int render_process_id,
109                                             int placeholder_routing_id);
110 
111 #if defined(OS_ANDROID)
112   // Returns the RenderFrameHost object associated with a Java native pointer.
113   static RenderFrameHost* FromJavaRenderFrameHost(
114       const base::android::JavaRef<jobject>& jrender_frame_host_android);
115 #endif
116 
~RenderFrameHost()117   ~RenderFrameHost() override {}
118 
119   // Returns the route id for this frame.
120   virtual int GetRoutingID() = 0;
121 
122   // Returns the accessibility tree ID for this RenderFrameHost.
123   virtual ui::AXTreeID GetAXTreeID() = 0;
124 
125   // Returns the SiteInstance grouping all RenderFrameHosts that have script
126   // access to this RenderFrameHost, and must therefore live in the same
127   // process.
128   virtual SiteInstance* GetSiteInstance() = 0;
129 
130   // Returns the process for this frame.
131   virtual RenderProcessHost* GetProcess() = 0;
132 
133   // Returns the RenderWidgetHostView that can be used to control focus and
134   // visibility for this frame.
135   virtual RenderWidgetHostView* GetView() = 0;
136 
137   // Returns the parent of this RenderFrameHost, or nullptr if this
138   // RenderFrameHost is the main one and there is no parent.
139   // The result may be in a different process than the
140   // current RenderFrameHost.
141   virtual RenderFrameHost* GetParent() = 0;
142 
143   // Returns the eldest parent of this RenderFrameHost.
144   // Always non-null, but might be equal to |this|.
145   // The result may be in a different process that the current RenderFrameHost.
146   //
147   // NOTE: The result might be different from
148   // WebContents::FromRenderFrameHost(this)->GetMainFrame().
149   // This function (RenderFrameHost::GetMainFrame) is the preferred API in
150   // almost all of the cases. See RenderFrameHost::IsCurrent for the details.
151   virtual RenderFrameHost* GetMainFrame() = 0;
152 
153   // Returns a vector of all RenderFrameHosts in the subtree rooted at |this|.
154   // The results may be in different processes.
155   // TODO(https://crbug.com/1013740): Consider exposing a way for the browser
156   // process to run a function across a subtree in all renderers rather than
157   // exposing the RenderFrameHosts of the frames here.
158   virtual std::vector<RenderFrameHost*> GetFramesInSubtree() = 0;
159 
160   // Returns whether or not this RenderFrameHost is a descendant of |ancestor|.
161   // This is equivalent to check that |ancestor| is reached by iterating on
162   // GetParent().
163   // This is a strict relationship, a RenderFrameHost is never an ancestor of
164   // itself.
165   virtual bool IsDescendantOf(RenderFrameHost* ancestor) = 0;
166 
167   // Returns the FrameTreeNode ID for this frame. This ID is browser-global and
168   // uniquely identifies a frame that hosts content. The identifier is fixed at
169   // the creation of the frame and stays constant for the lifetime of the frame.
170   // When the frame is removed, the ID is not used again.
171   //
172   // A RenderFrameHost is tied to a process. Due to cross-process navigations,
173   // the RenderFrameHost may have a shorter lifetime than a frame. Consequently,
174   // the same FrameTreeNode ID may refer to a different RenderFrameHost after a
175   // navigation.
176   virtual int GetFrameTreeNodeId() = 0;
177 
178   // Used for devtools instrumentation and trace-ability. The token is
179   // propagated to Blink's LocalFrame and both Blink and content/
180   // can tag calls and requests with this token in order to attribute them
181   // to the context frame. The token is only defined by the browser process and
182   // is never sent back from the renderer in the control calls. It should be
183   // never used to look up the FrameTreeNode instance.
184   virtual base::UnguessableToken GetDevToolsFrameToken() = 0;
185 
186   // Returns the embedding token for this frame that is used by a remote parent
187   // to uniquely identify it. This will be null if the frame
188   // - is not embedded by a parent
189   // - is a local child
190   // - is not the current RFH (for example, when pending deletion)
191   virtual base::Optional<base::UnguessableToken> GetEmbeddingToken() = 0;
192 
193   // Returns the assigned name of the frame, the name of the iframe tag
194   // declaring it. For example, <iframe name="framename">[...]</iframe>. It is
195   // quite possible for a frame to have no name, in which case GetFrameName will
196   // return an empty string.
197   virtual const std::string& GetFrameName() = 0;
198 
199   // Returns true if the frame is display: none.
200   virtual bool IsFrameDisplayNone() = 0;
201 
202   // Returns the size of the frame in the viewport. The frame may not be aware
203   // of its size.
204   virtual const base::Optional<gfx::Size>& GetFrameSize() = 0;
205 
206   // Returns the distance from this frame to the root frame.
207   virtual size_t GetFrameDepth() = 0;
208 
209   // Returns true if the frame is out of process.
210   virtual bool IsCrossProcessSubframe() = 0;
211 
212   // Returns the last committed URL of the frame.
213   virtual const GURL& GetLastCommittedURL() = 0;
214 
215   // Returns the last committed origin of the frame.
216   virtual const url::Origin& GetLastCommittedOrigin() = 0;
217 
218   // Returns the network isolation key used for subresources from the currently
219   // committed navigation. It's set on commit and does not change until the next
220   // navigation is committed.
221   virtual const net::NetworkIsolationKey& GetNetworkIsolationKey() = 0;
222 
223   // Returns the associated widget's native view.
224   virtual gfx::NativeView GetNativeView() = 0;
225 
226   // Adds |message| to the DevTools console.
227   virtual void AddMessageToConsole(blink::mojom::ConsoleMessageLevel level,
228                                    const std::string& message) = 0;
229 
230   // Functions to run JavaScript in this frame's context. Pass in a callback to
231   // receive a result when it is available. If there is no need to receive the
232   // result, pass in a default-constructed callback. If provided, the callback
233   // will be invoked on the UI thread.
234   using JavaScriptResultCallback = base::OnceCallback<void(base::Value)>;
235 
236   // This is the default API to run JavaScript in this frame. This API can only
237   // be called on chrome:// or devtools:// URLs.
238   virtual void ExecuteJavaScript(const base::string16& javascript,
239                                  JavaScriptResultCallback callback) = 0;
240 
241   // This runs the JavaScript in an isolated world of the top of this frame's
242   // context.
243   virtual void ExecuteJavaScriptInIsolatedWorld(
244       const base::string16& javascript,
245       JavaScriptResultCallback callback,
246       int32_t world_id) = 0;
247 
248   // This runs the JavaScript, but without restrictions. THIS IS ONLY FOR TESTS.
249   virtual void ExecuteJavaScriptForTests(
250       const base::string16& javascript,
251       JavaScriptResultCallback callback,
252       int32_t world_id = ISOLATED_WORLD_ID_GLOBAL) = 0;
253 
254   // This runs the JavaScript, but without restrictions. THIS IS ONLY FOR TESTS.
255   // Unlike the method above, this one triggers a fake user activation
256   // notification to test functionalities that are gated by user
257   // activation.
258   virtual void ExecuteJavaScriptWithUserGestureForTests(
259       const base::string16& javascript,
260       int32_t world_id = ISOLATED_WORLD_ID_GLOBAL) = 0;
261 
262   // Send a message to the RenderFrame to trigger an action on an
263   // accessibility object.
264   virtual void AccessibilityPerformAction(const ui::AXActionData& data) = 0;
265 
266   // This is called when the user has committed to the given find in page
267   // request (e.g. by pressing enter or by clicking on the next / previous
268   // result buttons). It triggers sending a native accessibility event on
269   // the result object on the page, navigating assistive technology to that
270   // result.
271   virtual void ActivateFindInPageResultForAccessibility(int request_id) = 0;
272 
273   // Roundtrips through the renderer and compositor pipeline to ensure that any
274   // changes to the contents resulting from operations executed prior to this
275   // call are visible on screen. The call completes asynchronously by running
276   // the supplied |callback| with a value of true upon successful completion and
277   // false otherwise (when the frame is destroyed, detached, etc..).
278   using VisualStateCallback = base::OnceCallback<void(bool)>;
279   virtual void InsertVisualStateCallback(VisualStateCallback callback) = 0;
280 
281   // Copies the image at the location in viewport coordinates (not frame
282   // coordinates) to the clipboard. If there is no image at that location, does
283   // nothing.
284   virtual void CopyImageAt(int x, int y) = 0;
285 
286   // Requests to save the image at the location in viewport coordinates (not
287   // frame coordinates). If there is a data-URL-based image at the location, the
288   // renderer will post back the appropriate download message to trigger the
289   // save UI.  Nothing gets done if there is no image at that location (or if
290   // the image has a non-data URL).
291   virtual void SaveImageAt(int x, int y) = 0;
292 
293   // RenderViewHost for this frame.
294   virtual RenderViewHost* GetRenderViewHost() = 0;
295 
296   // Returns the InterfaceProvider that this process can use to bind
297   // interfaces exposed to it by the application running in this frame.
298   virtual service_manager::InterfaceProvider* GetRemoteInterfaces() = 0;
299 
300   // Returns the AssociatedInterfaceProvider that this process can use to access
301   // remote frame-specific Channel-associated interfaces for this frame.
302   virtual blink::AssociatedInterfaceProvider*
303   GetRemoteAssociatedInterfaces() = 0;
304 
305   // Returns the visibility state of the frame. The different visibility states
306   // of a frame are defined in Blink.
307   virtual PageVisibilityState GetVisibilityState() = 0;
308 
309   // Returns true if WebContentsObserver::RenderFrameCreate notification has
310   // been dispatched for this frame, and so a RenderFrameDeleted notification
311   // will later be dispatched for this frame.
312   virtual bool IsRenderFrameCreated() = 0;
313 
314   // Returns whether the RenderFrame in the renderer process has been created
315   // and still has a connection.  This is valid for all frames.
316   virtual bool IsRenderFrameLive() = 0;
317 
318   // Returns true if this RenderFrameHost is currently in the frame tree for its
319   // page. Specifically, this is when the RenderFrameHost and all of its
320   // ancestors are the current RenderFrameHost in their respective
321   // FrameTreeNodes.
322   //
323   // For instance, during a navigation, if a new RenderFrameHost replaces this
324   // RenderFrameHost, IsCurrent() becomes false for this frame and its
325   // children even if the children haven't been replaced.
326   //
327   // After a RenderFrameHost has been replaced in its frame, it will either:
328   //  1) Enter the BackForwardCache.
329   //  2) Start running unload handlers and will be deleted after this ("pending
330   //  deletion").
331   // In both cases, IsCurrent() becomes false for this frame and all its
332   // children.
333   virtual bool IsCurrent() = 0;
334 
335   // Get the number of proxies to this frame, in all processes. Exposed for
336   // use by resource metrics.
337   virtual size_t GetProxyCount() = 0;
338 
339   // Returns true if the frame has a selection.
340   virtual bool HasSelection() = 0;
341 
342   // Text surrounding selection.
343   virtual void RequestTextSurroundingSelection(
344       blink::mojom::LocalFrame::GetTextSurroundingSelectionCallback callback,
345       int max_length) = 0;
346 
347   // Generates an intervention report in this frame.
348   virtual void SendInterventionReport(const std::string& id,
349                                       const std::string& message) = 0;
350 
351   // Tell the render frame to enable a set of javascript bindings. The argument
352   // should be a combination of values from BindingsPolicy.
353   virtual void AllowBindings(int binding_flags) = 0;
354 
355   // Returns a bitwise OR of bindings types that have been enabled for this
356   // RenderFrame. See BindingsPolicy for details.
357   virtual int GetEnabledBindings() = 0;
358 
359   // Sets a property with the given name and value on the WebUI object
360   // associated with this RenderFrameHost, if one exists.
361   virtual void SetWebUIProperty(const std::string& name,
362                                 const std::string& value) = 0;
363 
364 #if defined(OS_ANDROID)
365   // Returns an InterfaceProvider for Java-implemented interfaces that are
366   // scoped to this RenderFrameHost. This provides access to interfaces
367   // implemented in Java in the browser process to C++ code in the browser
368   // process.
369   virtual service_manager::InterfaceProvider* GetJavaInterfaces() = 0;
370 #endif  // OS_ANDROID
371 
372   // Stops and disables the hang monitor for beforeunload. This avoids flakiness
373   // in tests that need to observe beforeunload dialogs, which could fail if the
374   // timeout skips the dialog.
375   virtual void DisableBeforeUnloadHangMonitorForTesting() = 0;
376   virtual bool IsBeforeUnloadHangMonitorDisabledForTesting() = 0;
377 
378   // Check whether the specific Blink feature is currently preventing fast
379   // shutdown of the frame.
380   virtual bool GetSuddenTerminationDisablerState(
381       blink::mojom::SuddenTerminationDisablerType disabler_type) = 0;
382 
383   // Returns true if the given |threshold_value| is below the threshold value
384   // specified in the policy for |feature| for this RenderFrameHost. See
385   // third_party/blink/public/common/feature_policy/feature_policy.h for how to
386   // compare values of different types. Use this in the browser process to
387   // determine whether access to a feature is allowed.
388   //
389   // TODO(chenleihu): remove this method when policy with non-boolean value
390   // fully migrated to document policy. After the migration, feature policy
391   // feature will only only hold boolean type value, and this method signature
392   // will no longer be needed.
393   virtual bool IsFeatureEnabled(blink::mojom::FeaturePolicyFeature feature,
394                                 blink::PolicyValue threshold_value) = 0;
395   // Returns true if the queried FeaturePolicyFeature is allowed by
396   // feature policy.
397   virtual bool IsFeatureEnabled(blink::mojom::FeaturePolicyFeature feature) = 0;
398 
399   // Returns true if the given |threshold_value| is below the threshold value
400   // specified in the policy for |feature| for this RenderFrameHost. See
401   // third_party/blink/public/common/feature_policy/document_policy.h for how to
402   // compare values of different types. Use this in the browser process to
403   // determine whether access to a feature is allowed.
404   virtual bool IsFeatureEnabled(blink::mojom::DocumentPolicyFeature feature,
405                                 blink::PolicyValue threshold_value) = 0;
406   // Same as above, with |threshold_value| set to the max value the given
407   // |feature| can have.
408   virtual bool IsFeatureEnabled(
409       blink::mojom::DocumentPolicyFeature feature) = 0;
410 
411   // Opens view-source tab for the document last committed in this
412   // RenderFrameHost.
413   virtual void ViewSource() = 0;
414 
415   // Starts pausing subresource loading on this frame and returns
416   // PauseSubresourceLoadingHandle that controls the pausing behavior.  As long
417   // as this handle is live, pausing will continue until an internal
418   // navigation happens in the frame.
419   virtual mojo::Remote<blink::mojom::PauseSubresourceLoadingHandle>
420   PauseSubresourceLoading() = 0;
421 
422   // Run the given action on the media player location at the given point.
423   virtual void ExecuteMediaPlayerActionAtLocation(
424       const gfx::Point& location,
425       const blink::mojom::MediaPlayerAction& action) = 0;
426 
427   // Creates a Network Service-backed factory from appropriate |NetworkContext|.
428   // If this returns true, any redirect safety checks should be bypassed in
429   // downstream loaders.
430   virtual bool CreateNetworkServiceDefaultFactory(
431       mojo::PendingReceiver<network::mojom::URLLoaderFactory>
432           default_factory_receiver) = 0;
433 
434   // Requests that future URLLoaderFactoryBundle(s) sent to the renderer should
435   // use a separate URLLoaderFactory for requests initiated by isolated worlds
436   // listed in |isolated_world_origins|.  The URLLoaderFactory(s) for each
437   // origin will be created via
438   // ContentBrowserClient::CreateURLLoaderFactoryForNetworkRequests method.
439   virtual void MarkIsolatedWorldsAsRequiringSeparateURLLoaderFactory(
440       base::flat_set<url::Origin> isolated_world_origins,
441       bool push_to_renderer_now) = 0;
442 
443   // Returns true if the given sandbox flag |flags| is in effect on this frame.
444   // The effective flags include those which have been set by a
445   // Content-Security-Policy header, in addition to those which are set by the
446   // embedding frame.
447   virtual bool IsSandboxed(blink::mojom::WebSandboxFlags flags) = 0;
448 
449   // Calls |FlushForTesting()| on Network Service and FrameNavigationControl
450   // related interfaces to make sure all in-flight mojo messages have been
451   // received by the other end. For test use only.
452   virtual void FlushNetworkAndNavigationInterfacesForTesting() = 0;
453 
454   using PrepareForInnerWebContentsAttachCallback =
455       base::OnceCallback<void(RenderFrameHost*)>;
456   // This API is used to provide the caller with a RenderFrameHost which is safe
457   // for usage in WebContents::AttachToOuterWebContentsFrame API. The final
458   // frame returned with |callback| will share the same FrameTreeNodeId with
459   // this RenderFrameHost but might not necessarily be the same RenderFrameHost.
460   // IMPORTANT: This method can only be called on a child frame. It does not
461   // make sense to attach an inner WebContents to the outer WebContents main
462   // frame.
463   // Essentially, this method will:
464   //  1- Cancel any ongoing navigation and navigation requests for this frame.
465   //  2- Dispatch beforeunload event on this frame and all of the frame's
466   //     subframes, and wait for all beforeunload events to complete.
467   //  3- Will create and return a new RenderFrameHost (destroying this one) if
468   //     this RenderFrameHost is a cross-process subframe.
469   // After steps 1-3 are completed, the callback is invoked asynchronously with
470   // the RenderFrameHost which can be safely used for attaching. This
471   // RenderFrameHost could be different than |this| which is the case if this
472   // RenderFrameHost is for a cross-process frame. The callback could also be
473   // invoked with nullptr. This happens if:
474   //  1- This frame has beforeunload handlers under it and the user decides to
475   //     remain on the page in response to beforeunload prompt.
476   //  2- Preparations happened successfully but the frame was somehow removed (
477   //     e.g. parent frame detached).
478   virtual void PrepareForInnerWebContentsAttach(
479       PrepareForInnerWebContentsAttachCallback callback) = 0;
480 
481   // Re-creates loader factories and pushes them to |RenderFrame|.
482   // Used in case we need to add or remove intercepting proxies to the
483   // running renderer, or in case of Network Service connection errors.
484   virtual void UpdateSubresourceLoaderFactories() = 0;
485 
486   // Returns the type of frame owner element for the FrameTreeNode associated
487   // with this RenderFrameHost (e.g., <iframe>, <object>, etc). Note that it
488   // returns blink::FrameOwnerElementType::kNone if the RenderFrameHost is a
489   // main frame.
490   virtual blink::FrameOwnerElementType GetFrameOwnerElementType() = 0;
491 
492   // Returns the transient bit of the User Activation v2 state of the
493   // FrameTreeNode associated with this RenderFrameHost.
494   virtual bool HasTransientUserActivation() = 0;
495 
496   // Notifies the renderer whether hiding/showing the browser controls is
497   // enabled, what the current state should be, and whether or not to animate to
498   // the proper state.
499   virtual void UpdateBrowserControlsState(BrowserControlsState constraints,
500                                           BrowserControlsState current,
501                                           bool animate) = 0;
502 
503   // Reloads the frame if it is live. It initiates a reload but doesn't wait for
504   // it to finish.
505   virtual void Reload() = 0;
506 
507   // Returns true if this frame has fired DOMContentLoaded.
508   virtual bool IsDOMContentLoaded() = 0;
509 
510   // Update the ad frame state. The parameter |ad_frame_type| cannot be kNonAd,
511   // and once this has been called, it cannot be called again with a different
512   // |ad_frame_type|, since once a frame is determined to be an ad, it will stay
513   // tagged as an ad of the same type for its entire lifetime.
514   //
515   // Note: The ad frame type is currently maintained and updated *outside*
516   // content. This is used to ensure the render frame proxies are in sync (since
517   // they aren't exposed in the public API). Eventually, we might be able to
518   // simplify this somewhat (maybe //content would be responsible for
519   // maintaining the state, with some content client method used to update it).
520   virtual void UpdateAdFrameType(blink::mojom::AdFrameType ad_frame_type) = 0;
521 
522   // Perform security checks on Web Authentication requests. These can be
523   // called by other |Authenticator| mojo interface implementations in the
524   // browser process so that they don't have to duplicate security policies.
525   virtual blink::mojom::AuthenticatorStatus
526   PerformGetAssertionWebAuthSecurityChecks(
527       const std::string& relying_party_id) = 0;
528   virtual blink::mojom::AuthenticatorStatus
529   PerformMakeCredentialWebAuthSecurityChecks(
530       const std::string& relying_party_id) = 0;
531 
532   // Tells the host that this is part of setting up a WebXR DOM Overlay. This
533   // starts a short timer that permits entering fullscreen mode, similar to a
534   // recent orientation change.
535   virtual void SetIsXrOverlaySetup() = 0;
536 
537  private:
538   // This interface should only be implemented inside content.
539   friend class RenderFrameHostImpl;
RenderFrameHost()540   RenderFrameHost() {}
541 };
542 
543 }  // namespace content
544 
545 #endif  // CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_
546