cc: Make picture pile base thread safe.
[chromium-blink-merge.git] / content / browser / frame_host / render_frame_host_impl.h
blobc63ae2732d916dabf59399f8394208b1572d0fbf
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.
5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
8 #include <map>
9 #include <vector>
11 #include "base/callback.h"
12 #include "base/compiler_specific.h"
13 #include "base/gtest_prod_util.h"
14 #include "base/memory/weak_ptr.h"
15 #include "base/strings/string16.h"
16 #include "base/time/time.h"
17 #include "content/browser/accessibility/browser_accessibility_manager.h"
18 #include "content/browser/site_instance_impl.h"
19 #include "content/common/accessibility_mode_enums.h"
20 #include "content/common/content_export.h"
21 #include "content/common/mojo/service_registry_impl.h"
22 #include "content/public/browser/render_frame_host.h"
23 #include "content/public/common/javascript_message_type.h"
24 #include "net/http/http_response_headers.h"
25 #include "third_party/WebKit/public/web/WebTextDirection.h"
26 #include "ui/accessibility/ax_node_data.h"
27 #include "ui/base/page_transition_types.h"
29 #if defined(OS_ANDROID)
30 #include "content/browser/mojo/service_registry_android.h"
31 #endif
33 class GURL;
34 struct AccessibilityHostMsg_EventParams;
35 struct AccessibilityHostMsg_LocationChangeParams;
36 struct FrameHostMsg_DidFailProvisionalLoadWithError_Params;
37 struct FrameHostMsg_OpenURL_Params;
38 struct FrameHostMsg_BeginNavigation_Params;
39 struct FrameMsg_Navigate_Params;
40 #if defined(OS_MACOSX) || defined(OS_ANDROID)
41 struct FrameHostMsg_ShowPopup_Params;
42 #endif
44 namespace base {
45 class FilePath;
46 class ListValue;
49 namespace content {
51 class CrossProcessFrameConnector;
52 class CrossSiteTransferringRequest;
53 class FrameTree;
54 class FrameTreeNode;
55 class RenderFrameHostDelegate;
56 class RenderFrameProxyHost;
57 class RenderProcessHost;
58 class RenderViewHostImpl;
59 class RenderWidgetHostImpl;
60 class StreamHandle;
61 class TimeoutMonitor;
62 struct CommitNavigationParams;
63 struct CommonNavigationParams;
64 struct ContextMenuParams;
65 struct GlobalRequestID;
66 struct Referrer;
67 struct ResourceResponse;
68 struct ShowDesktopNotificationHostMsgParams;
69 struct TransitionLayerData;
71 class CONTENT_EXPORT RenderFrameHostImpl
72 : public RenderFrameHost,
73 public BrowserAccessibilityDelegate {
74 public:
75 // Keeps track of the state of the RenderFrameHostImpl, particularly with
76 // respect to swap out.
77 enum RenderFrameHostImplState {
78 // The standard state for a RFH handling the communication with an active
79 // RenderFrame.
80 STATE_DEFAULT = 0,
81 // The RFH has not received the SwapOutACK yet, but the new page has
82 // committed in a different RFH. Upon reception of the SwapOutACK, the RFH
83 // will either enter STATE_SWAPPED_OUT (if it is a main frame and there are
84 // other active frames in its SiteInstance) or it will be deleted.
85 STATE_PENDING_SWAP_OUT,
86 // The RFH is swapped out and stored inside a RenderFrameProxyHost, being
87 // used as a placeholder to allow cross-process communication. Only main
88 // frames can enter this state.
89 STATE_SWAPPED_OUT,
91 // Helper function to determine whether the RFH state should contribute to the
92 // number of active frames of a SiteInstance or not.
93 static bool IsRFHStateActive(RenderFrameHostImplState rfh_state);
95 // An accessibility reset is only allowed to prevent very rare corner cases
96 // or race conditions where the browser and renderer get out of sync. If
97 // this happens more than this many times, kill the renderer.
98 static const int kMaxAccessibilityResets = 5;
100 static RenderFrameHostImpl* FromID(int process_id, int routing_id);
102 ~RenderFrameHostImpl() override;
104 // RenderFrameHost
105 int GetRoutingID() override;
106 SiteInstanceImpl* GetSiteInstance() override;
107 RenderProcessHost* GetProcess() override;
108 RenderFrameHost* GetParent() override;
109 const std::string& GetFrameName() override;
110 bool IsCrossProcessSubframe() override;
111 GURL GetLastCommittedURL() override;
112 gfx::NativeView GetNativeView() override;
113 void ExecuteJavaScript(const base::string16& javascript) override;
114 void ExecuteJavaScript(const base::string16& javascript,
115 const JavaScriptResultCallback& callback) override;
116 void ExecuteJavaScriptForTests(const base::string16& javascript) override;
117 RenderViewHost* GetRenderViewHost() override;
118 ServiceRegistry* GetServiceRegistry() override;
120 // IPC::Sender
121 bool Send(IPC::Message* msg) override;
123 // IPC::Listener
124 bool OnMessageReceived(const IPC::Message& msg) override;
126 // BrowserAccessibilityDelegate
127 void AccessibilitySetFocus(int acc_obj_id) override;
128 void AccessibilityDoDefaultAction(int acc_obj_id) override;
129 void AccessibilityShowMenu(const gfx::Point& global_point) override;
130 void AccessibilityScrollToMakeVisible(int acc_obj_id,
131 const gfx::Rect& subfocus) override;
132 void AccessibilityScrollToPoint(int acc_obj_id,
133 const gfx::Point& point) override;
134 void AccessibilitySetTextSelection(int acc_obj_id,
135 int start_offset,
136 int end_offset) override;
137 bool AccessibilityViewHasFocus() const override;
138 gfx::Rect AccessibilityGetViewBounds() const override;
139 gfx::Point AccessibilityOriginInScreen(
140 const gfx::Rect& bounds) const override;
141 void AccessibilityHitTest(const gfx::Point& point) override;
142 void AccessibilityFatalError() override;
143 gfx::AcceleratedWidget AccessibilityGetAcceleratedWidget() override;
144 gfx::NativeViewAccessible AccessibilityGetNativeViewAccessible() override;
145 BrowserAccessibilityManager* AccessibilityGetChildFrame(
146 int accessibility_node_id) override;
147 BrowserAccessibility* AccessibilityGetParentFrame() override;
149 // Creates a RenderFrame in the renderer process. Only called for
150 // cross-process subframe navigations in --site-per-process.
151 bool CreateRenderFrame(int parent_routing_id);
153 // Returns whether the RenderFrame in the renderer process has been created
154 // and still has a connection. This is valid for all frames.
155 bool IsRenderFrameLive();
157 // Tracks whether the RenderFrame for this RenderFrameHost has been created in
158 // the renderer process. This is currently only used for subframes.
159 // TODO(creis): Use this for main frames as well when RVH goes away.
160 void set_render_frame_created(bool created) {
161 render_frame_created_ = created;
164 // Called for renderer-created windows to resume requests from this frame,
165 // after they are blocked in RenderWidgetHelper::CreateNewWindow.
166 void Init();
168 int routing_id() const { return routing_id_; }
169 void OnCreateChildFrame(int new_routing_id,
170 const std::string& frame_name);
172 RenderViewHostImpl* render_view_host() { return render_view_host_; }
173 RenderFrameHostDelegate* delegate() { return delegate_; }
174 FrameTreeNode* frame_tree_node() { return frame_tree_node_; }
175 // TODO(nasko): The RenderWidgetHost will be owned by RenderFrameHost in
176 // the future, so update this accessor to return the right pointer.
177 RenderWidgetHostImpl* GetRenderWidgetHost();
179 // This function is called when this is a swapped out RenderFrameHost that
180 // lives in the same process as the parent frame. The
181 // |cross_process_frame_connector| allows the non-swapped-out
182 // RenderFrameHost for a frame to communicate with the parent process
183 // so that it may composite drawing data.
185 // Ownership is not transfered.
186 void set_cross_process_frame_connector(
187 CrossProcessFrameConnector* cross_process_frame_connector) {
188 cross_process_frame_connector_ = cross_process_frame_connector;
191 void set_render_frame_proxy_host(RenderFrameProxyHost* proxy) {
192 render_frame_proxy_host_ = proxy;
195 // Returns a bitwise OR of bindings types that have been enabled for this
196 // RenderFrameHostImpl's RenderView. See BindingsPolicy for details.
197 // TODO(creis): Make bindings frame-specific, to support cases like <webview>.
198 int GetEnabledBindings();
200 // Called on the pending RenderFrameHost when the network response is ready to
201 // commit. We should ensure that the old RenderFrameHost runs its unload
202 // handler and determine whether a transfer to a different RenderFrameHost is
203 // needed.
204 void OnCrossSiteResponse(
205 const GlobalRequestID& global_request_id,
206 scoped_ptr<CrossSiteTransferringRequest> cross_site_transferring_request,
207 const std::vector<GURL>& transfer_url_chain,
208 const Referrer& referrer,
209 ui::PageTransition page_transition,
210 bool should_replace_current_entry);
212 // Called on the current RenderFrameHost when the network response is first
213 // receieved.
214 void OnDeferredAfterResponseStarted(
215 const GlobalRequestID& global_request_id,
216 const TransitionLayerData& transition_data);
218 // Tells the renderer that this RenderFrame is being swapped out for one in a
219 // different renderer process. It should run its unload handler and move to
220 // a blank document. If |proxy| is not null, it should also create a
221 // RenderFrameProxy to replace the RenderFrame. The renderer should preserve
222 // the RenderFrameProxy object until it exits, in case we come back. The
223 // renderer can exit if it has no other active RenderFrames, but not until
224 // WasSwappedOut is called.
225 void SwapOut(RenderFrameProxyHost* proxy);
227 bool is_waiting_for_beforeunload_ack() const {
228 return is_waiting_for_beforeunload_ack_;
231 // Whether the RFH is waiting for an unload ACK from the renderer.
232 bool IsWaitingForUnloadACK() const;
234 // Called when either the SwapOut request has been acknowledged or has timed
235 // out.
236 void OnSwappedOut();
238 // Whether this RenderFrameHost has been swapped out, such that the frame is
239 // now rendered by a RenderFrameHost in a different process.
240 bool is_swapped_out() const { return rfh_state_ == STATE_SWAPPED_OUT; }
242 // The current state of this RFH.
243 RenderFrameHostImplState rfh_state() const { return rfh_state_; }
245 // Sends the given navigation message. Use this rather than sending it
246 // yourself since this does the internal bookkeeping described below. This
247 // function takes ownership of the provided message pointer.
249 // If a cross-site request is in progress, we may be suspended while waiting
250 // for the onbeforeunload handler, so this function might buffer the message
251 // rather than sending it.
252 void Navigate(const FrameMsg_Navigate_Params& params);
254 // Load the specified URL; this is a shortcut for Navigate().
255 void NavigateToURL(const GURL& url);
257 // Treat this prospective navigation as thought it originated from the
258 // frame. Used, e.g., for a navigation request that originated from
259 // a RemoteFrame.
260 void OpenURL(const FrameHostMsg_OpenURL_Params& params);
262 // Stop the load in progress.
263 void Stop();
265 // Returns whether navigation messages are currently suspended for this
266 // RenderFrameHost. Only true during a cross-site navigation, while waiting
267 // for the onbeforeunload handler.
268 bool are_navigations_suspended() const { return navigations_suspended_; }
270 // Suspends (or unsuspends) any navigation messages from being sent from this
271 // RenderFrameHost. This is called when a pending RenderFrameHost is created
272 // for a cross-site navigation, because we must suspend any navigations until
273 // we hear back from the old renderer's onbeforeunload handler. Note that it
274 // is important that only one navigation event happen after calling this
275 // method with |suspend| equal to true. If |suspend| is false and there is a
276 // suspended_nav_message_, this will send the message. This function should
277 // only be called to toggle the state; callers should check
278 // are_navigations_suspended() first. If |suspend| is false, the time that the
279 // user decided the navigation should proceed should be passed as
280 // |proceed_time|.
281 void SetNavigationsSuspended(bool suspend,
282 const base::TimeTicks& proceed_time);
284 // Clears any suspended navigation state after a cross-site navigation is
285 // canceled or suspended. This is important if we later return to this
286 // RenderFrameHost.
287 void CancelSuspendedNavigations();
289 // Runs the beforeunload handler for this frame. |for_cross_site_transition|
290 // indicates whether this call is for the current frame during a cross-process
291 // navigation. False means we're closing the entire tab.
292 void DispatchBeforeUnload(bool for_cross_site_transition);
294 // Set the frame's opener to null in the renderer process in response to an
295 // action in another renderer process.
296 void DisownOpener();
298 // Deletes the current selection plus the specified number of characters
299 // before and after the selection or caret.
300 void ExtendSelectionAndDelete(size_t before, size_t after);
302 // Notifies the RenderFrame that the JavaScript message that was shown was
303 // closed by the user.
304 void JavaScriptDialogClosed(IPC::Message* reply_msg,
305 bool success,
306 const base::string16& user_input,
307 bool dialog_was_suppressed);
309 // Called when an HTML5 notification is closed.
310 void NotificationClosed(int notification_id);
312 // Clears any outstanding transition request. This is called when we hear the
313 // response or commit.
314 void ClearPendingTransitionRequestData();
316 // Send a message to the renderer process to change the accessibility mode.
317 void SetAccessibilityMode(AccessibilityMode AccessibilityMode);
319 // Turn on accessibility testing. The given callback will be run
320 // every time an accessibility notification is received from the
321 // renderer process, and the accessibility tree it sent can be
322 // retrieved using GetAXTreeForTesting().
323 void SetAccessibilityCallbackForTesting(
324 const base::Callback<void(ui::AXEvent, int)>& callback);
326 // Returns a snapshot of the accessibility tree received from the
327 // renderer as of the last time an accessibility notification was
328 // received.
329 const ui::AXTree* GetAXTreeForTesting();
331 // Access the BrowserAccessibilityManager if it already exists.
332 BrowserAccessibilityManager* browser_accessibility_manager() const {
333 return browser_accessibility_manager_.get();
336 // If accessibility is enabled, get the BrowserAccessibilityManager for
337 // this frame, or create one if it doesn't exist yet, otherwise return
338 // NULL.
339 BrowserAccessibilityManager* GetOrCreateBrowserAccessibilityManager();
341 void set_no_create_browser_accessibility_manager_for_testing(bool flag) {
342 no_create_browser_accessibility_manager_for_testing_ = flag;
345 #if defined(OS_WIN)
346 void SetParentNativeViewAccessible(
347 gfx::NativeViewAccessible accessible_parent);
348 gfx::NativeViewAccessible GetParentNativeViewAccessible() const;
349 #elif defined(OS_MACOSX)
350 // Select popup menu related methods (for external popup menus).
351 void DidSelectPopupMenuItem(int selected_index);
352 void DidCancelPopupMenu();
353 #elif defined(OS_ANDROID)
354 void DidSelectPopupMenuItems(const std::vector<int>& selected_indices);
355 void DidCancelPopupMenu();
356 #endif
358 // PlzNavigate: Indicates that a navigation is ready to commit and can be
359 // handled by this RenderFrame.
360 void CommitNavigation(ResourceResponse* response,
361 scoped_ptr<StreamHandle> body,
362 const CommonNavigationParams& common_params,
363 const CommitNavigationParams& commit_params);
365 // Sets up the Mojo connection between this instance and its associated render
366 // frame if it has not yet been set up.
367 void SetUpMojoIfNeeded();
369 // Tears down the browser-side state relating to the Mojo connection between
370 // this instance and its associated render frame.
371 void InvalidateMojoConnection();
373 protected:
374 friend class RenderFrameHostFactory;
376 // TODO(nasko): Remove dependency on RenderViewHost here. RenderProcessHost
377 // should be the abstraction needed here, but we need RenderViewHost to pass
378 // into WebContentsObserver::FrameDetached for now.
379 RenderFrameHostImpl(RenderViewHostImpl* render_view_host,
380 RenderFrameHostDelegate* delegate,
381 FrameTree* frame_tree,
382 FrameTreeNode* frame_tree_node,
383 int routing_id,
384 bool is_swapped_out);
386 private:
387 friend class TestRenderFrameHost;
388 friend class TestRenderViewHost;
390 FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest, CrashSubframe);
392 // IPC Message handlers.
393 void OnAddMessageToConsole(int32 level,
394 const base::string16& message,
395 int32 line_no,
396 const base::string16& source_id);
397 void OnDetach();
398 void OnFrameFocused();
399 void OnOpenURL(const FrameHostMsg_OpenURL_Params& params);
400 void OnDocumentOnLoadCompleted();
401 void OnDidStartProvisionalLoadForFrame(const GURL& url,
402 bool is_transition_navigation);
403 void OnDidFailProvisionalLoadWithError(
404 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params);
405 void OnDidFailLoadWithError(
406 const GURL& url,
407 int error_code,
408 const base::string16& error_description);
409 void OnDidCommitProvisionalLoad(const IPC::Message& msg);
410 void OnBeforeUnloadACK(
411 bool proceed,
412 const base::TimeTicks& renderer_before_unload_start_time,
413 const base::TimeTicks& renderer_before_unload_end_time);
414 void OnSwapOutACK();
415 void OnContextMenu(const ContextMenuParams& params);
416 void OnJavaScriptExecuteResponse(int id, const base::ListValue& result);
417 void OnRunJavaScriptMessage(const base::string16& message,
418 const base::string16& default_prompt,
419 const GURL& frame_url,
420 JavaScriptMessageType type,
421 IPC::Message* reply_msg);
422 void OnRunBeforeUnloadConfirm(const GURL& frame_url,
423 const base::string16& message,
424 bool is_reload,
425 IPC::Message* reply_msg);
426 void OnRequestPlatformNotificationPermission(const GURL& origin,
427 int request_id);
428 void OnShowDesktopNotification(
429 int notification_id,
430 const ShowDesktopNotificationHostMsgParams& params);
431 void OnCancelDesktopNotification(int notification_id);
432 void OnTextSurroundingSelectionResponse(const base::string16& content,
433 size_t start_offset,
434 size_t end_offset);
435 void OnDidAccessInitialDocument();
436 void OnDidDisownOpener();
437 void OnDidAssignPageId(int32 page_id);
438 void OnUpdateTitle(int32 page_id,
439 const base::string16& title,
440 blink::WebTextDirection title_direction);
441 void OnUpdateEncoding(const std::string& encoding);
442 void OnBeginNavigation(const FrameHostMsg_BeginNavigation_Params& params,
443 const CommonNavigationParams& common_params);
444 void OnAccessibilityEvents(
445 const std::vector<AccessibilityHostMsg_EventParams>& params,
446 int reset_token);
447 void OnAccessibilityLocationChanges(
448 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params);
450 #if defined(OS_MACOSX) || defined(OS_ANDROID)
451 void OnShowPopup(const FrameHostMsg_ShowPopup_Params& params);
452 void OnHidePopup();
453 #endif
455 // Updates the state of this RenderFrameHost and clears any waiting state
456 // that is no longer relevant.
457 void SetState(RenderFrameHostImplState rfh_state);
459 // Returns whether the given URL is allowed to commit in the current process.
460 // This is a more conservative check than RenderProcessHost::FilterURL, since
461 // it will be used to kill processes that commit unauthorized URLs.
462 bool CanCommitURL(const GURL& url);
464 void PlatformNotificationPermissionRequestDone(int request_id, bool granted);
466 // Update the the singleton FrameAccessibility instance with a map
467 // from accessibility node id to the frame routing id of a cross-process
468 // iframe.
469 void UpdateCrossProcessIframeAccessibility(
470 const std::map<int32, int> node_to_frame_routing_id_map);
472 // Update the the singleton FrameAccessibility instance with a map
473 // from accessibility node id to the browser plugin instance id of a
474 // guest WebContents.
475 void UpdateGuestFrameAccessibility(
476 const std::map<int32, int> node_to_browser_plugin_instance_id_map);
478 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a
479 // refcount that calls Shutdown when it reaches zero. This allows each
480 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring
481 // we have a RenderViewHost for each RenderFrameHost.
482 // TODO(creis): RenderViewHost will eventually go away and be replaced with
483 // some form of page context.
484 RenderViewHostImpl* render_view_host_;
486 RenderFrameHostDelegate* delegate_;
488 // |cross_process_frame_connector_| passes messages from an out-of-process
489 // child frame to the parent process for compositing.
491 // This is only non-NULL when this is the swapped out RenderFrameHost in
492 // the same site instance as this frame's parent.
494 // See the class comment above CrossProcessFrameConnector for more
495 // information.
497 // This will move to RenderFrameProxyHost when that class is created.
498 CrossProcessFrameConnector* cross_process_frame_connector_;
500 // The proxy created for this RenderFrameHost. It is used to send and receive
501 // IPC messages while in swapped out state.
502 // TODO(nasko): This can be removed once we don't have a swapped out state on
503 // RenderFrameHosts. See https://crbug.com/357747.
504 RenderFrameProxyHost* render_frame_proxy_host_;
506 // Reference to the whole frame tree that this RenderFrameHost belongs to.
507 // Allows this RenderFrameHost to add and remove nodes in response to
508 // messages from the renderer requesting DOM manipulation.
509 FrameTree* frame_tree_;
511 // The FrameTreeNode which this RenderFrameHostImpl is hosted in.
512 FrameTreeNode* frame_tree_node_;
514 // The mapping of pending JavaScript calls created by
515 // ExecuteJavaScript and their corresponding callbacks.
516 std::map<int, JavaScriptResultCallback> javascript_callbacks_;
518 // Map from notification_id to a callback to cancel them.
519 std::map<int, base::Closure> cancel_notification_callbacks_;
521 int routing_id_;
523 // The current state of this RenderFrameHost.
524 RenderFrameHostImplState rfh_state_;
526 // Tracks whether the RenderFrame for this RenderFrameHost has been created in
527 // the renderer process. Currently only used for subframes.
528 // TODO(creis): Use this for main frames as well when RVH goes away.
529 bool render_frame_created_;
531 // Whether we should buffer outgoing Navigate messages rather than sending
532 // them. This will be true when a RenderFrameHost is created for a cross-site
533 // request, until we hear back from the onbeforeunload handler of the old
534 // RenderFrameHost.
535 bool navigations_suspended_;
537 // We only buffer the params for a suspended navigation while this RFH is the
538 // pending RenderFrameHost of a RenderFrameHostManager. There will only ever
539 // be one suspended navigation, because RenderFrameHostManager will destroy
540 // the pending RenderFrameHost and create a new one if a second navigation
541 // occurs.
542 scoped_ptr<FrameMsg_Navigate_Params> suspended_nav_params_;
544 // When the last BeforeUnload message was sent.
545 base::TimeTicks send_before_unload_start_time_;
547 // Set to true when there is a pending FrameMsg_ShouldClose message. This
548 // ensures we don't spam the renderer with multiple beforeunload requests.
549 // When either this value or IsWaitingForUnloadACK is true, the value of
550 // unload_ack_is_for_cross_site_transition_ indicates whether this is for a
551 // cross-site transition or a tab close attempt.
552 // TODO(clamy): Remove this boolean and add one more state to the state
553 // machine.
554 bool is_waiting_for_beforeunload_ack_;
556 // Valid only when is_waiting_for_beforeunload_ack_ or
557 // IsWaitingForUnloadACK is true. This tells us if the unload request
558 // is for closing the entire tab ( = false), or only this RenderFrameHost in
559 // the case of a cross-site transition ( = true).
560 bool unload_ack_is_for_cross_site_transition_;
562 // Used to swap out or shut down this RFH when the unload event is taking too
563 // long to execute, depending on the number of active frames in the
564 // SiteInstance.
565 scoped_ptr<TimeoutMonitor> swapout_event_monitor_timeout_;
567 scoped_ptr<ServiceRegistryImpl> service_registry_;
569 #if defined(OS_ANDROID)
570 scoped_ptr<ServiceRegistryAndroid> service_registry_android_;
571 #endif
573 // The object managing the accessibility tree for this frame.
574 scoped_ptr<BrowserAccessibilityManager> browser_accessibility_manager_;
576 // This is nonzero if we sent an accessibility reset to the renderer and
577 // we're waiting for an IPC containing this reset token (sequentially
578 // assigned) and a complete replacement accessibility tree.
579 int accessibility_reset_token_;
581 // A count of the number of times we needed to reset accessibility, so
582 // we don't keep trying to reset forever.
583 int accessibility_reset_count_;
585 // Callback when an event is received, for testing.
586 base::Callback<void(ui::AXEvent, int)> accessibility_testing_callback_;
587 // The most recently received accessibility tree - for testing only.
588 scoped_ptr<ui::AXTree> ax_tree_for_testing_;
589 // Flag to not create a BrowserAccessibilityManager, for testing. If one
590 // already exists it will still be used.
591 bool no_create_browser_accessibility_manager_for_testing_;
593 // PlzNavigate: Owns the stream used in navigations to store the body of the
594 // response once it has started.
595 scoped_ptr<StreamHandle> stream_handle_;
597 // NOTE: This must be the last member.
598 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_;
600 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl);
603 } // namespace content
605 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_